diff --git a/DEPS b/DEPS index 4fdce134d..13c2fb5e 100644 --- a/DEPS +++ b/DEPS
@@ -105,11 +105,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': '32c7d4dfcdca44040873d72e71068ec0874a76b1', + 'skia_revision': 'c97a339cd60116451f626da92c88a8c02cb48fbf', # 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': '022206d597f5249808477d6094e1df4df94326dc', + 'v8_revision': '091d6f21ab1719f42c4ac763d89d5d754f07046c', # 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. @@ -181,7 +181,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. - 'feed_revision': '75614b922b359cc739614fb53b34817cabd69d82', + 'feed_revision': 'a4e91c7238e329ad11e48b068fe3b1e935c0de9b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version # and whatever else without interference from each other. @@ -552,7 +552,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'a66ea19e9d55701f308e508996bcec2b2c8c8734', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '21a68ae8e5fa4dfd5dd2c3aeb619227e7ea3ff4e', 'condition': 'checkout_linux', }, @@ -577,7 +577,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '52c7211807930272424213ff6127c209de790eca', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'af03ae194f784a9ba5e21e1a9524883482f819b6', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'),
diff --git a/ash/accelerators/debug_commands.cc b/ash/accelerators/debug_commands.cc index 77b6851..cc81537 100644 --- a/ash/accelerators/debug_commands.cc +++ b/ash/accelerators/debug_commands.cc
@@ -57,6 +57,7 @@ void PrintWindowHierarchy(ui::ws2::WindowService* window_service, const aura::Window* active_window, + const aura::Window* focused_window, aura::Window* window, int indent, std::ostringstream* out) { @@ -69,6 +70,7 @@ *out << indent_str << name << " (" << window << ")" << " type=" << window->type() << ((window == active_window) ? " [active]" : "") + << ((window == focused_window) ? " [focused]" : "") << (window->IsVisible() ? " visible" : "") << " " << window->bounds().ToString(); if (window->GetProperty(::wm::kSnapChildrenToPixelBoundary)) @@ -79,19 +81,23 @@ *out << " remote_id=" << window_service->GetIdForDebugging(window); *out << '\n'; - for (aura::Window* child : window->children()) - PrintWindowHierarchy(window_service, active_window, child, indent + 3, out); + for (aura::Window* child : window->children()) { + PrintWindowHierarchy(window_service, active_window, focused_window, child, + indent + 3, out); + } } void HandlePrintWindowHierarchy() { aura::Window* active_window = wm::GetActiveWindow(); + aura::Window* focused_window = wm::GetFocusedWindow(); aura::Window::Windows roots = Shell::Get()->GetAllRootWindows(); ui::ws2::WindowService* window_service = Shell::Get()->window_service_owner()->window_service(); for (size_t i = 0; i < roots.size(); ++i) { std::ostringstream out; out << "RootWindow " << i << ":\n"; - PrintWindowHierarchy(window_service, active_window, roots[i], 0, &out); + PrintWindowHierarchy(window_service, active_window, focused_window, + roots[i], 0, &out); // Error so logs can be collected from end-users. LOG(ERROR) << out.str(); }
diff --git a/ash/accessibility/accessibility_controller.cc b/ash/accessibility/accessibility_controller.cc index 7e2c33d2..e35a334 100644 --- a/ash/accessibility/accessibility_controller.cc +++ b/ash/accessibility/accessibility_controller.cc
@@ -225,18 +225,6 @@ message_center->AddNotification(std::move(notification)); } -AccessibilityPanelLayoutManager* GetLayoutManager() { - // The accessibility panel is only shown on the primary display. - aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::Window* container = - Shell::GetContainer(root, kShellWindowId_AccessibilityPanelContainer); - // TODO(jamescook): Avoid this cast by moving ash::AccessibilityObserver - // ownership to this class and notifying it on accessibility panel fullscreen - // updates. - return static_cast<AccessibilityPanelLayoutManager*>( - container->layout_manager()); -} - } // namespace AccessibilityController::AccessibilityController( @@ -715,15 +703,17 @@ accessibility_highlight_controller_->SetCaretBounds(bounds_in_screen); } -void AccessibilityController::SetAccessibilityPanelAlwaysVisible( - bool always_visible) { - GetLayoutManager()->SetAlwaysVisible(always_visible); -} - -void AccessibilityController::SetAccessibilityPanelBounds( - const gfx::Rect& bounds, - mojom::AccessibilityPanelState state) { - GetLayoutManager()->SetPanelBounds(bounds, state); +void AccessibilityController::SetAccessibilityPanelFullscreen(bool fullscreen) { + // The accessibility panel is only shown on the primary display. + aura::Window* root = Shell::GetPrimaryRootWindow(); + aura::Window* container = + Shell::GetContainer(root, kShellWindowId_AccessibilityPanelContainer); + // TODO(jamescook): Avoid this cast by moving ash::AccessibilityObserver + // ownership to this class and notifying it on ChromeVox fullscreen updates. + AccessibilityPanelLayoutManager* layout = + static_cast<AccessibilityPanelLayoutManager*>( + container->layout_manager()); + layout->SetPanelFullscreen(fullscreen); } void AccessibilityController::OnSigninScreenPrefServiceInitialized(
diff --git a/ash/accessibility/accessibility_controller.h b/ash/accessibility/accessibility_controller.h index 219d55d..e1ad856 100644 --- a/ash/accessibility/accessibility_controller.h +++ b/ash/accessibility/accessibility_controller.h
@@ -163,10 +163,7 @@ void BrailleDisplayStateChanged(bool connected) override; void SetFocusHighlightRect(const gfx::Rect& bounds_in_screen) override; void SetCaretBounds(const gfx::Rect& bounds_in_screen) override; - void SetAccessibilityPanelAlwaysVisible(bool always_visible) override; - void SetAccessibilityPanelBounds( - const gfx::Rect& bounds, - mojom::AccessibilityPanelState state) override; + void SetAccessibilityPanelFullscreen(bool fullscreen) override; void SetSelectToSpeakState(mojom::SelectToSpeakState state) override; // SessionObserver:
diff --git a/ash/accessibility/accessibility_panel_layout_manager.cc b/ash/accessibility/accessibility_panel_layout_manager.cc index 949b0b1..91704ce 100644 --- a/ash/accessibility/accessibility_panel_layout_manager.cc +++ b/ash/accessibility/accessibility_panel_layout_manager.cc
@@ -26,20 +26,11 @@ display::Screen::GetScreen()->RemoveObserver(this); } -void AccessibilityPanelLayoutManager::SetAlwaysVisible(bool always_visible) { - always_visible_ = always_visible; +void AccessibilityPanelLayoutManager::SetPanelFullscreen(bool fullscreen) { + panel_fullscreen_ = fullscreen; UpdateWindowBounds(); } -void AccessibilityPanelLayoutManager::SetPanelBounds( - const gfx::Rect& bounds, - mojom::AccessibilityPanelState state) { - panel_bounds_ = bounds; - panel_state_ = state; - UpdateWindowBounds(); - UpdateWorkArea(); -} - void AccessibilityPanelLayoutManager::OnWindowAddedToLayout( aura::Window* child) { panel_window_ = child; @@ -99,44 +90,29 @@ RootWindowController* root_controller = RootWindowController::ForWindow(root_window); - gfx::Rect bounds = panel_bounds_; + // By default the panel sits at the top of the screen. + DCHECK(panel_window_->bounds().origin().IsOrigin()); + gfx::Rect bounds(0, 0, root_window->bounds().width(), kPanelHeight); // The panel can make itself fill the screen (including covering the shelf). - if (panel_state_ == mojom::AccessibilityPanelState::FULLSCREEN) { - bounds = root_window->bounds(); - } else if (panel_state_ == mojom::AccessibilityPanelState::FULL_WIDTH) { - bounds.set_x(0); - bounds.set_width(root_window->bounds().width()); - } + if (panel_fullscreen_) + bounds.set_height(root_window->bounds().height()); // If a fullscreen browser window is open, give the panel a height of 0 - // unless it's active or always_visible_ is true. - if (!always_visible_ && root_controller->GetWindowForFullscreenMode() && + // unless it's active. + if (root_controller->GetWindowForFullscreenMode() && !::wm::IsActiveWindow(panel_window_)) { bounds.set_height(0); } - // Make sure the accessibility panel is always below the Docked Magnifier - // viewport so it shows up and gets magnified. - int magnifier_height = root_controller->shelf()->GetDockedMagnifierHeight(); - if (bounds.y() < magnifier_height) - bounds.Offset(0, magnifier_height); - - // Make sure the accessibility panel doesn't go offscreen when the Docked - // Magnifier is on. - int screen_height = root_window->bounds().height(); - int available_height = screen_height - magnifier_height; - if (bounds.height() > available_height) - bounds.set_height(available_height); + // Make sure the ChromeVox panel is always below the Docked Magnifier viewport + // so it shows up and gets magnified. + bounds.Offset(0, root_controller->shelf()->GetDockedMagnifierHeight()); panel_window_->SetBounds(bounds); } void AccessibilityPanelLayoutManager::UpdateWorkArea() { - if (panel_window_ && panel_window_->bounds().y() != 0) - return; - if (panel_state_ == mojom::AccessibilityPanelState::FULLSCREEN) - return; Shell::GetPrimaryRootWindowController()->shelf()->SetAccessibilityPanelHeight( panel_window_ ? panel_window_->bounds().height() : 0); }
diff --git a/ash/accessibility/accessibility_panel_layout_manager.h b/ash/accessibility/accessibility_panel_layout_manager.h index 9b75fa6..f16e818 100644 --- a/ash/accessibility/accessibility_panel_layout_manager.h +++ b/ash/accessibility/accessibility_panel_layout_manager.h
@@ -6,12 +6,10 @@ #define ASH_ACCESSIBILITY_ACCESSIBILITY_PANEL_LAYOUT_MANAGER_H_ #include "ash/ash_export.h" -#include "ash/public/interfaces/accessibility_controller.mojom.h" #include "ash/shell_observer.h" #include "base/macros.h" #include "ui/aura/layout_manager.h" #include "ui/display/display_observer.h" -#include "ui/gfx/geometry/rect.h" #include "ui/wm/public/activation_change_observer.h" namespace aura { @@ -32,15 +30,13 @@ public ash::ShellObserver { public: // Height of the panel in DIPs. Public for test. - static constexpr int kDefaultPanelHeight = 35; + static constexpr int kPanelHeight = 35; AccessibilityPanelLayoutManager(); ~AccessibilityPanelLayoutManager() override; - // Controls the panel's visibility and location. - void SetAlwaysVisible(bool always_visible); - void SetPanelBounds(const gfx::Rect& bounds, - mojom::AccessibilityPanelState state); + // Sets whether the panel covers the entire display. + void SetPanelFullscreen(bool fullscreen); // aura::LayoutManager: void OnWindowResized() override {} @@ -79,14 +75,8 @@ // The panel being managed (e.g. the ChromeVoxPanel's native aura window). aura::Window* panel_window_ = nullptr; - // Window bounds when not in fullscreen - gfx::Rect panel_bounds_ = gfx::Rect(0, 0, 0, 0); - - // Determines whether panel is hidden when browser is in fullscreen. - bool always_visible_ = false; - - // Determines how the panel_bounds_ are used when displaying the panel. - mojom::AccessibilityPanelState panel_state_; + // Whether the panel itself is filling the display. + bool panel_fullscreen_ = false; DISALLOW_COPY_AND_ASSIGN(AccessibilityPanelLayoutManager); };
diff --git a/ash/accessibility/accessibility_panel_layout_manager_unittest.cc b/ash/accessibility/accessibility_panel_layout_manager_unittest.cc index b231a6c..5bd3165 100644 --- a/ash/accessibility/accessibility_panel_layout_manager_unittest.cc +++ b/ash/accessibility/accessibility_panel_layout_manager_unittest.cc
@@ -17,8 +17,7 @@ namespace { // Shorten the name for better line wrapping. -constexpr int kDefaultPanelHeight = - AccessibilityPanelLayoutManager::kDefaultPanelHeight; +constexpr int kPanelHeight = AccessibilityPanelLayoutManager::kPanelHeight; AccessibilityPanelLayoutManager* GetLayoutManager() { aura::Window* container = @@ -75,6 +74,27 @@ // Ash should not crash if the window is still open at shutdown. } +TEST_F(AccessibilityPanelLayoutManagerTest, InitialBounds) { + display::Screen* screen = display::Screen::GetScreen(); + gfx::Rect initial_work_area = screen->GetPrimaryDisplay().work_area(); + + // Simulate Chrome creating the ChromeVox window, but don't show it yet. + std::unique_ptr<views::Widget> widget = CreateChromeVoxPanel(); + + // The layout manager has not adjusted the work area yet. + EXPECT_EQ(screen->GetPrimaryDisplay().work_area(), initial_work_area); + + // Showing the panel causes the layout manager to adjust the panel bounds and + // the display work area. + widget->Show(); + gfx::Rect expected_bounds(0, 0, screen->GetPrimaryDisplay().bounds().width(), + kPanelHeight); + EXPECT_EQ(widget->GetNativeWindow()->bounds(), expected_bounds); + gfx::Rect expected_work_area = initial_work_area; + expected_work_area.Inset(0, kPanelHeight, 0, 0); + EXPECT_EQ(screen->GetPrimaryDisplay().work_area(), expected_work_area); +} + TEST_F(AccessibilityPanelLayoutManagerTest, PanelFullscreen) { AccessibilityPanelLayoutManager* layout_manager = GetLayoutManager(); display::Screen* screen = display::Screen::GetScreen(); @@ -82,56 +102,38 @@ std::unique_ptr<views::Widget> widget = CreateChromeVoxPanel(); widget->Show(); - layout_manager->SetPanelBounds(gfx::Rect(0, 0, 0, kDefaultPanelHeight), - mojom::AccessibilityPanelState::FULL_WIDTH); - gfx::Rect expected_work_area = screen->GetPrimaryDisplay().work_area(); // When the panel is fullscreen it fills the display and does not change the // work area. - layout_manager->SetPanelBounds(gfx::Rect(), - mojom::AccessibilityPanelState::FULLSCREEN); + layout_manager->SetPanelFullscreen(true); EXPECT_EQ(widget->GetNativeWindow()->bounds(), screen->GetPrimaryDisplay().bounds()); EXPECT_EQ(screen->GetPrimaryDisplay().work_area(), expected_work_area); // Restoring the panel to default size restores the bounds and does not change // the work area. - layout_manager->SetPanelBounds(gfx::Rect(0, 0, 0, kDefaultPanelHeight), - mojom::AccessibilityPanelState::FULL_WIDTH); + layout_manager->SetPanelFullscreen(false); gfx::Rect expected_bounds(0, 0, screen->GetPrimaryDisplay().bounds().width(), - kDefaultPanelHeight); + kPanelHeight); EXPECT_EQ(widget->GetNativeWindow()->bounds(), expected_bounds); EXPECT_EQ(screen->GetPrimaryDisplay().work_area(), expected_work_area); } -TEST_F(AccessibilityPanelLayoutManagerTest, SetBounds) { - std::unique_ptr<views::Widget> widget = CreateChromeVoxPanel(); - widget->Show(); - - gfx::Rect bounds(0, 0, 100, 100); - GetLayoutManager()->SetPanelBounds(bounds, - mojom::AccessibilityPanelState::BOUNDED); - EXPECT_EQ(widget->GetNativeWindow()->bounds(), bounds); -} - TEST_F(AccessibilityPanelLayoutManagerTest, DisplayBoundsChange) { std::unique_ptr<views::Widget> widget = CreateChromeVoxPanel(); widget->Show(); - GetLayoutManager()->SetPanelBounds( - gfx::Rect(0, 0, 0, kDefaultPanelHeight), - mojom::AccessibilityPanelState::FULL_WIDTH); // When the display resolution changes the panel still sits at the top of the // screen. UpdateDisplay("1234,567"); display::Screen* screen = display::Screen::GetScreen(); gfx::Rect expected_bounds(0, 0, screen->GetPrimaryDisplay().bounds().width(), - kDefaultPanelHeight); + kPanelHeight); EXPECT_EQ(widget->GetNativeWindow()->bounds(), expected_bounds); gfx::Rect expected_work_area = screen->GetPrimaryDisplay().bounds(); - expected_work_area.Inset(0, kDefaultPanelHeight, 0, kShelfSize); + expected_work_area.Inset(0, kPanelHeight, 0, kShelfSize); EXPECT_EQ(screen->GetPrimaryDisplay().work_area(), expected_work_area); }
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index 5c54238..39ec3b3 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -568,6 +568,9 @@ if (client_) client_->OpenSearchResult(result_id, event_flags); + + if (IsHomeLauncherEnabledInTabletMode() && presenter_.IsVisible()) + presenter_.GetView()->ResetToInitialState(); } void AppListControllerImpl::InvokeSearchResultAction( @@ -614,6 +617,9 @@ int event_flags) { if (client_) client_->ActivateItem(id, event_flags); + + if (IsHomeLauncherEnabledInTabletMode() && presenter_.IsVisible()) + presenter_.GetView()->ResetToInitialState(); } void AppListControllerImpl::GetContextMenuModel(
diff --git a/ash/app_list/views/app_list_view.cc b/ash/app_list/views/app_list_view.cc index 935a4c2..2bc626b7 100644 --- a/ash/app_list/views/app_list_view.cc +++ b/ash/app_list/views/app_list_view.cc
@@ -395,6 +395,10 @@ GetWidget()->Deactivate(); } +void AppListView::ResetToInitialState() { + app_list_main_view_->contents_view()->Back(); +} + void AppListView::SetAppListOverlayVisible(bool visible) { DCHECK(overlay_view_);
diff --git a/ash/app_list/views/app_list_view.h b/ash/app_list/views/app_list_view.h index 3c728af..1d47f2b 100644 --- a/ash/app_list/views/app_list_view.h +++ b/ash/app_list/views/app_list_view.h
@@ -126,6 +126,9 @@ // Dismisses the UI, cleans up and sets the state to CLOSED. void Dismiss(); + // Resets the UI to initial state. + void ResetToInitialState(); + // Enables/disables a semi-transparent overlay over the app list (good for // hiding the app list when a modal dialog is being shown). void SetAppListOverlayVisible(bool visible);
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index 852dad2..09e4151 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -435,23 +435,21 @@ return; } - if (!users_list_) { - return; - } + if (users_list_) { + for (int i = 0; i < users_list_->user_count(); ++i) { + LoginUserView* user_view = users_list_->user_view_at(i); + if (!login_views_utils::HasFocusInAnyChildView(user_view)) + continue; - for (int i = 0; i < users_list_->user_count(); ++i) { - LoginUserView* user_view = users_list_->user_view_at(i); - if (!login_views_utils::HasFocusInAnyChildView(user_view)) - continue; + if (i == users_list_->user_count() - 1) { + SwapActiveAuthBetweenPrimaryAndSecondary(true /*is_primary*/); + primary_big_view_->RequestFocus(); + return; + } - if (i == users_list_->user_count() - 1) { - SwapActiveAuthBetweenPrimaryAndSecondary(true /*is_primary*/); - primary_big_view_->RequestFocus(); + user_view->GetNextFocusableView()->RequestFocus(); return; } - - user_view->GetNextFocusableView()->RequestFocus(); - return; } } @@ -473,23 +471,21 @@ return; } - if (!users_list_) { - return; - } + if (users_list_) { + for (int i = 0; i < users_list_->user_count(); ++i) { + LoginUserView* user_view = users_list_->user_view_at(i); + if (!login_views_utils::HasFocusInAnyChildView(user_view)) + continue; - for (int i = 0; i < users_list_->user_count(); ++i) { - LoginUserView* user_view = users_list_->user_view_at(i); - if (!login_views_utils::HasFocusInAnyChildView(user_view)) - continue; + if (i == 0) { + SwapActiveAuthBetweenPrimaryAndSecondary(true /*is_primary*/); + primary_big_view_->RequestFocus(); + return; + } - if (i == 0) { - SwapActiveAuthBetweenPrimaryAndSecondary(true /*is_primary*/); - primary_big_view_->RequestFocus(); + user_view->GetPreviousFocusableView()->RequestFocus(); return; } - - user_view->GetPreviousFocusableView()->RequestFocus(); - return; } }
diff --git a/ash/public/interfaces/accessibility_controller.mojom b/ash/public/interfaces/accessibility_controller.mojom index d9cea94..3951d78 100644 --- a/ash/public/interfaces/accessibility_controller.mojom +++ b/ash/public/interfaces/accessibility_controller.mojom
@@ -36,17 +36,6 @@ WINDOW_OVERVIEW_MODE_ENTERED }; -enum AccessibilityPanelState { - // Window bounds are set explicitly. - BOUNDED, - - // Width of panel matches screen width, y_coord and height are set by bounds. - FULL_WIDTH, - - // Panel occupies the full screen. Bounds are ignored. - FULLSCREEN -}; - enum SelectToSpeakState { // Select to Speak is not actively selecting text or speaking. kSelectToSpeakStateInactive, @@ -81,14 +70,9 @@ // Setting off-screen or empty bounds suppresses the highlight. SetCaretBounds(gfx.mojom.Rect bounds_in_screen); - // Sets whether the accessibility panel should always be visible, regardless - // of whether the window is fullscreen. - SetAccessibilityPanelAlwaysVisible(bool always_visible); - - // Sets the bounds for the accessibility panel. Overrides current - // configuration (i.e. fullscreen, full-width). - SetAccessibilityPanelBounds(gfx.mojom.Rect bounds, - AccessibilityPanelState state); + // Sets whether the accessibility panel is filling the entire screen (e.g. to + // show the expanded UI for the ChromeVox spoken feedback extension). + SetAccessibilityPanelFullscreen(bool fullscreen); // Sets the current Select-to-Speak state. This should be used by the Select- // to-Speak extension to inform ash of its updated state.
diff --git a/ash/shelf/overflow_bubble_view.cc b/ash/shelf/overflow_bubble_view.cc index 61af8225..5099122 100644 --- a/ash/shelf/overflow_bubble_view.cc +++ b/ash/shelf/overflow_bubble_view.cc
@@ -30,6 +30,9 @@ // Distance between overflow bubble and the main shelf. const int kDistanceToMainShelf = 4; +// The bubble's border radius (when the new shelf UI is enabled). +const int kBorderRadius = kShelfSize / 2; + } // namespace OverflowBubbleView::OverflowBubbleView(Shelf* shelf) @@ -75,6 +78,11 @@ kShellWindowId_ShelfBubbleContainer)); views::BubbleDialogDelegateView::CreateBubble(this); + + // This can only be set after bubble creation: + if (chromeos::switches::ShouldUseShelfNewUi()) + GetBubbleFrameView()->bubble_border()->SetCornerRadius(kBorderRadius); + AddChildView(shelf_view_); }
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index 64c0d27..4b20dca 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc
@@ -593,8 +593,12 @@ if (::features::IsSingleProcessMash()) return; - window_ = std::make_unique<aura::Window>(nullptr, - aura::client::WINDOW_TYPE_UNKNOWN); + // This test explicitly uses aura::Env::GetInstance() rather than + // Shell->aura_env() as the Window outlives the Shell. In order for a Window + // to outlive Shell the Window must be created outside of Ash, which uses + // aura::Env::GetInstance() as the Env. + window_ = std::make_unique<aura::Window>( + nullptr, aura::client::WINDOW_TYPE_UNKNOWN, aura::Env::GetInstance()); window_->Init(ui::LAYER_NOT_DRAWN); }
diff --git a/ash/wm/wm_toplevel_window_event_handler.cc b/ash/wm/wm_toplevel_window_event_handler.cc index f892b00..ed76bcd1 100644 --- a/ash/wm/wm_toplevel_window_event_handler.cc +++ b/ash/wm/wm_toplevel_window_event_handler.cc
@@ -4,7 +4,6 @@ #include "ash/wm/wm_toplevel_window_event_handler.h" -#include "ash/public/cpp/config.h" #include "ash/shell.h" #include "ash/wm/resize_shadow_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -60,11 +59,6 @@ } void ShowResizeShadow(aura::Window* window, int component) { - if (Shell::GetAshConfig() == Config::MASH_DEPRECATED) { - // TODO: http://crbug.com/640773. - return; - } - // Window resize in tablet mode is disabled (except in splitscreen). if (Shell::Get() ->tablet_mode_controller() @@ -79,11 +73,6 @@ } void HideResizeShadow(aura::Window* window) { - if (Shell::GetAshConfig() == Config::MASH_DEPRECATED) { - // TODO: http://crbug.com/640773. - return; - } - ResizeShadowController* resize_shadow_controller = Shell::Get()->resize_shadow_controller(); if (resize_shadow_controller)
diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc index 180d7a7..6142d45 100644 --- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc +++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc
@@ -23,6 +23,7 @@ #include "ui/aura/window.h" #include "ui/base/class_property.h" #include "ui/base/hit_test.h" +#include "ui/base/ui_base_features.h" #include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -321,6 +322,12 @@ // Tests that clicking outside of the resize handle dismisses it. TEST_F(MultiWindowResizeControllerTest, ClickOutside) { + // TODO(sky): get this test working with single-process-mash. This ends up + // using EventMonitorAura, which accesses Env::GetInstance(). + // https://crbug.com/874481 + if (::features::IsSingleProcessMash()) + return; + aura::test::TestWindowDelegate delegate1; std::unique_ptr<aura::Window> w1(CreateTestWindowInShellWithDelegate( &delegate1, -1, gfx::Rect(0, 0, 100, 100)));
diff --git a/build/config/android/config.gni b/build/config/android/config.gni index a9148c0..cbfcfff98 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni
@@ -119,10 +119,6 @@ google_play_services_package = "//third_party/android_tools" } - if (!defined(android_support_library_package)) { - android_support_library_package = "//third_party/android_tools/support" - } - if (!defined(system_webview_apk_target)) { system_webview_apk_target = "//android_webview:system_webview_apk" }
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn index faa533b..dae0d85 100644 --- a/build/config/sanitizers/BUILD.gn +++ b/build/config/sanitizers/BUILD.gn
@@ -199,7 +199,11 @@ } if (use_sanitizer_coverage) { - ldflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags" ] + if (use_libfuzzer) { + ldflags += [ "-fsanitize=fuzzer-no-link" ] + } else { + ldflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags" ] + } } if (is_cfi && current_toolchain == default_toolchain) { @@ -375,19 +379,24 @@ config("coverage_flags") { cflags = [] if (use_sanitizer_coverage) { - cflags += [ - "-fsanitize-coverage=$sanitizer_coverage_flags", - "-mllvm", - "-sanitizer-coverage-prune-blocks=1", - ] - if (current_cpu == "arm") { - # http://crbug.com/517105 - cflags += [ - "-mllvm", - "-sanitizer-coverage-block-threshold=0", - ] - } + # Used by sandboxing code to allow coverage dump to be written on the disk. defines = [ "SANITIZER_COVERAGE" ] + if (use_libfuzzer) { + cflags += [ "-fsanitize=fuzzer-no-link" ] + } else { + cflags += [ + "-fsanitize-coverage=$sanitizer_coverage_flags", + "-mllvm", + "-sanitizer-coverage-prune-blocks=1", + ] + if (current_cpu == "arm") { + # http://crbug.com/517105 + cflags += [ + "-mllvm", + "-sanitizer-coverage-block-threshold=0", + ] + } + } } }
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index 0f4255e6..edb0a37 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni
@@ -97,7 +97,9 @@ # Value for -fsanitize-coverage flag. Setting this causes # use_sanitizer_coverage to be enabled. - # Default value when unset and use_fuzzing_engine=true: + # This flag is not used for libFuzzer (use_libfuzzer=true). Instead, we use: + # -fsanitize=fuzzer-no-link + # Default value when unset and use_afl=true: # trace-pc-guard # Default value when unset and use_sanitizer_coverage=true: # trace-pc-guard,indirect-calls
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn index 9e54b85..ff5f143 100644 --- a/build/secondary/third_party/android_tools/BUILD.gn +++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -49,20 +49,16 @@ jar_path = "${android_sdk}/optional/android.test.runner.jar" } - template("support_lib_alias") { - java_group(target_name) { - forward_variables_from(invoker, [ "testonly" ]) - deps = [ - "$android_support_library_package:$target_name", - ] - } - } - support_lib_alias("android_support_chromium_java") { + android_library("android_support_chromium_java") { testonly = true + java_files = [ "//third_party/android_tools/sdk/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java" ] } - support_lib_alias("android_gcm_java") { + android_java_prebuilt("android_gcm_java") { + jar_path = "//third_party/android_tools/sdk/extras/google/gcm/gcm-client/dist/gcm.jar" } - support_lib_alias("emma_device_java") { + android_java_prebuilt("emma_device_java") { + jar_path = "//third_party/android_tools/sdk/tools/lib/emma_device.jar" + include_java_resources = true } template("android_deps_alias") {
diff --git a/build/secondary/third_party/android_tools/support/BUILD.gn b/build/secondary/third_party/android_tools/support/BUILD.gn deleted file mode 100644 index 55609b6..0000000 --- a/build/secondary/third_party/android_tools/support/BUILD.gn +++ /dev/null
@@ -1,262 +0,0 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/android/rules.gni") - -assert(enable_java_templates) - -visibility = [ ":*" ] - -lib_version = "27.0.0" -lib_path = "//third_party/android_tools/sdk/extras/android/m2repository/com/android/support" -arch_lib_version = "1.0.0" -arch_lib_path = - "//third_party/android_tools/sdk/extras/android/m2repository/android/arch" -build_file_dir = "//build/secondary/third_party/android_tools/support" - -android_library("android_support_chromium_java") { - testonly = true - java_files = [ "//third_party/android_tools/sdk/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java" ] - visibility += [ "//third_party/android_tools:*" ] -} - -android_java_prebuilt("android_gcm_java") { - jar_path = "//third_party/android_tools/sdk/extras/google/gcm/gcm-client/dist/gcm.jar" - visibility += [ "//third_party/android_tools:*" ] -} - -android_java_prebuilt("emma_device_java") { - jar_path = "//third_party/android_tools/sdk/tools/lib/emma_device.jar" - include_java_resources = true - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_design_java") { - deps = [ - ":android_support_transition_java", - ":android_support_v4_java", - ":android_support_v7_appcompat_java", - ":android_support_v7_recyclerview_java", - ] - _lib_name = "design" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_transition_java") { - deps = [ - ":android_support_v4_java", - ] - _lib_name = "transition" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -} - -android_aar_prebuilt("android_support_cardview_java") { - deps = [ - ":android_support_v7_appcompat_java", - ] - _lib_name = "cardview-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_multidex_java") { - aar_path = "$lib_path/multidex/1.0.1/multidex-1.0.1.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_arch_lifecycle_runtime_java") { - aar_path = "$arch_lib_path/lifecycle/runtime/$arch_lib_version/runtime-$arch_lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - deps = [ - ":android_arch_core_common_java", - ":android_arch_lifecycle_common_java", - ":android_support_annotations_java", - ] - visibility += [ "//third_party/android_tools:*" ] -} - -android_java_prebuilt("android_arch_lifecycle_common_java") { - output_name = "arch_lifecycle_common" - jar_path = "$arch_lib_path/lifecycle/common/$arch_lib_version/common-$arch_lib_version.jar" - deps = [ - ":android_support_annotations_java", - ] - visibility += [ "//third_party/android_tools:*" ] -} - -android_java_prebuilt("android_arch_core_common_java") { - output_name = "arch_core_common" - jar_path = "$arch_lib_path/core/common/$arch_lib_version/common-$arch_lib_version.jar" - deps = [ - ":android_support_annotations_java", - ] -} - -android_java_prebuilt("android_support_annotations_java") { - _lib_name = "support-annotations" - jar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.jar" - visibility += [ "//third_party/android_tools:*" ] -} - -java_group("android_support_v4_java") { - deps = [ - ":android_support_compat_java", - ":android_support_core_ui_java", - ":android_support_core_utils_java", - ":android_support_fragment_java", - ":android_support_media_compat_java", - ] - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_compat_java") { - deps = [ - ":android_arch_lifecycle_runtime_java", - ":android_support_annotations_java", - ] - _lib_name = "support-compat" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - ignore_aidl = true # We don't appear to need these currently. - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_core_ui_java") { - deps = [ - ":android_support_compat_java", - ] - _lib_name = "support-core-ui" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_core_utils_java") { - deps = [ - ":android_support_compat_java", - ] - _lib_name = "support-core-utils" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_fragment_java") { - deps = [ - ":android_support_compat_java", - ":android_support_core_ui_java", - ":android_support_core_utils_java", - ":android_support_media_compat_java", - ] - _lib_name = "support-fragment" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -} - -android_aar_prebuilt("android_support_media_compat_java") { - deps = [ - ":android_support_compat_java", - ] - _lib_name = "support-media-compat" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - ignore_aidl = true # We don't appear to need these currently. -} - -android_aar_prebuilt("android_support_v13_java") { - deps = [ - ":android_support_v4_java", - ] - _lib_name = "support-v13" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_vector_drawable_java") { - deps = [ - ":android_support_compat_java", - ] - _lib_name = "support-vector-drawable" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -} - -android_aar_prebuilt("android_support_animated_vector_drawable_java") { - deps = [ - ":android_support_core_ui_java", - ":android_support_vector_drawable_java", - ] - _lib_name = "animated-vector-drawable" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -} - -android_aar_prebuilt("android_support_v7_appcompat_java_internal") { - deps = [ - ":android_support_v4_java", - ] - _lib_name = "appcompat-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -} - -java_group("android_support_v7_appcompat_java") { - deps = [ - ":android_support_animated_vector_drawable_java", - ":android_support_v4_java", - ":android_support_v7_appcompat_java_internal", - ":android_support_vector_drawable_java", - ] - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_v7_gridlayout_java") { - deps = [ - ":android_support_compat_java", - ":android_support_core_ui_java", - ] - _lib_name = "gridlayout-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_v7_mediarouter_java") { - deps = [ - ":android_support_v7_appcompat_java", - ":android_support_v7_palette_java", - ] - _lib_name = "mediarouter-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_v7_recyclerview_java") { - deps = [ - ":android_support_annotations_java", - ":android_support_compat_java", - ":android_support_core_ui_java", - ] - _lib_name = "recyclerview-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" - visibility += [ "//third_party/android_tools:*" ] -} - -android_aar_prebuilt("android_support_v7_palette_java") { - deps = [ - ":android_support_compat_java", - ":android_support_core_utils_java", - ] - _lib_name = "palette-v7" - aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" - info_path = "$build_file_dir/$target_name.info" -}
diff --git a/build/secondary/third_party/android_tools/support/android_arch_lifecycle_runtime_java.info b/build/secondary/third_party/android_tools/support/android_arch_lifecycle_runtime_java.info deleted file mode 100644 index acf40e8..0000000 --- a/build/secondary/third_party/android_tools/support/android_arch_lifecycle_runtime_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = false -is_manifest_empty = false -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_animated_vector_drawable_java.info b/build/secondary/third_party/android_tools/support/android_support_animated_vector_drawable_java.info deleted file mode 100644 index 7103bc0..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_animated_vector_drawable_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_cardview_java.info b/build/secondary/third_party/android_tools/support/android_support_cardview_java.info deleted file mode 100644 index e458725..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_cardview_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values-v23/values-v23.xml", "res/values/values.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_compat_java.info b/build/secondary/third_party/android_tools/support/android_support_compat_java.info deleted file mode 100644 index fc66ea71..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_compat_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ "aidl/android/support/v4/os/ResultReceiver.aidl" ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values-ur/values-ur.xml", "res/values-ru/values-ru.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-el/values-el.xml", "res/drawable-hdpi-v4/notification_bg_low_normal.9.png", "res/drawable-hdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-hdpi-v4/notification_bg_normal.9.png", "res/drawable-hdpi-v4/notification_bg_low_pressed.9.png", "res/values-tr/values-tr.xml", "res/values-hu/values-hu.xml", "res/values-km/values-km.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gu/values-gu.xml", "res/layout/notification_template_icon_group.xml", "res/layout/notification_template_custom_big.xml", "res/layout/notification_template_part_time.xml", "res/layout/notification_template_part_chronometer.xml", "res/layout/notification_action_tombstone.xml", "res/layout/notification_action.xml", "res/values-ms/values-ms.xml", "res/values-v21/values-v21.xml", "res/values-ja/values-ja.xml", "res/values-eu/values-eu.xml", "res/values-sv/values-sv.xml", "res/values-mn/values-mn.xml", "res/layout-v16/notification_template_custom_big.xml", "res/values-ta/values-ta.xml", "res/values-pl/values-pl.xml", "res/values-lt/values-lt.xml", "res/values-bg/values-bg.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-iw/values-iw.xml", "res/values-mr/values-mr.xml", "res/values-uz/values-uz.xml", "res/values-pa/values-pa.xml", "res/values-fi/values-fi.xml", "res/values-am/values-am.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ar/values-ar.xml", "res/values-ky/values-ky.xml", "res/drawable-mdpi-v4/notification_bg_low_normal.9.png", "res/drawable-mdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-mdpi-v4/notification_bg_normal.9.png", "res/drawable-mdpi-v4/notification_bg_low_pressed.9.png", "res/values-bs/values-bs.xml", "res/values/values.xml", "res/values-hr/values-hr.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-ro/values-ro.xml", "res/drawable-xhdpi-v4/notification_bg_low_normal.9.png", "res/drawable-xhdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-xhdpi-v4/notification_bg_normal.9.png", "res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png", "res/values-vi/values-vi.xml", "res/values-ko/values-ko.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-cs/values-cs.xml", "res/values-ml/values-ml.xml", "res/values-te/values-te.xml", "res/values-si/values-si.xml", "res/values-es/values-es.xml", "res/values-af/values-af.xml", "res/values-zu/values-zu.xml", "res/values-lo/values-lo.xml", "res/values-mk/values-mk.xml", "res/values-sl/values-sl.xml", "res/values-sw/values-sw.xml", "res/values-bn/values-bn.xml", "res/values-sk/values-sk.xml", "res/values-lv/values-lv.xml", "res/values-is/values-is.xml", "res/values-da/values-da.xml", "res/values-it/values-it.xml", "res/values-gl/values-gl.xml", "res/values-de/values-de.xml", "res/values-be/values-be.xml", "res/values-fa/values-fa.xml", "res/values-ca/values-ca.xml", "res/values-th/values-th.xml", "res/values-nl/values-nl.xml", "res/values-hy/values-hy.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-tl/values-tl.xml", "res/values-kk/values-kk.xml", "res/values-pt/values-pt.xml", "res/values-my/values-my.xml", "res/values-et/values-et.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-sr/values-sr.xml", "res/values-v16/values-v16.xml", "res/values-fr/values-fr.xml", "res/values-kn/values-kn.xml", "res/values-nb/values-nb.xml", "res/values-port/values-port.xml", "res/values-ne/values-ne.xml", "res/drawable/notification_bg_low.xml", "res/drawable/notification_bg.xml", "res/drawable/notification_icon_background.xml", "res/drawable/notification_tile_bg.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-ka/values-ka.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-az/values-az.xml", "res/values-sq/values-sq.xml", "res/values-hi/values-hi.xml", "res/layout-v21/notification_template_icon_group.xml", "res/layout-v21/notification_template_custom_big.xml", "res/layout-v21/notification_action_tombstone.xml", "res/layout-v21/notification_action.xml", "res/values-in/values-in.xml", "res/values-uk/values-uk.xml", "res/drawable-v21/notification_action_background.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_core_ui_java.info b/build/secondary/third_party/android_tools/support/android_support_core_ui_java.info deleted file mode 100644 index 7103bc0..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_core_ui_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_core_utils_java.info b/build/secondary/third_party/android_tools/support/android_support_core_utils_java.info deleted file mode 100644 index cd54060..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_core_utils_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_design_java.info b/build/secondary/third_party/android_tools/support/android_support_design_java.info deleted file mode 100644 index ec2b700..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_design_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/drawable-hdpi-v4/design_ic_visibility.png", "res/drawable-hdpi-v4/design_ic_visibility_off.png", "res/layout/design_bottom_sheet_dialog.xml", "res/layout/design_layout_tab_text.xml", "res/layout/design_bottom_navigation_item.xml", "res/layout/design_navigation_item.xml", "res/layout/design_layout_snackbar_include.xml", "res/layout/design_navigation_menu.xml", "res/layout/design_navigation_item_header.xml", "res/layout/design_navigation_item_separator.xml", "res/layout/design_layout_snackbar.xml", "res/layout/design_text_input_password_icon.xml", "res/layout/design_layout_tab_icon.xml", "res/layout/design_navigation_item_subheader.xml", "res/layout/design_menu_item_action_area.xml", "res/layout/design_navigation_menu_item.xml", "res/values-v21/values-v21.xml", "res/drawable-anydpi-v21/design_ic_visibility.xml", "res/drawable-anydpi-v21/design_ic_visibility_off.xml", "res/layout-sw600dp-v13/design_layout_snackbar.xml", "res/drawable-xxhdpi-v4/design_ic_visibility.png", "res/drawable-xxhdpi-v4/design_ic_visibility_off.png", "res/color/design_error.xml", "res/color/design_tint_password_toggle.xml", "res/animator-v21/design_appbar_state_list_animator.xml", "res/drawable-mdpi-v4/design_ic_visibility.png", "res/drawable-mdpi-v4/design_ic_visibility_off.png", "res/values/values.xml", "res/drawable-xhdpi-v4/design_ic_visibility.png", "res/drawable-xhdpi-v4/design_ic_visibility_off.png", "res/values-land/values-land.xml", "res/values-sw600dp-v13/values-sw600dp-v13.xml", "res/anim/design_snackbar_out.xml", "res/anim/design_snackbar_in.xml", "res/anim/design_bottom_sheet_slide_out.xml", "res/anim/design_bottom_sheet_slide_in.xml", "res/drawable-xxxhdpi-v4/design_ic_visibility.png", "res/drawable-xxxhdpi-v4/design_ic_visibility_off.png", "res/anim-v21/design_bottom_sheet_slide_out.xml", "res/anim-v21/design_bottom_sheet_slide_in.xml", "res/values-v26/values-v26.xml", "res/color-v23/design_tint_password_toggle.xml", "res/drawable/design_snackbar_background.xml", "res/drawable/design_fab_background.xml", "res/drawable/design_password_eye.xml", "res/drawable/navigation_empty_icon.xml", "res/drawable/design_bottom_navigation_item_background.xml", "res/drawable-v21/avd_hide_password.xml", "res/drawable-v21/avd_show_password.xml", "res/drawable-v21/design_password_eye.xml", "res/drawable-v21/design_bottom_navigation_item_background.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_fragment_java.info b/build/secondary/third_party/android_tools/support/android_support_fragment_java.info deleted file mode 100644 index cd54060..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_fragment_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_media_compat_java.info b/build/secondary/third_party/android_tools/support/android_support_media_compat_java.info deleted file mode 100644 index 6140dd1..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_media_compat_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ "aidl/android/support/v4/media/session/PlaybackStateCompat.aidl", "aidl/android/support/v4/media/session/MediaSessionCompat.aidl", "aidl/android/support/v4/media/session/ParcelableVolumeInfo.aidl", "aidl/android/support/v4/media/RatingCompat.aidl", "aidl/android/support/v4/media/MediaMetadataCompat.aidl", "aidl/android/support/v4/media/MediaDescriptionCompat.aidl" ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/layout/notification_template_media_custom.xml", "res/layout/notification_template_big_media_narrow_custom.xml", "res/layout/notification_template_media.xml", "res/layout/notification_template_big_media.xml", "res/layout/notification_media_action.xml", "res/layout/notification_template_lines_media.xml", "res/layout/notification_media_cancel_action.xml", "res/layout/notification_template_big_media_custom.xml", "res/layout/notification_template_big_media_narrow.xml", "res/values-v21/values-v21.xml", "res/values/values.xml", "res/values-v24/values-v24.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_multidex_java.info b/build/secondary/third_party/android_tools/support/android_support_multidex_java.info deleted file mode 100644 index a2ebd4a..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_multidex_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = false -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_transition_java.info b/build/secondary/third_party/android_tools/support/android_support_transition_java.info deleted file mode 100644 index a25d255..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_transition_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values/values.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v13_java.info b/build/secondary/third_party/android_tools/support/android_support_v13_java.info deleted file mode 100644 index cd54060..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v13_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v14_preference_java.info b/build/secondary/third_party/android_tools/support/android_support_v14_preference_java.info deleted file mode 100644 index 74388f4..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v14_preference_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/layout/preference_information_material.xml", "res/layout/preference_widget_seekbar_material.xml", "res/layout/preference_category_material.xml", "res/layout/preference_dropdown_material.xml", "res/layout/preference_widget_switch.xml", "res/layout/preference_material.xml", "res/values/values.xml", "res/values-v17/values-v17.xml", "res/drawable/preference_list_divider_material.xml", "res/layout-v21/preference_information_material.xml", "res/layout-v21/preference_category_material.xml", "res/layout-v21/preference_dropdown_material.xml", "res/layout-v21/preference_material.xml", "res/drawable-v21/preference_list_divider_material.xml", "res/layout-v17/preference_information_material.xml", "res/layout-v17/preference_category_material.xml", "res/layout-v17/preference_dropdown_material.xml", "res/layout-v17/preference_material.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v17_leanback_java.info b/build/secondary/third_party/android_tools/support/android_support_v17_leanback_java.info deleted file mode 100644 index 34d36936..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v17_leanback_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values-ur/values-ur.xml", "res/values-ru/values-ru.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-el/values-el.xml", "res/drawable-hdpi-v4/lb_action_bg_focused.9.png", "res/drawable-hdpi-v4/lb_ic_search_mic.png", "res/drawable-hdpi-v4/lb_in_app_search_shadow_focused.9.png", "res/drawable-hdpi-v4/lb_ic_search_mic_out.png", "res/drawable-hdpi-v4/lb_in_app_search_bg.9.png", "res/drawable-hdpi-v4/lb_in_app_search_shadow_normal.9.png", "res/drawable-hdpi-v4/lb_ic_actions_right_arrow.png", "res/drawable-hdpi-v4/lb_ic_sad_cloud.png", "res/drawable-hdpi-v4/lb_ic_in_app_search.png", "res/values-tr/values-tr.xml", "res/values-hu/values-hu.xml", "res/values-v18/values-v18.xml", "res/values-km/values-km.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gu/values-gu.xml", "res/layout/lb_browse_fragment.xml", "res/layout/lb_image_card_view_themed_title.xml", "res/layout/lb_list_row_hovercard.xml", "res/layout/lb_guidedactions.xml", "res/layout/lb_guidedactions_item.xml", "res/layout/lb_playback_transport_controls.xml", "res/layout/lb_image_card_view_themed_content.xml", "res/layout/lb_image_card_view_themed_badge_right.xml", "res/layout/lb_image_card_view.xml", "res/layout/lb_media_item_number_view_flipper.xml", "res/layout/lb_title_view.xml", "res/layout/lb_browse_title.xml", "res/layout/lb_control_bar.xml", "res/layout/lb_divider.xml", "res/layout/lb_background_window.xml", "res/layout/lb_guidance.xml", "res/layout/lb_shadow.xml", "res/layout/lb_video_surface.xml", "res/layout/lb_control_button_primary.xml", "res/layout/lb_fullwidth_details_overview_logo.xml", "res/layout/lb_onboarding_fragment.xml", "res/layout/lb_error_fragment.xml", "res/layout/lb_vertical_grid_fragment.xml", "res/layout/lb_action_1_line.xml", "res/layout/video_surface_fragment.xml", "res/layout/lb_guidedbuttonactions.xml", "res/layout/lb_picker_item.xml", "res/layout/lb_guidedstep_background.xml", "res/layout/lb_details_fragment.xml", "res/layout/lb_playback_controls_row.xml", "res/layout/lb_row_header.xml", "res/layout/lb_playback_transport_controls_row.xml", "res/layout/lb_search_orb.xml", "res/layout/lb_guidedstep_fragment.xml", "res/layout/lb_picker.xml", "res/layout/lb_speech_orb.xml", "res/layout/lb_playback_now_playing_bars.xml", "res/layout/lb_list_row.xml", "res/layout/lb_row_media_item_action.xml", "res/layout/lb_vertical_grid.xml", "res/layout/lb_header.xml", "res/layout/lb_row_media_item.xml", "res/layout/lb_playback_fragment.xml", "res/layout/lb_search_fragment.xml", "res/layout/lb_playback_controls.xml", "res/layout/lb_section_header.xml", "res/layout/lb_guidedactions_datepicker_item.xml", "res/layout/lb_details_description.xml", "res/layout/lb_details_overview.xml", "res/layout/lb_picker_column.xml", "res/layout/lb_media_list_header.xml", "res/layout/lb_image_card_view_themed_badge_left.xml", "res/layout/lb_rows_fragment.xml", "res/layout/lb_headers_fragment.xml", "res/layout/lb_action_2_lines.xml", "res/layout/lb_control_button_secondary.xml", "res/layout/lb_search_bar.xml", "res/layout/lb_row_container.xml", "res/layout/lb_fullwidth_details_overview.xml", "res/layout/lb_picker_separator.xml", "res/values-ms/values-ms.xml", "res/values-v21/values-v21.xml", "res/values-ja/values-ja.xml", "res/values-eu/values-eu.xml", "res/values-sv/values-sv.xml", "res/values-mn/values-mn.xml", "res/values-ta/values-ta.xml", "res/values-pl/values-pl.xml", "res/drawable-xxhdpi-v4/lb_action_bg_focused.9.png", "res/drawable-xxhdpi-v4/lb_ic_search_mic.png", "res/drawable-xxhdpi-v4/lb_in_app_search_shadow_focused.9.png", "res/drawable-xxhdpi-v4/lb_ic_search_mic_out.png", "res/drawable-xxhdpi-v4/lb_in_app_search_bg.9.png", "res/drawable-xxhdpi-v4/lb_in_app_search_shadow_normal.9.png", "res/drawable-xxhdpi-v4/lb_ic_actions_right_arrow.png", "res/drawable-xxhdpi-v4/lb_ic_sad_cloud.png", "res/drawable-xxhdpi-v4/lb_ic_in_app_search.png", "res/values-lt/values-lt.xml", "res/values-bg/values-bg.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-iw/values-iw.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-mr/values-mr.xml", "res/values-uz/values-uz.xml", "res/values-pa/values-pa.xml", "res/values-v22/values-v22.xml", "res/animator-v21/lb_onboarding_logo_exit.xml", "res/animator-v21/lb_onboarding_title_enter.xml", "res/animator-v21/lb_playback_bg_fade_out.xml", "res/animator-v21/lb_playback_bg_fade_in.xml", "res/animator-v21/lb_playback_description_fade_out.xml", "res/animator-v21/lb_onboarding_description_enter.xml", "res/animator-v21/lb_onboarding_logo_enter.xml", "res/animator-v21/lb_onboarding_page_indicator_enter.xml", "res/values-fi/values-fi.xml", "res/values-am/values-am.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ar/values-ar.xml", "res/values-ky/values-ky.xml", "res/drawable-mdpi-v4/lb_action_bg_focused.9.png", "res/drawable-mdpi-v4/lb_ic_search_mic.png", "res/drawable-mdpi-v4/lb_in_app_search_shadow_focused.9.png", "res/drawable-mdpi-v4/lb_ic_search_mic_out.png", "res/drawable-mdpi-v4/lb_in_app_search_bg.9.png", "res/drawable-mdpi-v4/lb_in_app_search_shadow_normal.9.png", "res/drawable-mdpi-v4/lb_ic_actions_right_arrow.png", "res/drawable-mdpi-v4/lb_ic_sad_cloud.png", "res/drawable-mdpi-v4/lb_ic_in_app_search.png", "res/values-bs/values-bs.xml", "res/values/values.xml", "res/values-hr/values-hr.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-ro/values-ro.xml", "res/drawable-xhdpi-v4/lb_ic_pause.png", "res/drawable-xhdpi-v4/lb_ic_more.png", "res/drawable-xhdpi-v4/lb_action_bg_focused.9.png", "res/drawable-xhdpi-v4/lb_ic_skip_next.png", "res/drawable-xhdpi-v4/lb_ic_search_mic.png", "res/drawable-xhdpi-v4/lb_ic_fast_forward.png", "res/drawable-xhdpi-v4/lb_ic_shuffle.png", "res/drawable-xhdpi-v4/lb_ic_hq.png", "res/drawable-xhdpi-v4/lb_ic_skip_previous.png", "res/drawable-xhdpi-v4/lb_ic_replay.png", "res/drawable-xhdpi-v4/lb_text_dot_two.png", "res/drawable-xhdpi-v4/lb_ic_cc.png", "res/drawable-xhdpi-v4/lb_ic_thumb_up_outline.png", "res/drawable-xhdpi-v4/lb_ic_thumb_up.png", "res/drawable-xhdpi-v4/lb_in_app_search_shadow_focused.9.png", "res/drawable-xhdpi-v4/lb_ic_playback_loop.png", "res/drawable-xhdpi-v4/lb_text_dot_one.png", "res/drawable-xhdpi-v4/lb_ic_search_mic_out.png", "res/drawable-xhdpi-v4/lb_ic_loop_one.png", "res/drawable-xhdpi-v4/lb_text_dot_one_small.png", "res/drawable-xhdpi-v4/lb_ic_stop.png", "res/drawable-xhdpi-v4/lb_ic_pip.png", "res/drawable-xhdpi-v4/lb_card_shadow_normal.9.png", "res/drawable-xhdpi-v4/lb_ic_nav_arrow.png", "res/drawable-xhdpi-v4/lb_text_dot_two_small.png", "res/drawable-xhdpi-v4/lb_ic_loop.png", "res/drawable-xhdpi-v4/lb_ic_play.png", "res/drawable-xhdpi-v4/lb_ic_play_fit.png", "res/drawable-xhdpi-v4/lb_ic_fast_rewind.png", "res/drawable-xhdpi-v4/lb_in_app_search_bg.9.png", "res/drawable-xhdpi-v4/lb_ic_thumb_down_outline.png", "res/drawable-xhdpi-v4/lb_in_app_search_shadow_normal.9.png", "res/drawable-xhdpi-v4/lb_card_shadow_focused.9.png", "res/drawable-xhdpi-v4/lb_ic_actions_right_arrow.png", "res/drawable-xhdpi-v4/lb_ic_sad_cloud.png", "res/drawable-xhdpi-v4/lb_ic_thumb_down.png", "res/drawable-xhdpi-v4/lb_ic_guidedactions_item_chevron.png", "res/drawable-xhdpi-v4/lb_ic_in_app_search.png", "res/values-vi/values-vi.xml", "res/values-ko/values-ko.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-cs/values-cs.xml", "res/values-ml/values-ml.xml", "res/values-ldrtl-v17/values-ldrtl-v17.xml", "res/values-te/values-te.xml", "res/values-si/values-si.xml", "res/values-es/values-es.xml", "res/values-af/values-af.xml", "res/values-zu/values-zu.xml", "res/values-lo/values-lo.xml", "res/values-v19/values-v19.xml", "res/values-mk/values-mk.xml", "res/values-sl/values-sl.xml", "res/values-sw/values-sw.xml", "res/values-bn/values-bn.xml", "res/raw/lb_voice_open.ogg", "res/raw/lb_voice_success.ogg", "res/raw/lb_voice_failure.ogg", "res/raw/lb_voice_no_input.ogg", "res/transition-v21/lb_browse_headers_out.xml", "res/transition-v21/lb_browse_enter_transition.xml", "res/transition-v21/lb_return_transition.xml", "res/transition-v21/lb_details_return_transition.xml", "res/transition-v21/lb_browse_entrance_transition.xml", "res/transition-v21/lb_details_enter_transition.xml", "res/transition-v21/lb_enter_transition.xml", "res/transition-v21/lb_vertical_grid_entrance_transition.xml", "res/transition-v21/lb_shared_element_enter_transition.xml", "res/transition-v21/lb_guidedstep_activity_enter.xml", "res/transition-v21/lb_shared_element_return_transition.xml", "res/transition-v21/lb_title_in.xml", "res/transition-v21/lb_guidedstep_activity_enter_bottom.xml", "res/transition-v21/lb_title_out.xml", "res/transition-v21/lb_browse_return_transition.xml", "res/transition-v21/lb_vertical_grid_enter_transition.xml", "res/transition-v21/lb_vertical_grid_return_transition.xml", "res/transition-v21/lb_browse_headers_in.xml", "res/values-sk/values-sk.xml", "res/values-lv/values-lv.xml", "res/anim/lb_decelerator_4.xml", "res/anim/lb_decelerator_2.xml", "res/values-is/values-is.xml", "res/values-da/values-da.xml", "res/values-it/values-it.xml", "res/values-gl/values-gl.xml", "res/values-de/values-de.xml", "res/values-be/values-be.xml", "res/values-en-rCA/values-en-rCA.xml", "res/animator/lb_onboarding_page_indicator_fade_in.xml", "res/animator/lb_guidedstep_slide_down.xml", "res/animator/lb_onboarding_logo_exit.xml", "res/animator/lb_onboarding_title_enter.xml", "res/animator/lb_onboarding_start_button_fade_out.xml", "res/animator/lb_playback_rows_fade_out.xml", "res/animator/lb_playback_controls_fade_in.xml", "res/animator/lb_playback_description_fade_in.xml", "res/animator/lb_playback_bg_fade_out.xml", "res/animator/lb_playback_bg_fade_in.xml", "res/animator/lb_guidedactions_item_unpressed.xml", "res/animator/lb_playback_description_fade_out.xml", "res/animator/lb_onboarding_start_button_fade_in.xml", "res/animator/lb_playback_rows_fade_in.xml", "res/animator/lb_guidedactions_item_pressed.xml", "res/animator/lb_onboarding_description_enter.xml", "res/animator/lb_guidedstep_slide_up.xml", "res/animator/lb_onboarding_logo_enter.xml", "res/animator/lb_onboarding_page_indicator_enter.xml", "res/animator/lb_playback_controls_fade_out.xml", "res/animator/lb_onboarding_page_indicator_fade_out.xml", "res/values-fa/values-fa.xml", "res/values-ca/values-ca.xml", "res/values-th/values-th.xml", "res/values-nl/values-nl.xml", "res/values-hy/values-hy.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-tl/values-tl.xml", "res/values-kk/values-kk.xml", "res/values-pt/values-pt.xml", "res/values-my/values-my.xml", "res/values-et/values-et.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-sr/values-sr.xml", "res/values-fr/values-fr.xml", "res/values-kn/values-kn.xml", "res/values-nb/values-nb.xml", "res/values-ne/values-ne.xml", "res/transition-v19/lb_browse_headers_out.xml", "res/transition-v19/lb_browse_headers_in.xml", "res/drawable/lb_card_foreground.xml", "res/drawable/lb_control_button_primary.xml", "res/drawable/lb_playback_progress_bar.xml", "res/drawable/lb_onboarding_start_button_background.xml", "res/drawable/lb_search_orb.xml", "res/drawable/lb_speech_orb.xml", "res/drawable/lb_headers_right_fading.xml", "res/drawable/lb_background.xml", "res/drawable/lb_playback_now_playing_bar.xml", "res/drawable/lb_control_button_secondary.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-ka/values-ka.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-az/values-az.xml", "res/values-sq/values-sq.xml", "res/values-hi/values-hi.xml", "res/values-in/values-in.xml", "res/values-uk/values-uk.xml", "res/drawable-v21/lb_card_foreground.xml", "res/drawable-v21/lb_selectable_item_rounded_rect.xml", "res/drawable-v21/lb_control_button_primary.xml", "res/drawable-v21/lb_action_bg.xml", "res/drawable-v21/lb_control_button_secondary.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v17_preference_java.info b/build/secondary/third_party/android_tools/support/android_support_v17_preference_java.info deleted file mode 100644 index 87ea13e..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v17_preference_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/layout/leanback_preference_widget_seekbar.xml", "res/layout/leanback_preference_information.xml", "res/layout/leanback_preference.xml", "res/layout/leanback_preferences_list.xml", "res/layout/leanback_settings_fragment.xml", "res/layout/leanback_list_preference_item_single.xml", "res/layout/leanback_preference_category.xml", "res/layout/leanback_list_preference_fragment.xml", "res/layout/leanback_list_preference_item_multi.xml", "res/layout/leanback_preference_fragment.xml", "res/color/lb_preference_item_primary_text_color.xml", "res/color/lb_preference_item_secondary_text_color.xml", "res/values/values.xml", "res/layout-v21/leanback_settings_fragment.xml", "res/layout-v21/leanback_preference_category.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_appcompat_java_internal.info b/build/secondary/third_party/android_tools/support/android_support_v7_appcompat_java_internal.info deleted file mode 100644 index e99e4de..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_appcompat_java_internal.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values-ur/values-ur.xml", "res/values-ru/values-ru.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-el/values-el.xml", "res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-hdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-hdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-hdpi-v4/abc_list_focused_holo.9.png", "res/drawable-hdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-hdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-hdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-hdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-hdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-hdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-hdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-hdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-hdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/values-tr/values-tr.xml", "res/values-hu/values-hu.xml", "res/values-v18/values-v18.xml", "res/values-km/values-km.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gu/values-gu.xml", "res/layout/abc_list_menu_item_layout.xml", "res/layout/abc_action_menu_layout.xml", "res/layout/abc_search_dropdown_item_icons_2line.xml", "res/layout/support_simple_spinner_dropdown_item.xml", "res/layout/abc_screen_simple.xml", "res/layout/abc_action_menu_item_layout.xml", "res/layout/abc_list_menu_item_radio.xml", "res/layout/abc_alert_dialog_title_material.xml", "res/layout/abc_alert_dialog_material.xml", "res/layout/abc_screen_toolbar.xml", "res/layout/abc_screen_simple_overlay_action_mode.xml", "res/layout/abc_select_dialog_material.xml", "res/layout/abc_action_mode_bar.xml", "res/layout/abc_dialog_title_material.xml", "res/layout/abc_list_menu_item_checkbox.xml", "res/layout/abc_popup_menu_header_item_layout.xml", "res/layout/abc_action_bar_up_container.xml", "res/layout/select_dialog_singlechoice_material.xml", "res/layout/abc_action_mode_close_item_material.xml", "res/layout/tooltip.xml", "res/layout/select_dialog_multichoice_material.xml", "res/layout/abc_action_bar_title_item.xml", "res/layout/abc_activity_chooser_view_list_item.xml", "res/layout/abc_popup_menu_item_layout.xml", "res/layout/abc_alert_dialog_button_bar_material.xml", "res/layout/abc_list_menu_item_icon.xml", "res/layout/abc_expanded_menu_layout.xml", "res/layout/select_dialog_item_material.xml", "res/layout/abc_activity_chooser_view.xml", "res/layout/abc_search_view.xml", "res/layout/abc_screen_content_include.xml", "res/values-ms/values-ms.xml", "res/values-v21/values-v21.xml", "res/values-ja/values-ja.xml", "res/values-eu/values-eu.xml", "res/values-hdpi-v4/values-hdpi-v4.xml", "res/values-sv/values-sv.xml", "res/values-mn/values-mn.xml", "res/values-v14/values-v14.xml", "res/values-ta/values-ta.xml", "res/values-v23/values-v23.xml", "res/values-pl/values-pl.xml", "res/drawable-xxhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xxhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xxhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/color/abc_search_url_text.xml", "res/color/abc_btn_colored_borderless_text_material.xml", "res/color/abc_primary_text_material_light.xml", "res/color/abc_tint_seek_thumb.xml", "res/color/abc_tint_btn_checkable.xml", "res/color/abc_secondary_text_material_dark.xml", "res/color/abc_tint_edittext.xml", "res/color/abc_tint_spinner.xml", "res/color/abc_primary_text_material_dark.xml", "res/color/abc_secondary_text_material_light.xml", "res/color/switch_thumb_material_dark.xml", "res/color/abc_hint_foreground_material_dark.xml", "res/color/abc_tint_switch_track.xml", "res/color/abc_primary_text_disable_only_material_dark.xml", "res/color/abc_btn_colored_text_material.xml", "res/color/abc_hint_foreground_material_light.xml", "res/color/switch_thumb_material_light.xml", "res/color/abc_tint_default.xml", "res/color/abc_primary_text_disable_only_material_light.xml", "res/values-ldltr-v21/values-ldltr-v21.xml", "res/values-lt/values-lt.xml", "res/values-bg/values-bg.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-iw/values-iw.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-mr/values-mr.xml", "res/values-uz/values-uz.xml", "res/values-large-v4/values-large-v4.xml", "res/values-v11/values-v11.xml", "res/color-v11/abc_background_cache_hint_selector_material_light.xml", "res/color-v11/abc_background_cache_hint_selector_material_dark.xml", "res/values-pa/values-pa.xml", "res/values-v22/values-v22.xml", "res/values-v25/values-v25.xml", "res/values-fi/values-fi.xml", "res/values-am/values-am.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ar/values-ar.xml", "res/values-ky/values-ky.xml", "res/values-v12/values-v12.xml", "res/drawable-mdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-mdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-mdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-mdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-mdpi-v4/abc_list_focused_holo.9.png", "res/drawable-mdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-mdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-mdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-mdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-mdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-mdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-mdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-mdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-mdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/values-bs/values-bs.xml", "res/values/values.xml", "res/values-hr/values-hr.xml", "res/values-v24/values-v24.xml", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/values-en-rAU/values-en-rAU.xml", "res/values-ro/values-ro.xml", "res/drawable-xhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/values-vi/values-vi.xml", "res/values-ko/values-ko.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/values-cs/values-cs.xml", "res/values-ml/values-ml.xml", "res/values-te/values-te.xml", "res/values-si/values-si.xml", "res/values-es/values-es.xml", "res/values-af/values-af.xml", "res/values-zu/values-zu.xml", "res/values-lo/values-lo.xml", "res/values-land/values-land.xml", "res/values-mk/values-mk.xml", "res/values-sl/values-sl.xml", "res/values-xlarge-v4/values-xlarge-v4.xml", "res/values-sw600dp-v13/values-sw600dp-v13.xml", "res/values-sw/values-sw.xml", "res/values-bn/values-bn.xml", "res/values-sk/values-sk.xml", "res/values-lv/values-lv.xml", "res/anim/abc_shrink_fade_out_from_bottom.xml", "res/anim/abc_slide_in_bottom.xml", "res/anim/abc_fade_out.xml", "res/anim/abc_slide_in_top.xml", "res/anim/abc_slide_out_top.xml", "res/anim/tooltip_exit.xml", "res/anim/abc_popup_exit.xml", "res/anim/abc_grow_fade_in_from_bottom.xml", "res/anim/tooltip_enter.xml", "res/anim/abc_fade_in.xml", "res/anim/abc_slide_out_bottom.xml", "res/anim/abc_popup_enter.xml", "res/values-is/values-is.xml", "res/values-da/values-da.xml", "res/values-it/values-it.xml", "res/values-gl/values-gl.xml", "res/values-de/values-de.xml", "res/values-be/values-be.xml", "res/values-en-rCA/values-en-rCA.xml", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/values-fa/values-fa.xml", "res/values-ca/values-ca.xml", "res/values-th/values-th.xml", "res/values-nl/values-nl.xml", "res/values-hy/values-hy.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-tl/values-tl.xml", "res/values-kk/values-kk.xml", "res/values-pt/values-pt.xml", "res/values-my/values-my.xml", "res/values-night-v8/values-night-v8.xml", "res/drawable-v23/abc_control_background_material.xml", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/values-et/values-et.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-sr/values-sr.xml", "res/values-v16/values-v16.xml", "res/values-fr/values-fr.xml", "res/values-kn/values-kn.xml", "res/values-nb/values-nb.xml", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/layout-v26/abc_screen_toolbar.xml", "res/values-v26/values-v26.xml", "res/values-port/values-port.xml", "res/color-v23/abc_btn_colored_borderless_text_material.xml", "res/color-v23/abc_color_highlight_material.xml", "res/color-v23/abc_tint_seek_thumb.xml", "res/color-v23/abc_tint_btn_checkable.xml", "res/color-v23/abc_tint_edittext.xml", "res/color-v23/abc_tint_spinner.xml", "res/color-v23/abc_tint_switch_track.xml", "res/color-v23/abc_btn_colored_text_material.xml", "res/color-v23/abc_tint_default.xml", "res/values-v17/values-v17.xml", "res/values-ne/values-ne.xml", "res/values-v13/values-v13.xml", "res/drawable/abc_tab_indicator_material.xml", "res/drawable/abc_item_background_holo_dark.xml", "res/drawable/abc_edit_text_material.xml", "res/drawable/abc_ic_voice_search_api_material.xml", "res/drawable/abc_ic_menu_overflow_material.xml", "res/drawable/abc_ic_search_api_material.xml", "res/drawable/abc_cab_background_top_material.xml", "res/drawable/abc_list_selector_holo_light.xml", "res/drawable/abc_ic_arrow_drop_right_black_24dp.xml", "res/drawable/abc_spinner_textfield_background_material.xml", "res/drawable/abc_ratingbar_small_material.xml", "res/drawable/tooltip_frame_dark.xml", "res/drawable/abc_item_background_holo_light.xml", "res/drawable/abc_btn_colored_material.xml", "res/drawable/abc_ratingbar_material.xml", "res/drawable/abc_cab_background_internal_bg.xml", "res/drawable/abc_btn_radio_material.xml", "res/drawable/tooltip_frame_light.xml", "res/drawable/abc_ic_clear_material.xml", "res/drawable/abc_ic_ab_back_material.xml", "res/drawable/abc_textfield_search_material.xml", "res/drawable/abc_ic_go_search_api_material.xml", "res/drawable/abc_seekbar_track_material.xml", "res/drawable/abc_dialog_material_background.xml", "res/drawable/abc_seekbar_tick_mark_material.xml", "res/drawable/abc_list_selector_background_transition_holo_light.xml", "res/drawable/abc_text_cursor_material.xml", "res/drawable/abc_btn_default_mtrl_shape.xml", "res/drawable/abc_ratingbar_indicator_material.xml", "res/drawable/abc_switch_thumb_material.xml", "res/drawable/abc_seekbar_thumb_material.xml", "res/drawable/abc_list_selector_background_transition_holo_dark.xml", "res/drawable/abc_btn_check_material.xml", "res/drawable/abc_list_selector_holo_dark.xml", "res/drawable/abc_btn_borderless_material.xml", "res/drawable/abc_vector_test.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-h720dp-v13/values-h720dp-v13.xml", "res/values-ka/values-ka.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-az/values-az.xml", "res/values-sq/values-sq.xml", "res/values-hi/values-hi.xml", "res/values-in/values-in.xml", "res/values-uk/values-uk.xml", "res/drawable-v21/abc_edit_text_material.xml", "res/drawable-v21/abc_btn_colored_material.xml", "res/drawable-v21/abc_action_bar_item_background_material.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_gridlayout_java.info b/build/secondary/third_party/android_tools/support/android_support_v7_gridlayout_java.info deleted file mode 100644 index 28c8330..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_gridlayout_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values/values.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_mediarouter_java.info b/build/secondary/third_party/android_tools/support/android_support_v7_mediarouter_java.info deleted file mode 100644 index 6fc7871..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_mediarouter_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values-ur/values-ur.xml", "res/values-ru/values-ru.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-el/values-el.xml", "res/drawable-hdpi-v4/ic_dialog_close_light.png", "res/drawable-hdpi-v4/ic_media_pause_light.png", "res/drawable-hdpi-v4/ic_mr_button_disabled_light.png", "res/drawable-hdpi-v4/ic_mr_button_grey.png", "res/drawable-hdpi-v4/ic_media_play_light.png", "res/drawable-hdpi-v4/ic_dialog_close_dark.png", "res/drawable-hdpi-v4/ic_vol_type_tv_dark.png", "res/drawable-hdpi-v4/ic_media_pause_dark.png", "res/drawable-hdpi-v4/ic_vol_type_tv_light.png", "res/drawable-hdpi-v4/ic_media_stop_dark.png", "res/drawable-hdpi-v4/ic_vol_type_speaker_dark.png", "res/drawable-hdpi-v4/ic_mr_button_disabled_dark.png", "res/drawable-hdpi-v4/ic_audiotrack_light.png", "res/drawable-hdpi-v4/ic_vol_type_speaker_group_dark.png", "res/drawable-hdpi-v4/ic_media_stop_light.png", "res/drawable-hdpi-v4/ic_media_play_dark.png", "res/drawable-hdpi-v4/ic_audiotrack_dark.png", "res/drawable-hdpi-v4/ic_vol_type_speaker_light.png", "res/drawable-hdpi-v4/ic_mr_button_disconnected_dark.png", "res/drawable-hdpi-v4/ic_mr_button_disconnected_light.png", "res/drawable-hdpi-v4/ic_vol_type_speaker_group_light.png", "res/values-tr/values-tr.xml", "res/values-hu/values-hu.xml", "res/values-km/values-km.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gu/values-gu.xml", "res/interpolator/mr_fast_out_slow_in.xml", "res/interpolator/mr_linear_out_slow_in.xml", "res/layout/mr_controller_material_dialog_b.xml", "res/layout/mr_volume_control.xml", "res/layout/mr_controller_volume_item.xml", "res/layout/mr_chooser_list_item.xml", "res/layout/mr_chooser_dialog.xml", "res/layout/mr_playback_control.xml", "res/values-ms/values-ms.xml", "res/values-ja/values-ja.xml", "res/values-eu/values-eu.xml", "res/values-sv/values-sv.xml", "res/values-mn/values-mn.xml", "res/values-ta/values-ta.xml", "res/values-pl/values-pl.xml", "res/drawable-xxhdpi-v4/ic_mr_button_connected_28_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_00_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_28_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_04_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_28_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_06_light.png", "res/drawable-xxhdpi-v4/ic_dialog_close_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_29_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_01_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_23_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_18_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_04_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_12_light.png", "res/drawable-xxhdpi-v4/ic_media_pause_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_disabled_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_grey.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_14_dark.png", "res/drawable-xxhdpi-v4/ic_media_play_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_12_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_14_light.png", "res/drawable-xxhdpi-v4/ic_dialog_close_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_30_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_27_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_07_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_25_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_18_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_23_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_11_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_08_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_02_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_22_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_08_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_20_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_18_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_19_light.png", "res/drawable-xxhdpi-v4/ic_vol_type_tv_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_05_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_10_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_02_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_25_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_18_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_22_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_22_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_24_dark.png", "res/drawable-xxhdpi-v4/ic_media_pause_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_29_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_03_light.png", "res/drawable-xxhdpi-v4/ic_vol_type_tv_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_11_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_30_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_23_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_29_dark.png", "res/drawable-xxhdpi-v4/ic_media_stop_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_27_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_25_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_06_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_00_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_02_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_17_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_03_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_09_dark.png", "res/drawable-xxhdpi-v4/ic_vol_type_speaker_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_00_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_24_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_26_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_29_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_30_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_05_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_08_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_15_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_17_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_disabled_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_26_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_24_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_16_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_27_dark.png", "res/drawable-xxhdpi-v4/ic_audiotrack_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_13_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_16_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_04_light.png", "res/drawable-xxhdpi-v4/ic_vol_type_speaker_group_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_13_light.png", "res/drawable-xxhdpi-v4/ic_media_stop_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_17_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_16_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_16_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_01_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_07_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_13_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_19_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_00_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_14_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_03_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_15_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_20_light.png", "res/drawable-xxhdpi-v4/ic_media_play_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_03_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_27_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_21_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_28_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_02_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_10_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_23_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_15_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_21_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_05_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_19_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_20_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_06_dark.png", "res/drawable-xxhdpi-v4/ic_audiotrack_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_21_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_09_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_20_dark.png", "res/drawable-xxhdpi-v4/ic_vol_type_speaker_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_disconnected_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_19_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_22_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_25_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_09_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_11_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_12_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_10_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_13_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_24_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_01_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_26_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_26_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_07_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_04_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_10_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_17_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_05_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_07_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_15_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_08_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_11_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_09_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_disconnected_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_12_light.png", "res/drawable-xxhdpi-v4/ic_vol_type_speaker_group_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_14_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connecting_21_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_30_dark.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_06_light.png", "res/drawable-xxhdpi-v4/ic_mr_button_connected_01_dark.png", "res/values-lt/values-lt.xml", "res/values-bg/values-bg.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-iw/values-iw.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-mr/values-mr.xml", "res/values-uz/values-uz.xml", "res/values-pa/values-pa.xml", "res/values-fi/values-fi.xml", "res/values-am/values-am.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ar/values-ar.xml", "res/values-ky/values-ky.xml", "res/drawable-mdpi-v4/ic_dialog_close_light.png", "res/drawable-mdpi-v4/ic_media_pause_light.png", "res/drawable-mdpi-v4/ic_mr_button_disabled_light.png", "res/drawable-mdpi-v4/ic_mr_button_grey.png", "res/drawable-mdpi-v4/ic_media_play_light.png", "res/drawable-mdpi-v4/ic_dialog_close_dark.png", "res/drawable-mdpi-v4/ic_vol_type_tv_dark.png", "res/drawable-mdpi-v4/ic_media_pause_dark.png", "res/drawable-mdpi-v4/ic_vol_type_tv_light.png", "res/drawable-mdpi-v4/ic_media_stop_dark.png", "res/drawable-mdpi-v4/ic_vol_type_speaker_dark.png", "res/drawable-mdpi-v4/ic_mr_button_disabled_dark.png", "res/drawable-mdpi-v4/ic_audiotrack_light.png", "res/drawable-mdpi-v4/ic_vol_type_speaker_group_dark.png", "res/drawable-mdpi-v4/ic_media_stop_light.png", "res/drawable-mdpi-v4/ic_media_play_dark.png", "res/drawable-mdpi-v4/ic_audiotrack_dark.png", "res/drawable-mdpi-v4/ic_vol_type_speaker_light.png", "res/drawable-mdpi-v4/ic_mr_button_disconnected_dark.png", "res/drawable-mdpi-v4/ic_mr_button_disconnected_light.png", "res/drawable-mdpi-v4/ic_vol_type_speaker_group_light.png", "res/values-bs/values-bs.xml", "res/values/values.xml", "res/values-hr/values-hr.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-ro/values-ro.xml", "res/drawable-xhdpi-v4/ic_mr_button_connected_28_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_00_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_28_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_04_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_28_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_06_light.png", "res/drawable-xhdpi-v4/ic_dialog_close_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_29_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_01_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_23_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_18_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_04_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_12_light.png", "res/drawable-xhdpi-v4/ic_media_pause_light.png", "res/drawable-xhdpi-v4/ic_mr_button_disabled_light.png", "res/drawable-xhdpi-v4/ic_mr_button_grey.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_14_dark.png", "res/drawable-xhdpi-v4/ic_media_play_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_12_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_14_light.png", "res/drawable-xhdpi-v4/ic_dialog_close_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_30_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_27_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_07_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_25_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_18_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_23_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_11_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_08_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_02_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_22_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_08_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_20_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_18_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_19_light.png", "res/drawable-xhdpi-v4/ic_vol_type_tv_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_05_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_10_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_02_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_25_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_18_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_22_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_22_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_24_dark.png", "res/drawable-xhdpi-v4/ic_media_pause_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_29_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_03_light.png", "res/drawable-xhdpi-v4/ic_vol_type_tv_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_11_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_30_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_23_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_29_dark.png", "res/drawable-xhdpi-v4/ic_media_stop_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_27_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_25_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_06_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_00_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_02_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_17_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_03_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_09_dark.png", "res/drawable-xhdpi-v4/ic_vol_type_speaker_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_00_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_24_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_26_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_29_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_30_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_05_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_08_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_15_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_17_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_disabled_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_26_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_24_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_16_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_27_dark.png", "res/drawable-xhdpi-v4/ic_audiotrack_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_13_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_16_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_04_light.png", "res/drawable-xhdpi-v4/ic_vol_type_speaker_group_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_13_light.png", "res/drawable-xhdpi-v4/ic_media_stop_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_17_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_16_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_16_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_01_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_07_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_13_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_19_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_00_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_14_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_03_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_15_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_20_light.png", "res/drawable-xhdpi-v4/ic_media_play_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_03_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_27_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_21_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_28_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_02_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_10_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_23_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_15_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_21_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_05_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_19_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_20_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_06_dark.png", "res/drawable-xhdpi-v4/ic_audiotrack_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_21_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_09_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_20_dark.png", "res/drawable-xhdpi-v4/ic_vol_type_speaker_light.png", "res/drawable-xhdpi-v4/ic_mr_button_disconnected_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_19_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_22_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_25_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_09_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_11_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_12_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_10_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_13_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_24_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_01_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_26_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_26_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_07_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_04_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_10_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_17_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_05_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_07_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_15_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_08_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_11_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_09_light.png", "res/drawable-xhdpi-v4/ic_mr_button_disconnected_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_12_light.png", "res/drawable-xhdpi-v4/ic_vol_type_speaker_group_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_14_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connecting_21_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_30_dark.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_06_light.png", "res/drawable-xhdpi-v4/ic_mr_button_connected_01_dark.png", "res/values-vi/values-vi.xml", "res/values-ko/values-ko.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-cs/values-cs.xml", "res/values-ml/values-ml.xml", "res/values-te/values-te.xml", "res/values-si/values-si.xml", "res/values-es/values-es.xml", "res/values-af/values-af.xml", "res/values-zu/values-zu.xml", "res/values-lo/values-lo.xml", "res/values-land/values-land.xml", "res/values-mk/values-mk.xml", "res/values-sl/values-sl.xml", "res/values-sw600dp-v13/values-sw600dp-v13.xml", "res/values-sw/values-sw.xml", "res/values-bn/values-bn.xml", "res/values-sk/values-sk.xml", "res/values-lv/values-lv.xml", "res/values-is/values-is.xml", "res/values-da/values-da.xml", "res/values-it/values-it.xml", "res/values-gl/values-gl.xml", "res/values-de/values-de.xml", "res/values-be/values-be.xml", "res/values-en-rCA/values-en-rCA.xml", "res/values-fa/values-fa.xml", "res/values-ca/values-ca.xml", "res/values-th/values-th.xml", "res/values-nl/values-nl.xml", "res/values-hy/values-hy.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-tl/values-tl.xml", "res/values-kk/values-kk.xml", "res/values-pt/values-pt.xml", "res/values-my/values-my.xml", "res/drawable-xxxhdpi-v4/ic_group_collapse_13.png", "res/drawable-xxxhdpi-v4/ic_mr_button_grey.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_09.png", "res/drawable-xxxhdpi-v4/ic_group_expand_06.png", "res/drawable-xxxhdpi-v4/ic_group_expand_03.png", "res/drawable-xxxhdpi-v4/ic_group_expand_09.png", "res/drawable-xxxhdpi-v4/ic_group_expand_07.png", "res/drawable-xxxhdpi-v4/ic_group_expand_08.png", "res/drawable-xxxhdpi-v4/ic_group_expand_14.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_04.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_14.png", "res/drawable-xxxhdpi-v4/ic_group_expand_04.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_05.png", "res/drawable-xxxhdpi-v4/ic_group_expand_11.png", "res/drawable-xxxhdpi-v4/ic_group_expand_10.png", "res/drawable-xxxhdpi-v4/ic_group_expand_05.png", "res/drawable-xxxhdpi-v4/ic_group_expand_13.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_06.png", "res/drawable-xxxhdpi-v4/ic_group_expand_15.png", "res/drawable-xxxhdpi-v4/ic_group_expand_02.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_10.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_15.png", "res/drawable-xxxhdpi-v4/ic_group_expand_00.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_02.png", "res/drawable-xxxhdpi-v4/ic_group_expand_12.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_03.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_08.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_01.png", "res/drawable-xxxhdpi-v4/ic_group_expand_01.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_00.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_12.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_07.png", "res/drawable-xxxhdpi-v4/ic_group_collapse_11.png", "res/values-et/values-et.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-sr/values-sr.xml", "res/values-fr/values-fr.xml", "res/values-kn/values-kn.xml", "res/values-nb/values-nb.xml", "res/values-sw720dp-v13/values-sw720dp-v13.xml", "res/values-ne/values-ne.xml", "res/drawable/mr_media_pause_dark.xml", "res/drawable/mr_dialog_close_dark.xml", "res/drawable/mr_media_stop_light.xml", "res/drawable/mr_button_dark.xml", "res/drawable/mr_button_connected_dark.xml", "res/drawable/mr_dialog_material_background_dark.xml", "res/drawable/mr_button_connecting_light.xml", "res/drawable/mr_media_play_light.xml", "res/drawable/mr_media_pause_light.xml", "res/drawable/mr_dialog_material_background_light.xml", "res/drawable/mr_button_connecting_dark.xml", "res/drawable/mr_media_stop_dark.xml", "res/drawable/mr_dialog_close_light.xml", "res/drawable/mr_group_expand.xml", "res/drawable/mr_vol_type_audiotrack_dark.xml", "res/drawable/mr_vol_type_audiotrack_light.xml", "res/drawable/mr_media_play_dark.xml", "res/drawable/mr_group_collapse.xml", "res/drawable/mr_button_light.xml", "res/drawable/mr_button_connected_light.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-ka/values-ka.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-az/values-az.xml", "res/values-sq/values-sq.xml", "res/values-hi/values-hi.xml", "res/values-in/values-in.xml", "res/values-uk/values-uk.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_palette_java.info b/build/secondary/third_party/android_tools/support/android_support_v7_palette_java.info deleted file mode 100644 index cd54060..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_palette_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_preference_java.info b/build/secondary/third_party/android_tools/support/android_support_v7_preference_java.info deleted file mode 100644 index 25a4927..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_preference_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/layout-v11/preference.xml", "res/layout-v11/preference_dropdown.xml", "res/layout/preference_recyclerview.xml", "res/layout/preference_widget_checkbox.xml", "res/layout/preference_widget_seekbar.xml", "res/layout/preference_widget_switch_compat.xml", "res/layout/preference_list_fragment.xml", "res/layout/preference_dialog_edittext.xml", "res/layout/preference_information.xml", "res/layout/preference_category.xml", "res/values/values.xml", "res/values-v17/values-v17.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_v7_recyclerview_java.info b/build/secondary/third_party/android_tools/support/android_support_v7_recyclerview_java.info deleted file mode 100644 index a25d255..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_v7_recyclerview_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = true -resources = [ "res/values/values.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/build/secondary/third_party/android_tools/support/android_support_vector_drawable_java.info b/build/secondary/third_party/android_tools/support/android_support_vector_drawable_java.info deleted file mode 100644 index cd54060..0000000 --- a/build/secondary/third_party/android_tools/support/android_support_vector_drawable_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = true -is_manifest_empty = true -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index ea03f18..793b33e 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -158,6 +158,7 @@ "raster/raster_source.h", "raster/scoped_gpu_raster.cc", "raster/scoped_gpu_raster.h", + "raster/scoped_grcontext_access.h", "raster/single_thread_task_graph_runner.cc", "raster/single_thread_task_graph_runner.h", "raster/staging_buffer_pool.cc",
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc index 3ec38df..3db004cf 100644 --- a/cc/raster/gpu_raster_buffer_provider.cc +++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -18,6 +18,7 @@ #include "cc/paint/paint_recorder.h" #include "cc/raster/raster_source.h" #include "cc/raster/scoped_gpu_raster.h" +#include "cc/raster/scoped_grcontext_access.h" #include "components/viz/client/client_resource_provider.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/gpu/raster_context_provider.h" @@ -164,24 +165,6 @@ ri->DeleteTextures(1, &texture_id); } -// The following class is needed to correctly reset GL state when rendering to -// SkCanvases with a GrContext on a RasterInterface enabled context. -class ScopedGrContextAccess { - public: - explicit ScopedGrContextAccess(viz::RasterContextProvider* context_provider) - : context_provider_(context_provider) { - gpu::raster::RasterInterface* ri = context_provider_->RasterInterface(); - ri->BeginGpuRaster(); - } - ~ScopedGrContextAccess() { - gpu::raster::RasterInterface* ri = context_provider_->RasterInterface(); - ri->EndGpuRaster(); - } - - private: - viz::RasterContextProvider* context_provider_; -}; - static void RasterizeSource( const RasterSource* raster_source, bool resource_has_previous_content,
diff --git a/cc/raster/scoped_grcontext_access.h b/cc/raster/scoped_grcontext_access.h new file mode 100644 index 0000000..ff10d5b --- /dev/null +++ b/cc/raster/scoped_grcontext_access.h
@@ -0,0 +1,29 @@ +// Copyright 2018 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 CC_RASTER_SCOPED_GRCONTEXT_ACCESS_H_ +#define CC_RASTER_SCOPED_GRCONTEXT_ACCESS_H_ + +#include "components/viz/common/gpu/raster_context_provider.h" +#include "gpu/command_buffer/client/raster_interface.h" + +// The following class is needed to correctly reset GL state when using a +// GrContext on a RasterInterface enabled context. +class ScopedGrContextAccess { + public: + explicit ScopedGrContextAccess(viz::RasterContextProvider* context_provider) + : context_provider_(context_provider) { + gpu::raster::RasterInterface* ri = context_provider_->RasterInterface(); + ri->BeginGpuRaster(); + } + ~ScopedGrContextAccess() { + gpu::raster::RasterInterface* ri = context_provider_->RasterInterface(); + ri->EndGpuRaster(); + } + + private: + viz::RasterContextProvider* context_provider_; +}; + +#endif // CC_RASTER_SCOPED_GRCONTEXT_ACCESS_H_
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 747f1a3..3cc88536 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -19,6 +19,7 @@ #include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" #include "cc/paint/image_transfer_cache_entry.h" +#include "cc/raster/scoped_grcontext_access.h" #include "cc/raster/tile_task.h" #include "cc/tiles/mipmap_util.h" #include "components/viz/common/gpu/raster_context_provider.h" @@ -1111,7 +1112,11 @@ if (context_->GetLock()) context_lock.emplace(context_); + base::Optional<ScopedGrContextAccess> gr_context_access; + if (!use_transfer_cache_) + gr_context_access.emplace(context_); base::AutoLock lock(lock_); + ImageData* image_data = GetImageDataForDrawImage( draw_image, InUseCacheKey::FromDrawImage(draw_image)); DCHECK(image_data);
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 43e7bd5..c6c32ac 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -804,6 +804,7 @@ data = [ "//chrome/android/shared_preference_files/test/", + "//components/test/data/js_dialogs/render_tests/", "//third_party/gvr-android-sdk/test-apks/", ] }
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java index 315adfa..f355bfb 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
@@ -15,6 +15,7 @@ import com.google.android.libraries.feed.api.scope.FeedProcessScope; import com.google.android.libraries.feed.api.scope.FeedStreamScope; +import com.google.android.libraries.feed.api.stream.NonDismissibleHeader; import com.google.android.libraries.feed.api.stream.Stream; import com.google.android.libraries.feed.common.functional.Consumer; import com.google.android.libraries.feed.host.action.ActionApi; @@ -213,7 +214,8 @@ mStream.getView().setBackgroundColor(Color.WHITE); mRootView.addView(mStream.getView()); - mStream.setHeaderViews(Arrays.asList(mNewTabPageLayout, mSectionHeaderView)); + mStream.setHeaderViews(Arrays.asList(new NonDismissibleHeader(mNewTabPageLayout), + new NonDismissibleHeader(mSectionHeaderView))); } @Override
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedProcessScopeFactory.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedProcessScopeFactory.java index e430686..cdce01e24 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedProcessScopeFactory.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedProcessScopeFactory.java
@@ -13,6 +13,7 @@ import com.google.android.libraries.feed.host.network.NetworkClient; import com.google.android.libraries.feed.hostimpl.logging.LoggingApiImpl; +import org.chromium.base.ContextUtils; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.profiles.Profile; @@ -58,7 +59,8 @@ new FeedProcessScope .Builder(configHostApi, Executors.newSingleThreadExecutor(), new LoggingApiImpl(), new FeedNetworkBridge(profile), - schedulerBridge, lifecycleListener, DebugBehavior.SILENT) + schedulerBridge, lifecycleListener, DebugBehavior.SILENT, + ContextUtils.getApplicationContext()) .build(); schedulerBridge.initializeFeedDependencies( sFeedProcessScope.getRequestManager(), sFeedProcessScope.getSessionManager()); @@ -91,7 +93,8 @@ sFeedProcessScope = new FeedProcessScope .Builder(configHostApi, Executors.newSingleThreadExecutor(), new LoggingApiImpl(), networkClient, sFeedScheduler, - lifecycleListener, DebugBehavior.SILENT) + lifecycleListener, DebugBehavior.SILENT, + ContextUtils.getApplicationContext()) .build(); }
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index 888a3eea..272bbc4 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -35,6 +35,7 @@ {% endif %} <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH"/> <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_ADMIN"/> + <uses-permission-sdk-23 android:name="android.permission.READ_CONTACTS"/> <uses-permission-sdk-23 android:name="android.permission.REORDER_TASKS"/> <uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
diff --git a/chrome/android/java/res/drawable-hdpi/preview_pin_round.png b/chrome/android/java/res/drawable-hdpi/preview_pin_round.png new file mode 100644 index 0000000..ab15f52 --- /dev/null +++ b/chrome/android/java/res/drawable-hdpi/preview_pin_round.png Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/preview_pin_round.png b/chrome/android/java/res/drawable-mdpi/preview_pin_round.png new file mode 100644 index 0000000..a44a72f2 --- /dev/null +++ b/chrome/android/java/res/drawable-mdpi/preview_pin_round.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/preview_pin_round.png b/chrome/android/java/res/drawable-xhdpi/preview_pin_round.png new file mode 100644 index 0000000..ce2768d --- /dev/null +++ b/chrome/android/java/res/drawable-xhdpi/preview_pin_round.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/preview_pin_round.png b/chrome/android/java/res/drawable-xxhdpi/preview_pin_round.png new file mode 100644 index 0000000..ea25928 --- /dev/null +++ b/chrome/android/java/res/drawable-xxhdpi/preview_pin_round.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/preview_pin_round.png b/chrome/android/java/res/drawable-xxxhdpi/preview_pin_round.png new file mode 100644 index 0000000..08f2f470 --- /dev/null +++ b/chrome/android/java/res/drawable-xxxhdpi/preview_pin_round.png Binary files differ
diff --git a/chrome/android/java/res/layout/contact_view.xml b/chrome/android/java/res/layout/contact_view.xml new file mode 100644 index 0000000..7d5b18b0 --- /dev/null +++ b/chrome/android/java/res/layout/contact_view.xml
@@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018 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. +--> + +<!-- Represents a single item in the Contacts Picker. --> + +<view class="org.chromium.chrome.browser.contacts_picker.ContactView" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <RelativeLayout + android:layout_height="match_parent" + android:layout_width="match_parent" + android:orientation="horizontal"> + + <ImageView + android:id="@+id/image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:paddingBottom="10dp" + android:paddingEnd="10dp" + android:paddingStart="10dp" + android:paddingTop="12dp" + tools:ignore="ContentDescription" /> + + <TextView + android:id="@+id/name" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:paddingTop="5dp" + android:layout_toEndOf="@id/image" + style="@style/BlackTitle1" /> + + <TextView + android:id="@+id/email" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:paddingBottom="5dp" + android:layout_below="@id/name" + android:layout_alignStart="@id/name" + style="@style/BlackBody"/> + + <ImageView + android:id="@+id/selected" + android:layout_width="26dp" + android:layout_height="26dp" + android:layout_marginStart="2dp" + android:layout_marginTop="2dp" + android:paddingTop="5dp" + android:paddingEnd="5dp" + android:visibility="gone" + android:layout_alignParentEnd="true" + app:srcCompat="@drawable/checkmark_blue" + tools:ignore="ContentDescription" /> + </RelativeLayout> +</view>
diff --git a/chrome/android/java/res/layout/contacts_picker_dialog.xml b/chrome/android/java/res/layout/contacts_picker_dialog.xml new file mode 100644 index 0000000..e5465322 --- /dev/null +++ b/chrome/android/java/res/layout/contacts_picker_dialog.xml
@@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2018 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. --> + +<org.chromium.chrome.browser.widget.selection.SelectableListLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/selectable_list" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/modern_primary_color" + android:fitsSystemWindows="true" />
diff --git a/chrome/android/java/res/layout/contacts_picker_toolbar.xml b/chrome/android/java/res/layout/contacts_picker_toolbar.xml new file mode 100644 index 0000000..6cd3b1e --- /dev/null +++ b/chrome/android/java/res/layout/contacts_picker_toolbar.xml
@@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018 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. +--> + +<org.chromium.chrome.browser.contacts_picker.ContactsPickerToolbar + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingStart="0dp" + android:paddingEnd="0dp"> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end"> + + <Button + android:id="@+id/done" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:enabled="false" + android:text="@string/done" + style="@style/MainButtonStyle" /> + </LinearLayout> +</org.chromium.chrome.browser.contacts_picker.ContactsPickerToolbar>
diff --git a/chrome/android/java/res/values/colors.xml b/chrome/android/java/res/values/colors.xml index 475787b..4e642cb 100644 --- a/chrome/android/java/res/values/colors.xml +++ b/chrome/android/java/res/values/colors.xml
@@ -160,6 +160,8 @@ <color name="locationbar_light_selection_color">#CC5595FE</color> <color name="locationbar_status_offline_color">@color/black_alpha_54</color> <color name="locationbar_status_offline_color_light">@android:color/white</color> + <color name="locationbar_status_preview_color">@color/modern_blue_300</color> + <color name="locationbar_status_preview_color_light">@color/modern_blue_600</color> <color name="locationbar_status_separator_color">@color/black_alpha_24</color> <color name="locationbar_status_separator_color_light">#3DFFFFFF</color> <color name="omnibox_focused_fading_background_color">@color/black_alpha_65</color> @@ -192,6 +194,9 @@ <!-- Favicon colors --> <color name="default_favicon_background_color">#787878</color> + <!-- Contacts Picker colors --> + <color name="selectable_list_item_highlight_color">@color/default_primary_color</color> + <!-- Photo Picker colors --> <color name="photo_picker_tile_bg_color">@color/google_grey_200</color> <color name="photo_picker_special_tile_bg_color">@color/google_grey_300</color>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 7f7cf455..2c27844d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1372,10 +1372,10 @@ maybeRemoveWindowBackground(); DownloadManagerService.getDownloadManagerService().onActivityLaunched(); + VrModuleProvider.getDelegate().onNativeLibraryAvailable(); if (getSavedInstanceState() == null && getIntent() != null) { VrModuleProvider.getDelegate().onNewIntentWithNative(this, getIntent()); } - VrModuleProvider.getDelegate().onNativeLibraryAvailable(); super.finishNativeInitialization(); ViewGroup coordinator = findViewById(R.id.coordinator);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java index 7da3361f..1e7a1c2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -148,7 +148,6 @@ // Alphabetical: public static final String ADJUST_WEBAPK_INSTALLATION_SPACE = "AdjustWebApkInstallationSpace"; - public static final String ALLOW_READER_FOR_ACCESSIBILITY = "AllowReaderForAccessibility"; public static final String ANDROID_PAY_INTEGRATION_V1 = "AndroidPayIntegrationV1"; public static final String ANDROID_PAY_INTEGRATION_V2 = "AndroidPayIntegrationV2"; public static final String ANDROID_PAYMENT_APPS = "AndroidPaymentApps";
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java index 4a3fba62..4ed78b96 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java
@@ -195,6 +195,17 @@ public static final String FORCE_TRUSTED_WEB_ACTIVITY_DISCLOSURE = "force-trusted-web-activity-disclosure"; + /** + * Allows first-party apps to launch incognito custom tabs. + */ + public static final String ENABLE_INCOGNITO_CUSTOM_TABS = "enable-incognito-custom-tabs"; + + /** + * Allows third-party apps to launch incognito custom tabs. + */ + public static final String ALLOW_INCOGNITO_CUSTOM_TABS_FROM_THIRD_PARTY = + "allow-incognito-custom-tabs-from-third-party"; + // Prevent instantiation. private ChromeSwitches() {} }
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 7c35b91..50aee3c7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -14,7 +14,6 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; import android.content.pm.ShortcutManager; import android.graphics.Color; import android.os.Build; @@ -83,7 +82,10 @@ import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.fullscreen.ComposedBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; +import org.chromium.chrome.browser.incognito.IncognitoTabHost; +import org.chromium.chrome.browser.incognito.IncognitoTabHostRegistry; import org.chromium.chrome.browser.incognito.IncognitoTabSnapshotController; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.infobar.DataReductionPromoInfoBar; import org.chromium.chrome.browser.locale.LocaleManager; import org.chromium.chrome.browser.metrics.ActivityStopMetrics; @@ -152,10 +154,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; -import java.util.HashSet; import java.util.List; import java.util.Locale; -import java.util.Set; import java.util.concurrent.TimeUnit; /** @@ -284,6 +284,28 @@ // Time at which an intent was received and handled. private long mIntentHandlingTimeMs; + private final IncognitoTabHost mIncognitoTabHost = new IncognitoTabHost() { + + @Override + public boolean hasIncognitoTabs() { + return getTabModelSelector().getModel(true).getCount() > 0; + } + + @Override + public void closeAllIncognitoTabs() { + if (isActivityDestroyed()) return; + + // If the tabbed activity has not yet initialized, then finish the activity to avoid + // timing issues with clearing the incognito tab state in the background. + if (!areTabModelsInitialized() || !didFinishNativeInitialization()) { + finish(); + return; + } + + getTabModelSelector().getModel(true).closeAllTabs(false, false); + } + }; + private class TabbedAssistStatusHandler extends AssistStatusHandler { public TabbedAssistStatusHandler(Activity activity) { super(activity); @@ -563,7 +585,7 @@ // Check for incognito tabs to handle the case where Chrome was swiped away in the // background. - if (TabWindowManager.getInstance().canDestroyIncognitoProfile()) { + if (!IncognitoUtils.doIncognitoTabsExist()) { IncognitoNotificationManager.dismissIncognitoNotification(); } @@ -613,63 +635,11 @@ this, mTabModelSelectorImpl.getCurrentModel().isIncognito()); } - /** - * Determine whether the incognito profile needs to be destroyed as part of startup. This is - * only needed on L+ when it is possible to swipe away tasks from Android recents without - * killing the process. When this occurs, the normal incognito profile shutdown does not - * happen, which can leave behind incognito cookies from an existing session. - */ - @SuppressLint("NewApi") - private boolean shouldDestroyIncognitoProfile() { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return false; - - Context context = ContextUtils.getApplicationContext(); - ActivityManager manager = - (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); - PackageManager pm = context.getPackageManager(); - - Set<Integer> tabbedModeTaskIds = new HashSet<>(); - for (AppTask task : manager.getAppTasks()) { - RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); - if (info == null) continue; - String className = DocumentUtils.getTaskClassName(task, pm); - - if (isTabbedModeClassName(className)) { - tabbedModeTaskIds.add(info.id); - } - } - - if (tabbedModeTaskIds.size() == 0) { - return Profile.getLastUsedProfile().hasOffTheRecordProfile(); - } - - List<WeakReference<Activity>> activities = ApplicationStatus.getRunningActivities(); - for (int i = 0; i < activities.size(); i++) { - Activity activity = activities.get(i).get(); - if (activity == null) continue; - tabbedModeTaskIds.remove(activity.getTaskId()); - } - - // If all tabbed mode tasks listed in Android recents are alive, check to see if - // any have incognito tabs exist. If all are alive and no tabs exist, we should ensure that - // we delete the incognito profile if one is around still. - if (tabbedModeTaskIds.size() == 0) { - return TabWindowManager.getInstance().canDestroyIncognitoProfile() - && Profile.getLastUsedProfile().hasOffTheRecordProfile(); - } - - // In this case, we have tabbed mode activities listed in recents that do not have an - // active running activity associated with them. We can not accurately get an incognito - // tab count as we do not know if any incognito tabs are associated with the yet unrestored - // tabbed mode. Thus we do not proactivitely destroy the incognito profile. - return false; - } - @Override public void onResumeWithNative() { super.onResumeWithNative(); - if (shouldDestroyIncognitoProfile()) { + if (IncognitoUtils.shouldDestroyIncognitoProfileOnStartup()) { Profile.getLastUsedProfile().getOffTheRecordProfile().destroyWhenAppropriate(); } else { CookiesFetcher.restoreCookies(); @@ -1427,6 +1397,8 @@ && OmahaBase.isProbablyFreshInstall(this)) { getIntent().setData(null); } + + IncognitoTabHostRegistry.getInstance().register(mIncognitoTabHost); } @Override @@ -2036,6 +2008,7 @@ if (mNavigationBarColorController != null) mNavigationBarColorController.destroy(); + IncognitoTabHostRegistry.getInstance().unregister(mIncognitoTabHost); super.onDestroyInternal(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java index 26ea2ac..c97632e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
@@ -51,13 +51,13 @@ import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.common.ContentUrlConstants; import org.chromium.content_public.common.Referrer; +import org.chromium.net.HttpUtil; import org.chromium.ui.base.PageTransition; import org.chromium.webapk.lib.common.WebApkConstants; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -737,13 +737,14 @@ Bundle bundleExtraHeaders = IntentUtils.safeGetBundleExtra(intent, Browser.EXTRA_HEADERS); if (bundleExtraHeaders == null) return null; StringBuilder extraHeaders = new StringBuilder(); - Iterator<String> keys = bundleExtraHeaders.keySet().iterator(); - while (keys.hasNext()) { - String key = keys.next(); + for (String key : bundleExtraHeaders.keySet()) { String value = bundleExtraHeaders.getString(key); - if ("referer".equals(key.toLowerCase(Locale.US))) continue; + // Strip the custom header that can only be added by ourselves. if ("x-chrome-intent-type".equals(key.toLowerCase(Locale.US))) continue; + + if (!HttpUtil.isAllowedHeader(key, value)) continue; + if (extraHeaders.length() != 0) extraHeaders.append("\n"); extraHeaders.append(key); extraHeaders.append(": "); @@ -927,7 +928,10 @@ /** * @param intent An Intent to be checked. * @return Whether an intent originates from Chrome or a first-party app. + * + * @deprecated This method is not reliable, see https://crbug.com/832124 */ + @Deprecated public static boolean isIntentChromeOrFirstParty(Intent intent) { if (intent == null) return false;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java index cb3876c..8da1388 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
@@ -17,8 +17,6 @@ import android.os.StrictMode; import android.support.annotation.IntDef; import android.support.customtabs.CustomTabsIntent; -import android.support.customtabs.CustomTabsSessionToken; -import android.support.customtabs.TrustedWebUtils; import org.chromium.base.ApplicationStatus; import org.chromium.base.CommandLine; @@ -29,7 +27,6 @@ import org.chromium.chrome.browser.browserservices.BrowserSessionContentUtils; import org.chromium.chrome.browser.customtabs.CustomTabActivity; import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; -import org.chromium.chrome.browser.customtabs.CustomTabsConnection; import org.chromium.chrome.browser.customtabs.SeparateTaskCustomTabActivity; import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; import org.chromium.chrome.browser.instantapps.InstantAppsHandler; @@ -45,8 +42,6 @@ import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.chrome.browser.vr.VrModuleProvider; import org.chromium.chrome.browser.webapps.ActivityAssigner; -import org.chromium.chrome.browser.webapps.WebappActivity; -import org.chromium.chrome.browser.webapps.WebappInfo; import org.chromium.chrome.browser.webapps.WebappLauncherActivity; import org.chromium.ui.widget.Toast; @@ -210,11 +205,7 @@ // Check if we should launch a Custom Tab. if (mIsCustomTabIntent) { - if (!mIntent.getBooleanExtra( - TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, false) - || !launchTrustedWebActivity()) { launchCustomTabActivity(); - } return Action.FINISH_ACTIVITY; } @@ -360,27 +351,6 @@ } } - private boolean launchTrustedWebActivity() { - CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(mIntent); - if (!CustomTabsConnection.getInstance().canSessionLaunchInTrustedWebActivity( - session, Uri.parse(mIntent.getDataString()))) { - return false; - } - - // TODO(yusufo): WebappInfo houses a lot of logic around preparing/easing out the initial - // launch via extras for icons, splashscreens, screen orientation etc. We need a way to - // plumb that information to Trusted Web Activities. - WebappInfo info = WebappInfo.create(mIntent, session); - if (info == null) return false; - - WebappActivity.addWebappInfo(info.id(), info); - Intent launchIntent = WebappLauncherActivity.createWebappLaunchIntent(info, false); - launchIntent.putExtras(mIntent.getExtras()); - - mActivity.startActivity(launchIntent); - return true; - } - /** * Handles launching a {@link ChromeTabbedActivity}. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/BrowserSessionDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/BrowserSessionDataProvider.java index 0951c1c..e118e76 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/BrowserSessionDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/BrowserSessionDataProvider.java
@@ -10,8 +10,11 @@ import android.os.Bundle; import android.support.customtabs.CustomTabsIntent; import android.support.customtabs.CustomTabsSessionToken; +import android.text.TextUtils; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.customtabs.CustomTabsConnection; +import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; import org.chromium.chrome.browser.util.IntentUtils; /** @@ -36,6 +39,7 @@ private final CustomTabsSessionToken mSession; private final boolean mIsTrustedIntent; + private final boolean mIsVerifiedFirstPartyIntent; private final Intent mKeepAliveServiceIntent; private Bundle mAnimationBundle; @@ -47,6 +51,11 @@ mSession = CustomTabsSessionToken.getSessionTokenFromIntent(intent); mIsTrustedIntent = IntentHandler.isIntentChromeOrFirstParty(intent); + String packageNameFromSession = + CustomTabsConnection.getInstance().getClientPackageNameForSession(getSession()); + mIsVerifiedFirstPartyIntent = !TextUtils.isEmpty(packageNameFromSession) && + ExternalAuthUtils.getInstance().isGoogleSigned(packageNameFromSession); + mAnimationBundle = IntentUtils.safeGetBundleExtra( intent, CustomTabsIntent.EXTRA_EXIT_ANIMATION_BUNDLE); @@ -104,8 +113,20 @@ /** * Checks whether or not the Intent is from Chrome or other trusted first party. + * + * @deprecated This method is not reliable, see https://crbug.com/832124 */ + @Deprecated public boolean isTrustedIntent() { return mIsTrustedIntent; } + + /** + * Checks whether or not the Intent was received from first party app by analyzing + * the corresponding session. + * If the intent was launched without a session, returns false regardless of source of intent. + */ + public boolean isVerifiedFirstPartyIntent() { + return mIsVerifiedFirstPartyIntent; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java new file mode 100644 index 0000000..5d7f38b1 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java
@@ -0,0 +1,83 @@ +// Copyright 2018 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.browserservices; + +import android.content.res.Resources; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.preferences.ChromePreferenceManager; +import org.chromium.chrome.browser.snackbar.Snackbar; +import org.chromium.chrome.browser.snackbar.SnackbarManager; + +/** + * Shows the Trusted Web Activity disclosure when appropriate and records its acceptance. + * + * Lifecycle: There should be a 1-1 relationship between this class and + * {@link TrustedWebActivityUi}. + * Thread safety: All methods on this class should be called on the UI thread. + */ +/* package */ class TrustedWebActivityDisclosure { + private final Resources mResources; + + private boolean mSnackbarShowing; + + /** + * A {@link SnackbarManager.SnackbarController} that records the users acceptance of the + * "Running in Chrome" disclosure. + * + * It is also used as a key to for our snackbar so we can dismiss it when the user navigates + * to a page where they don't need to show the disclosure. + */ + private final SnackbarManager.SnackbarController mSnackbarController = + new SnackbarManager.SnackbarController() { + /** + * To be called when the user accepts the Running in Chrome disclosure. + * @param actionData The package name of the client, as a String. + */ + @Override + public void onAction(Object actionData) { + ChromePreferenceManager.getInstance() + .setUserAcceptedTwaDisclosureForPackage((String) actionData); + } + }; + + /* package */ TrustedWebActivityDisclosure(Resources resources) { + mResources = resources; + } + + /** Dismisses the Snackbar if it is showing. */ + /* package */ void dismissSnackbarIfNeeded(SnackbarManager snackbarManager) { + if (!mSnackbarShowing) return; + + snackbarManager.dismissSnackbars(mSnackbarController); + mSnackbarShowing = false; + } + + /** Shows the Snackbar if it is not already showing and hasn't been accepted. */ + /* package */ void showSnackbarIfNeeded(SnackbarManager snackbarManager, String packageName) { + if (mSnackbarShowing) return; + if (wasSnackbarDismissed(packageName)) return; + + snackbarManager.showSnackbar(makeRunningInChromeInfobar(packageName)); + mSnackbarShowing = true; + } + + /** Has a Snackbar been dismissed for this client package before? */ + private static boolean wasSnackbarDismissed(String packageName) { + return ChromePreferenceManager.getInstance() + .hasUserAcceptedTwaDisclosureForPackage(packageName); + } + + private Snackbar makeRunningInChromeInfobar(String packageName) { + String title = mResources.getString(R.string.twa_running_in_chrome); + int type = Snackbar.TYPE_PERSISTENT; + int code = Snackbar.UMA_TWA_PRIVACY_DISCLOSURE; + + String action = mResources.getString(R.string.ok_got_it); + return Snackbar.make(title, mSnackbarController, type, code) + .setAction(action, packageName) + .setSingleLine(false); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java index 07dd9db..afc0e6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java
@@ -4,15 +4,52 @@ package org.chromium.chrome.browser.browserservices; +import android.content.res.Resources; +import android.support.customtabs.CustomTabsService; + import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate; +import org.chromium.chrome.browser.snackbar.SnackbarManager; import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate; +import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabObserver; /** * Class to handle the state and logic for CustomTabActivity to do with Trusted Web Activities. + * + * Lifecycle: There should be a 1-1 relationship between this class and + * {@link org.chromium.chrome.browser.customtabs.CustomTabActivity}. + * Thread safety: All methods on this class should be called on the UI thread. */ public class TrustedWebActivityUi { - private boolean mInTrustedWebActivity; + private final TrustedWebActivityUiDelegate mDelegate; + private final TrustedWebActivityDisclosure mDisclosure; + + private boolean mInTrustedWebActivity = true; + + /** + * A delegate for embedders to implement to inject information into this class. The reason for + * using this instead of passing these dependencies into the constructor is because they may not + * be available at construction. + */ + public interface TrustedWebActivityUiDelegate { + /** + * Provides a {@link BrowserStateBrowserControlsVisibilityDelegate} that is used to + * temporarily force showing the browser controls when we leave a trusted origin. + */ + BrowserStateBrowserControlsVisibilityDelegate + getBrowserStateBrowserControlsVisibilityDelegate(); + + /** + * Provides the package name of the client for verification. + */ + String getClientPackageName(); + + /** + * Gives the SnackbarManager to use to display the disclosure. + */ + SnackbarManager getSnackbarManager(); + } /** * A {@link BrowserControlsVisibilityDelegate} that disallows showing the Browser Controls when @@ -31,6 +68,32 @@ } }; + /** A {@link TabObserver} that checks whether we are on a verified Origin on page navigation. */ + private final TabObserver mVerifyOnPageLoadObserver = new EmptyTabObserver() { + @Override + public void onDidFinishNavigation(Tab tab, String url, boolean isInMainFrame, + boolean isErrorPage, boolean hasCommitted, boolean isSameDocument, + boolean isFragmentNavigation, Integer pageTransition, int errorCode, + int httpStatusCode) { + if (!hasCommitted || !isInMainFrame) return; + + String packageName = mDelegate.getClientPackageName(); + assert packageName != null; + + // This doesn't perform a network request or attempt new verification - it checks to + // see if a verification already exists for the given inputs. + setTrustedWebActivityMode(OriginVerifier.isValidOrigin(packageName, new Origin(url), + CustomTabsService.RELATION_HANDLE_ALL_URLS), tab); + } + }; + + + /** Creates a TrustedWebActivityUi, providing a delegate from the embedder. */ + public TrustedWebActivityUi(TrustedWebActivityUiDelegate delegate, Resources resources) { + mDelegate = delegate; + mDisclosure = new TrustedWebActivityDisclosure(resources); + } + /** * Gets a {@link BrowserControlsVisibilityDelegate} that will hide/show the Custom Tab toolbar * on verification/leaving the verified origin. @@ -40,16 +103,44 @@ } /** + * Gets a {@link TabObserver} that watches for navigations and sets whether we are in a Trusted + * Web Activity accordingly. + */ + public TabObserver getTabObserver() { + return mVerifyOnPageLoadObserver; + } + + /** + * Shows the disclosure Snackbar if needed on the first Tab. Subsequent navigations will update + * the disclosure state automatically. + */ + public void initialShowSnackbarIfNeeded() { + assert mDelegate.getSnackbarManager() != null; + assert mDelegate.getClientPackageName() != null; + + mDisclosure.showSnackbarIfNeeded(mDelegate.getSnackbarManager(), + mDelegate.getClientPackageName()); + } + + /** * Updates the UI appropriately for whether or not Trusted Web Activity mode is enabled. */ - public void setTrustedWebActivityMode(boolean enabled, Tab tab, - BrowserStateBrowserControlsVisibilityDelegate delegate) { + private void setTrustedWebActivityMode(boolean enabled, Tab tab) { + if (mInTrustedWebActivity == enabled) return; + mInTrustedWebActivity = enabled; - // Force showing the controls for a bit when leaving Trusted Web Activity mode. - if (!enabled) delegate.showControlsTransient(); + if (enabled) { + mDisclosure.showSnackbarIfNeeded(mDelegate.getSnackbarManager(), + mDelegate.getClientPackageName()); + } else { + // Force showing the controls for a bit when leaving Trusted Web Activity mode. + mDelegate.getBrowserStateBrowserControlsVisibilityDelegate().showControlsTransient(); + mDisclosure.dismissSnackbarIfNeeded(mDelegate.getSnackbarManager()); + } // Reflect the browser controls update in the Tab. tab.updateFullscreenEnabledState(); } + }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactDetails.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactDetails.java new file mode 100644 index 0000000..94dcbda --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactDetails.java
@@ -0,0 +1,106 @@ +// Copyright 2018 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.contacts_picker; + +import android.support.annotation.Nullable; + +import java.util.Arrays; +import java.util.List; + +/** + * A class to keep track of the metadata associated with a contact. + */ +public class ContactDetails implements Comparable<ContactDetails> { + // The unique id for the contact. + private String mId; + + // The display name for this contact. + private String mDisplayName; + + // The list of emails registered for this contact. + private List<String> mEmails; + + /** + * The ContactDetails constructor. + * @param id The unique identifier of this contact. + * @param displayName The display name of this contact. + * @param emails The emails registered for this contact. + */ + public ContactDetails(String id, String displayName, List<String> emails) { + mDisplayName = displayName; + mEmails = emails; + mId = id; + } + + /** + * Accessor for the display name. + * @return The full display name. + */ + public String getDisplayName() { + return mDisplayName; + } + + /** + * Accessor for the abbreviated display name (first letter of first name and first letter of + * last name). + * @return The display name, abbreviated to two characters. + */ + public String getDisplayNameAbbreviation() { + // Display the two letter abbreviation of the display name. + String displayChars = ""; + if (mDisplayName.length() > 0) { + displayChars += mDisplayName.charAt(0); + String[] parts = mDisplayName.split(" "); + if (parts.length > 1) { + displayChars += parts[parts.length - 1].charAt(0); + } + } + + return displayChars; + } + + /** + * Accessor for the list of emails (as strings separated by newline). + * @return A string containing all the emails registered for this contact. + */ + public String getEmailsAsString() { + int count = 0; + StringBuilder builder = new StringBuilder(); + for (String email : mEmails) { + if (count++ > 0) { + builder.append("\n"); + } + builder.append(email); + } + + return builder.toString(); + } + + /** + * A comparison function (results in a full name ascending sorting). + * @param other The other ContactDetails object to compare it with. + * @return 0, 1, or -1, depending on which is bigger. + */ + @Override + public int compareTo(ContactDetails other) { + return other.mDisplayName.compareTo(mDisplayName); + } + + @Override + public int hashCode() { + Object[] values = {mId, mDisplayName, mEmails}; + return Arrays.hashCode(values); + } + + @Override + public boolean equals(@Nullable Object object) { + if (object == null) return false; + if (object == this) return true; + if (!(object instanceof ContactDetails)) return false; + + ContactDetails otherInfo = (ContactDetails) object; + return mId.equals(otherInfo.mId); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java new file mode 100644 index 0000000..38f5a55 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java
@@ -0,0 +1,160 @@ +// Copyright 2018 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.contacts_picker; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.util.AttributeSet; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.widget.selection.SelectableItemView; +import org.chromium.chrome.browser.widget.selection.SelectionDelegate; + +import java.util.List; + +/** + * A container class for a view showing a contact in the Contacts Picker. + */ +public class ContactView extends SelectableItemView<ContactDetails> { + // Our context. + private Context mContext; + + // Our parent category. + private PickerCategoryView mCategoryView; + + // Our selection delegate. + private SelectionDelegate<ContactDetails> mSelectionDelegate; + + // The details of the contact shown. + private ContactDetails mContactDetails; + + // The image view containing the abbreviated letters of the name. + private ImageView mImage; + + // The control that signifies the contact has been selected. + private ImageView mSelectedView; + + // The display name of the contact. + public TextView mDisplayName; + + // The emails for the contact. + public TextView mEmails; + + /** + * Constructor for inflating from XML. + */ + public ContactView(Context context, AttributeSet attrs) { + super(context, attrs); + mContext = context; + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + + mImage = (ImageView) findViewById(R.id.image); + mDisplayName = (TextView) findViewById(R.id.name); + mEmails = (TextView) findViewById(R.id.email); + mSelectedView = (ImageView) findViewById(R.id.selected); + } + + @Override + public void onClick() { + // Clicks are disabled until initialize() has been called. + if (mContactDetails == null) return; + + // The SelectableItemView expects long press to be the selection event, but this class wants + // that to happen on click instead. + onLongClick(this); + } + + @Override + public void setChecked(boolean checked) { + super.setChecked(checked); + updateSelectionState(); + } + + @Override + public void onSelectionStateChange(List<ContactDetails> selectedItems) { + // If the user cancels the dialog before this object has initialized, the SelectionDelegate + // will try to notify us that all selections have been cleared. However, we don't need to + // process that message. + if (mContactDetails == null) return; + + // When SelectAll or Undo is used, the underlying UI must be updated + // to reflect the changes. + boolean selected = selectedItems.contains(mContactDetails); + boolean checked = super.isChecked(); + if (selected != checked) super.toggle(); + + updateSelectionState(); + } + + /** + * Sets the {@link PickerCategoryView} for this ContactView. + * @param categoryView The category view showing the images. Used to access + * common functionality and sizes and retrieve the {@link SelectionDelegate}. + */ + public void setCategoryView(PickerCategoryView categoryView) { + mCategoryView = categoryView; + mSelectionDelegate = mCategoryView.getSelectionDelegate(); + setSelectionDelegate(mSelectionDelegate); + } + + /** + * Completes the initialization of the ContactView. Must be called before the + * {@link ContactView} can respond to click events. + * @param contactDetails The details about the contact represented by this ContactView. + */ + public void initialize(ContactDetails contactDetails) { + resetTile(); + + mContactDetails = contactDetails; + setItem(contactDetails); + + String displayName = contactDetails.getDisplayName(); + mDisplayName.setText(displayName); + mEmails.setText(contactDetails.getEmailsAsString()); + Bitmap icon = mCategoryView.getIconGenerator().generateIconForText( + contactDetails.getDisplayNameAbbreviation()); + mImage.setImageBitmap(icon); + + updateSelectionState(); + } + + /** + * Resets the view to its starting state, which is necessary when the view is about to be + * re-used. + */ + private void resetTile() { + mImage.setImageBitmap(null); + mDisplayName.setText(""); + mEmails.setText(""); + mSelectedView.setVisibility(View.GONE); + } + + /** + * Updates the selection controls for this view. + */ + private void updateSelectionState() { + boolean checked = super.isChecked(); + + if (checked) { + Resources resources = mContext.getResources(); + setBackgroundColor(ApiCompatibilityUtils.getColor( + resources, R.color.selectable_list_item_highlight_color)); + } else { + setBackgroundColor(Color.TRANSPARENT); + } + + mSelectedView.setVisibility(checked ? View.VISIBLE : View.GONE); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialog.java index 7b50d25..72c252b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialog.java
@@ -17,6 +17,9 @@ * <input type=file accept=contacts > form element. */ public class ContactsPickerDialog extends AlertDialog { + // The category we're showing contacts for. + private PickerCategoryView mCategoryView; + /** * The ContactsPickerDialog constructor. * @param context The context to use. @@ -27,5 +30,10 @@ public ContactsPickerDialog(Context context, ContactsPickerListener listener, boolean allowMultiple, List<String> mimeTypes) { super(context, R.style.FullscreenWhite); + + // Initialize the main content view. + mCategoryView = new PickerCategoryView(context); + mCategoryView.initialize(this, listener, mimeTypes); + setView(mCategoryView); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerToolbar.java new file mode 100644 index 0000000..6b0ab21 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerToolbar.java
@@ -0,0 +1,60 @@ +// Copyright 2018 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.contacts_picker; + +import android.content.Context; +import android.graphics.Color; +import android.util.AttributeSet; +import android.widget.Button; +import android.widget.TextView; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.widget.selection.SelectableListToolbar; + +import java.util.List; + +/** + * Handles toolbar functionality for the {@ContactsPickerDialog}. + */ +public class ContactsPickerToolbar extends SelectableListToolbar<ContactDetails> { + public ContactsPickerToolbar(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + + showCloseButton(); + + TextView up = (TextView) mNumberRollView.findViewById(R.id.up); + TextView down = (TextView) mNumberRollView.findViewById(R.id.down); + // TODO(finnur): Change this to use pre-defined styles. + up.setTextColor(Color.BLACK); + down.setTextColor(Color.BLACK); + } + + /** + * Shows the Close or 'X' navigation button in the upper left corner. + */ + public void showCloseButton() { + setNavigationIcon(R.drawable.btn_close); + setNavigationContentDescription(R.string.close); + } + + @Override + protected void showSelectionView( + List<ContactDetails> selectedItems, boolean wasSelectionEnabled) { + switchToNumberRollView(selectedItems, wasSelectionEnabled); + } + + @Override + public void onSelectionStateChange(List<ContactDetails> selectedItems) { + super.onSelectionStateChange(selectedItems); + + Button done = (Button) findViewById(R.id.done); + done.setEnabled(selectedItems.size() > 0); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java new file mode 100644 index 0000000..c2e16a2 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java
@@ -0,0 +1,128 @@ +// Copyright 2018 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.contacts_picker; + +import android.database.Cursor; +import android.provider.ContactsContract; +import android.support.v7.widget.RecyclerView.Adapter; +import android.support.v7.widget.RecyclerView.ViewHolder; +import android.view.LayoutInflater; +import android.view.ViewGroup; + +import org.chromium.chrome.R; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +/** + * A data adapter for the Contacts Picker. + */ +public class PickerAdapter extends Adapter<ViewHolder> { + // The category view to use to show the contacts. + private PickerCategoryView mCategoryView; + + // A cursor containing the raw contacts data. + private Cursor mContactsCursor; + + /** + * Holds on to a {@link ContactView} that displays information about a contact. + */ + public class ContactViewHolder extends ViewHolder { + /** + * The ContactViewHolder. + * @param itemView The {@link ContactView} view for showing the contact details. + */ + public ContactViewHolder(ContactView itemView) { + super(itemView); + } + } + + private static final String[] PROJECTION = { + ContactsContract.Contacts._ID, ContactsContract.Contacts.LOOKUP_KEY, + ContactsContract.Contacts.DISPLAY_NAME_PRIMARY, + }; + + /** + * The PickerAdapter constructor. + * @param categoryView The category view to use to show the contacts. + */ + public PickerAdapter(PickerCategoryView categoryView) { + mCategoryView = categoryView; + mContactsCursor = mCategoryView.getActivity().getContentResolver().query( + ContactsContract.Contacts.CONTENT_URI, PROJECTION, null, null, + ContactsContract.Contacts.DISPLAY_NAME_PRIMARY + " ASC"); + } + + /** + * Fetches all known contacts and their emails. + * @return The contact list as a set. + */ + public Set<ContactDetails> getAllContacts() { + Set<ContactDetails> contacts = new HashSet<>(); + if (!mContactsCursor.moveToFirst()) return contacts; + do { + String id = mContactsCursor.getString( + mContactsCursor.getColumnIndex(ContactsContract.Contacts._ID)); + String name = mContactsCursor.getString( + mContactsCursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME_PRIMARY)); + contacts.add(new ContactDetails(id, name, getEmails())); + } while (mContactsCursor.moveToNext()); + + return contacts; + } + + // RecyclerView.Adapter: + + @Override + public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + ContactView itemView = (ContactView) LayoutInflater.from(parent.getContext()) + .inflate(R.layout.contact_view, parent, false); + itemView.setCategoryView(mCategoryView); + return new ContactViewHolder(itemView); + } + + @Override + public void onBindViewHolder(ViewHolder holder, int position) { + String id = ""; + String name = ""; + if (mContactsCursor.moveToPosition(position)) { + id = mContactsCursor.getString( + mContactsCursor.getColumnIndex(ContactsContract.Contacts._ID)); + name = mContactsCursor.getString( + mContactsCursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME_PRIMARY)); + } + + ((ContactView) holder.itemView).initialize(new ContactDetails(id, name, getEmails())); + } + + private Cursor getEmailCursor(String id) { + Cursor emailCursor = mCategoryView.getActivity().getContentResolver().query( + ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, + ContactsContract.CommonDataKinds.Email.CONTACT_ID + " = " + id, null, + ContactsContract.CommonDataKinds.Email.DATA + " ASC"); + return emailCursor; + } + + private ArrayList<String> getEmails() { + // Look up all associated emails for this contact. + // TODO(finnur): Investigate whether we can do this in one go with the original cursor... + String id = mContactsCursor.getString( + mContactsCursor.getColumnIndex(ContactsContract.Contacts._ID)); + Cursor emailCursor = getEmailCursor(id); + ArrayList<String> emails = new ArrayList<String>(); + while (emailCursor.moveToNext()) { + emails.add(emailCursor.getString( + emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA))); + } + emailCursor.close(); + return emails; + } + + @Override + public int getItemCount() { + return mContactsCursor.getCount(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerCategoryView.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerCategoryView.java new file mode 100644 index 0000000..5cb963b --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerCategoryView.java
@@ -0,0 +1,183 @@ +// Copyright 2018 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.contacts_picker; + +import android.app.Activity; +import android.content.Context; +import android.content.DialogInterface; +import android.content.res.Resources; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.RelativeLayout; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.widget.RoundedIconGenerator; +import org.chromium.chrome.browser.widget.selection.SelectableListLayout; +import org.chromium.chrome.browser.widget.selection.SelectionDelegate; +import org.chromium.ui.ContactsPickerListener; +import org.chromium.ui.UiUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * A class for keeping track of common data associated with showing contact details in + * the contacts picker, for example the RecyclerView. + */ +public class PickerCategoryView extends RelativeLayout implements View.OnClickListener { + // Constants for the RoundedIconGenerator. + private static final int ICON_SIZE_DP = 32; + private static final int ICON_CORNER_RADIUS_DP = 20; + private static final int ICON_TEXT_SIZE_DP = 12; + + // The dialog that owns us. + private ContactsPickerDialog mDialog; + + // The view containing the RecyclerView and the toolbar, etc. + private SelectableListLayout<ContactDetails> mSelectableListLayout; + + // Our activity. + private Activity mActivity; + + // The callback to notify the listener of decisions reached in the picker. + private ContactsPickerListener mListener; + + // The toolbar located at the top of the dialog. + private ContactsPickerToolbar mToolbar; + + // The RecyclerView showing the images. + private RecyclerView mRecyclerView; + + // The {@link PickerAdapter} for the RecyclerView. + private PickerAdapter mPickerAdapter; + + // The layout manager for the RecyclerView. + private LinearLayoutManager mLayoutManager; + + // A helper class to draw the icon for each contact. + private RoundedIconGenerator mIconGenerator; + + // The {@link SelectionDelegate} keeping track of which contacts are selected. + private SelectionDelegate<ContactDetails> mSelectionDelegate; + + // The Done text button that confirms the selection choice. + private Button mDoneButton; + + // The MIME types requested. + private List<String> mMimeTypes; + + @SuppressWarnings("unchecked") // mSelectableListLayout + public PickerCategoryView(Context context) { + super(context); + mActivity = (Activity) context; + + mSelectionDelegate = new SelectionDelegate<ContactDetails>(); + + Resources resources = getActivity().getResources(); + int iconColor = + ApiCompatibilityUtils.getColor(resources, R.color.default_favicon_background_color); + mIconGenerator = new RoundedIconGenerator(resources, ICON_SIZE_DP, ICON_SIZE_DP, + ICON_CORNER_RADIUS_DP, iconColor, ICON_TEXT_SIZE_DP); + + View root = LayoutInflater.from(context).inflate(R.layout.contacts_picker_dialog, this); + mSelectableListLayout = + (SelectableListLayout<ContactDetails>) root.findViewById(R.id.selectable_list); + + mPickerAdapter = new PickerAdapter(this); + mRecyclerView = mSelectableListLayout.initializeRecyclerView(mPickerAdapter); + mToolbar = (ContactsPickerToolbar) mSelectableListLayout.initializeToolbar( + R.layout.contacts_picker_toolbar, mSelectionDelegate, + R.string.contacts_picker_select_contacts, null, 0, 0, R.color.modern_primary_color, + null, false, false); + mToolbar.setNavigationOnClickListener(this); + + mDoneButton = (Button) mToolbar.findViewById(R.id.done); + mDoneButton.setOnClickListener(this); + + mLayoutManager = new LinearLayoutManager(mActivity); + mRecyclerView.setHasFixedSize(true); + mRecyclerView.setLayoutManager(mLayoutManager); + } + + /** + * Initializes the PickerCategoryView object. + * @param dialog The dialog showing us. + * @param listener The listener who should be notified of actions. + * @param mimeTypes A list of mime types to show in the dialog. + */ + public void initialize( + ContactsPickerDialog dialog, ContactsPickerListener listener, List<String> mimeTypes) { + mDialog = dialog; + mListener = listener; + mMimeTypes = new ArrayList<>(mimeTypes); + + mDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + executeAction(ContactsPickerListener.ContactsPickerAction.CANCEL, null); + } + }); + + mPickerAdapter.notifyDataSetChanged(); + } + + // OnClickListener: + + @Override + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.done) { + notifyContactsSelected(); + } else { + executeAction(ContactsPickerListener.ContactsPickerAction.CANCEL, null); + } + } + + // Simple accessors: + + public Activity getActivity() { + return mActivity; + } + + public SelectionDelegate<ContactDetails> getSelectionDelegate() { + return mSelectionDelegate; + } + + public RoundedIconGenerator getIconGenerator() { + return mIconGenerator; + } + + /** + * Notifies any listeners that one or more contacts have been selected. + */ + private void notifyContactsSelected() { + List<ContactDetails> selectedFiles = mSelectionDelegate.getSelectedItems(); + Collections.sort(selectedFiles); + String[] contacts = new String[selectedFiles.size()]; + int i = 0; + for (ContactDetails contactDetails : selectedFiles) { + contacts[i++] = contactDetails.getDisplayName(); + } + + executeAction(ContactsPickerListener.ContactsPickerAction.CONTACTS_SELECTED, contacts); + } + + /** + * Report back what the user selected in the dialog, report UMA and clean up. + * @param action The action taken. + * @param contacts The contacts that were selected (if any). + */ + private void executeAction( + ContactsPickerListener.ContactsPickerAction action, String[] contacts) { + mListener.onContactsPickerUserAction(action, contacts); + mDialog.dismiss(); + UiUtils.onContactsPickerDismissed(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java index c8f5e75..28005d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
@@ -26,8 +26,6 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordHistogram; -import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.ChromeVersionInfo; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.Origin; import org.chromium.chrome.browser.browserservices.OriginVerifier; @@ -471,42 +469,6 @@ } /** - * Whether we can verify that the app has declared a - * {@link CustomTabsService#RELATION_HANDLE_ALL_URLS} with the given origin. This is the initial - * requirement for launch. We also need the web->app verification which will be checked after - * the Activity has launched async. - * @param session The session attempting to launch the TrustedWebActivity. - * @param url The url that will load on the TrustedWebActivity. - * @return Whether the client for the session passes the initial requirements to launch a - * TrustedWebActivity in the given origin. - */ - public synchronized boolean canSessionLaunchInTrustedWebActivity( - CustomTabsSessionToken session, Uri url) { - if (!ChromeFeatureList.isEnabled(ChromeFeatureList.TRUSTED_WEB_ACTIVITY)) return false; - if (ChromeVersionInfo.isBetaBuild() || ChromeVersionInfo.isStableBuild()) return false; - - SessionParams params = mSessionParams.get(session); - if (params == null) return false; - String packageName = params.getPackageName(); - if (TextUtils.isEmpty(packageName)) return false; - Origin origin = new Origin(url); - boolean isAppAssociatedWithOrigin = params.mLinkedOrigins.contains(origin); - if (!isAppAssociatedWithOrigin) return false; - - // Split path from the given Uri to get only the origin before web->native verification. - if (OriginVerifier.isValidOrigin( - packageName, origin, CustomTabsService.RELATION_HANDLE_ALL_URLS)) { - return true; - } - // This is an optimization to start the verification early. The launching Activity should - // run and listen on this verification as well. - params.originVerifier = - new OriginVerifier(null, packageName, CustomTabsService.RELATION_HANDLE_ALL_URLS); - params.originVerifier.start(origin); - return true; - } - - /** * @return The postMessage origin for the given session. */ @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java index 4bc4d43..01b1382 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -32,10 +32,12 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.Window; +import android.view.WindowManager; import android.widget.RemoteViews; import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; +import org.chromium.base.CommandLine; import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; @@ -46,6 +48,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.IntentHandler.ExternalAppId; import org.chromium.chrome.browser.KeyboardShortcuts; @@ -67,12 +70,17 @@ import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; +import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.fullscreen.ComposedBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.gsa.GSAState; +import org.chromium.chrome.browser.incognito.IncognitoTabHost; +import org.chromium.chrome.browser.incognito.IncognitoTabHostRegistry; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.page_info.PageInfoController; import org.chromium.chrome.browser.payments.ServiceWorkerPaymentAppBridge; import org.chromium.chrome.browser.rappor.RapporServiceBridge; +import org.chromium.chrome.browser.snackbar.SnackbarManager; +import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabDelegateFactory; @@ -158,7 +166,7 @@ /** Adds and removes observers from tabs when needed. */ private final TabObserverRegistrar mTabObserverRegistrar = new TabObserverRegistrar(); - private final TrustedWebActivityUi mTrustedWebActivityUi = new TrustedWebActivityUi(); + private @Nullable TrustedWebActivityUi mTrustedWebActivityUi; private String mSpeculatedUrl; @@ -195,6 +203,9 @@ } }; + @Nullable + private IncognitoTabHost mIncognitoTabHost; + @Override protected Drawable getBackgroundDrawable() { int initialBackgroundColor = mIntentDataProvider.getInitialBackgroundColor(); @@ -240,6 +251,11 @@ mIntentDataProvider = new CustomTabIntentDataProvider(getIntent(), this); super.preInflationStartup(); + + if (mIntentDataProvider.isTrustedWebActivity()) { + mTrustedWebActivityUi = createTrustedWebActivityUi(); + } + mSession = mIntentDataProvider.getSession(); supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY); mSpeculatedUrl = mConnection.getSpeculatedUrl(mSession); @@ -253,6 +269,43 @@ IntentHandler.getTimestampFromIntent(getIntent())); mHasCreatedTabEarly = true; } + + if (mIntentDataProvider.isIncognito()) { + initializeIncognito(); + } + } + + private void initializeIncognito() { + mIncognitoTabHost = new IncognitoCustomTabHost(); + IncognitoTabHostRegistry.getInstance().register(mIncognitoTabHost); + + if (!CommandLine.getInstance().hasSwitch( + ChromeSwitches.ENABLE_INCOGNITO_SNAPSHOTS_IN_ANDROID_RECENTS)) { + // Disable taking screenshots and seeing snapshots in recents + getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); + } + } + + private TrustedWebActivityUi createTrustedWebActivityUi() { + return new TrustedWebActivityUi( + new TrustedWebActivityUi.TrustedWebActivityUiDelegate() { + @Override + public BrowserStateBrowserControlsVisibilityDelegate + getBrowserStateBrowserControlsVisibilityDelegate() { + return getFullscreenManager().getBrowserVisibilityDelegate(); + } + + @Override + public String getClientPackageName() { + return mConnection != null + ? mConnection.getClientPackageNameForSession(mSession) : null; + } + + @Override + public SnackbarManager getSnackbarManager() { + return CustomTabActivity.this.getSnackbarManager(); + } + }, getResources()); } /** @@ -426,12 +479,16 @@ } private CustomTabDelegateFactory createCustomTabDelegateFactory() { + BrowserControlsVisibilityDelegate delegate = + getFullscreenManager().getBrowserVisibilityDelegate(); + if (mTrustedWebActivityUi != null) { + delegate = new ComposedBrowserControlsVisibilityDelegate(delegate, + mTrustedWebActivityUi.getBrowserControlsVisibilityDelegate() + ); + } + return new CustomTabDelegateFactory(mIntentDataProvider.shouldEnableUrlBarHiding(), - mIntentDataProvider.isOpenedByChrome(), - new ComposedBrowserControlsVisibilityDelegate( - getFullscreenManager().getBrowserVisibilityDelegate(), - mTrustedWebActivityUi.getBrowserControlsVisibilityDelegate() - )); + mIntentDataProvider.isOpenedByChrome(), delegate); } @Override @@ -602,6 +659,10 @@ mAutofillAssistantUiController = new AssistantUiController(this); } + if (mTrustedWebActivityUi != null) { + mTrustedWebActivityUi.initialShowSnackbarIfNeeded(); + } + super.finishNativeInitialization(); } @@ -698,6 +759,9 @@ mTabObserverRegistrar.registerTabObserver(mTabObserver); mTabObserverRegistrar.registerTabObserver(mTabNavigationEventObserver); + if (mTrustedWebActivityUi != null) { + mTabObserverRegistrar.registerTabObserver(mTrustedWebActivityUi.getTabObserver()); + } mTabObserverRegistrar.registerPageLoadMetricsObserver( new PageLoadMetricsObserver(mConnection, mSession, tab)); mTabObserverRegistrar.registerPageLoadMetricsObserver( @@ -834,6 +898,9 @@ if (moduleComponentName != null) { mConnection.getModuleLoader(moduleComponentName).maybeUnloadModule(); } + if (mIncognitoTabHost != null) { + IncognitoTabHostRegistry.getInstance().unregister(mIncognitoTabHost); + } } @Override @@ -919,7 +986,8 @@ mIntentDataProvider.isOpenedByChrome(), mIntentDataProvider.shouldShowShareMenuItem(), mIntentDataProvider.shouldShowStarButton(), - mIntentDataProvider.shouldShowDownloadButton()); + mIntentDataProvider.shouldShowDownloadButton(), + mIntentDataProvider.isIncognito()); } @Override @@ -1221,7 +1289,9 @@ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(LaunchIntentDispatcher.EXTRA_IS_ALLOWED_TO_RETURN_TO_PARENT, false); - boolean willChromeHandleIntent = getIntentDataProvider().isOpenedByChrome(); + boolean willChromeHandleIntent = + getIntentDataProvider().isOpenedByChrome() || getIntentDataProvider().isIncognito(); + StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { willChromeHandleIntent |= ExternalNavigationDelegateImpl @@ -1381,4 +1451,21 @@ return publisherUrlPackage != null && publisherUrlPackage.equals(mConnection.getClientPackageNameForSession(mSession)); } + + private class IncognitoCustomTabHost implements IncognitoTabHost { + + public IncognitoCustomTabHost() { + assert mIntentDataProvider.isIncognito(); + } + + @Override + public boolean hasIncognitoTabs() { + return !isFinishing(); + } + + @Override + public void closeAllIncognitoTabs() { + finishAndClose(false); + } + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java index 598c5a5..3baf02481 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
@@ -8,6 +8,7 @@ import android.view.Menu; import android.view.MenuItem; +import org.chromium.base.ContextUtils; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; @@ -33,6 +34,7 @@ private final boolean mShowStar; private final boolean mShowDownload; private final boolean mIsOpenedByChrome; + private final boolean mIsIncognito; private final List<String> mMenuEntries; private final Map<MenuItem, Integer> mItemToIndexMap = new HashMap<MenuItem, Integer>(); @@ -44,7 +46,7 @@ */ public CustomTabAppMenuPropertiesDelegate(final ChromeActivity activity, @CustomTabsUiType final int uiType, List<String> menuEntries, boolean isOpenedByChrome, - boolean showShare, boolean showStar, boolean showDownload) { + boolean showShare, boolean showStar, boolean showDownload, boolean isIncognito) { super(activity); mUiType = uiType; mMenuEntries = menuEntries; @@ -52,6 +54,7 @@ mShowShare = showShare; mShowStar = showStar; mShowDownload = showDownload; + mIsIncognito = isIncognito; } @Override @@ -149,8 +152,12 @@ MenuItem openInChromeItem = menu.findItem(R.id.open_in_browser_id); if (openInChromeItemVisible) { - openInChromeItem.setTitle( - DefaultBrowserInfo.getTitleOpenInDefaultBrowser(mIsOpenedByChrome)); + String title = mIsIncognito ? + ContextUtils.getApplicationContext() + .getString(R.string.menu_open_in_incognito_chrome) : + DefaultBrowserInfo.getTitleOpenInDefaultBrowser(mIsOpenedByChrome); + + openInChromeItem.setTitle(title); } else { openInChromeItem.setVisible(false); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java index f269d251..1b2d447 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -18,16 +18,20 @@ import android.support.annotation.IntDef; import android.support.annotation.Nullable; import android.support.customtabs.CustomTabsIntent; +import android.support.customtabs.TrustedWebUtils; import android.text.TextUtils; import android.util.Pair; import android.view.View; import android.widget.RemoteViews; +import org.chromium.base.CommandLine; import org.chromium.base.Log; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeVersionInfo; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.browserservices.BrowserSessionDataProvider; @@ -131,8 +135,10 @@ private final int mInitialBackgroundColor; private final boolean mDisableStar; private final boolean mDisableDownload; + private final boolean mIsTrustedWebActivity; @Nullable private final ComponentName mModuleComponentName; + private final boolean mIsIncognito; private int mToolbarColor; private int mBottomBarColor; @@ -150,9 +156,7 @@ private PendingIntent.OnFinished mOnFinished; /** Whether this CustomTabActivity was explicitly started by another Chrome Activity. */ - private boolean mIsOpenedByChrome; - - private boolean mIsIncognito; + private final boolean mIsOpenedByChrome; /** * Add extras to customize menu items for opening payment request UI custom tab from Chrome. @@ -179,6 +183,15 @@ super(intent); if (intent == null) assert false; + mIsOpenedByChrome = IntentUtils.safeGetBooleanExtra( + intent, EXTRA_IS_OPENED_BY_CHROME, false); + + final int requestedUiType = + IntentUtils.safeGetIntExtra(intent, EXTRA_UI_TYPE, CustomTabsUiType.DEFAULT); + mUiType = verifiedUiType(requestedUiType); + + mIsIncognito = resolveIncognito(intent); + retrieveCustomButtons(intent, context); retrieveToolbarColor(intent, context); retrieveBottomBarColor(intent); @@ -215,15 +228,8 @@ } } - mIsOpenedByChrome = - IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_OPENED_BY_CHROME, false); - mIsIncognito = IntentUtils.safeGetBooleanExtra( - intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false); - - final int requestedUiType = - IntentUtils.safeGetIntExtra(intent, EXTRA_UI_TYPE, CustomTabsUiType.DEFAULT); - mUiType = verifiedUiType(requestedUiType); - + mIsTrustedWebActivity = IntentUtils.safeGetBooleanExtra( + intent, TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, false); mTitleVisibilityState = IntentUtils.safeGetIntExtra( intent, CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.NO_TITLE); mShowShareItem = IntentUtils.safeGetBooleanExtra(intent, @@ -255,6 +261,28 @@ } } + private boolean resolveIncognito(Intent intent) { + if (!IntentUtils.safeGetBooleanExtra( + intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false)) { + return false; + } + + boolean isPaymentRequest = isTrustedIntent() && isOpenedByChrome() && isForPaymentRequest(); + + if (!CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_INCOGNITO_CUSTOM_TABS)) { + // This switch picks either new or old behavior. + // The old behavior is to allow incognito custom tabs only for payment requests. + return isPaymentRequest; + } + + boolean isFromPermittedSource = isVerifiedFirstPartyIntent() || + CommandLine.getInstance().hasSwitch( + ChromeSwitches.ALLOW_INCOGNITO_CUSTOM_TABS_FROM_THIRD_PARTY); + + // The new behavior is to also allow incognito custom tabs in first-party apps. + return isPaymentRequest || isFromPermittedSource; + } + /** * Get the verified UI type, according to the intent extras, and whether the intent is trusted. * @param requestedUiType requested UI type in the intent, unqualified @@ -303,8 +331,12 @@ * Processes the color passed from the client app and updates {@link #mToolbarColor}. */ private void retrieveToolbarColor(Intent intent, Context context) { - int defaultColor = ColorUtils.getDefaultThemeColor( - context.getResources(), FeatureUtilities.isChromeModernDesignEnabled(), false); + int defaultColor = ColorUtils.getDefaultThemeColor(context.getResources(), + FeatureUtilities.isChromeModernDesignEnabled(), isIncognito()); + if (isIncognito()) { + mToolbarColor = defaultColor; + return; // Don't allow toolbar color customization for incognito tabs. + } int color = IntentUtils.safeGetIntExtra( intent, CustomTabsIntent.EXTRA_TOOLBAR_COLOR, defaultColor); mToolbarColor = removeTransparencyFromColor(color); @@ -314,6 +346,10 @@ * Must be called after calling {@link #retrieveToolbarColor(Intent, Context)}. */ private void retrieveBottomBarColor(Intent intent) { + if (isIncognito()) { + mBottomBarColor = mToolbarColor; + return; + } int defaultColor = mToolbarColor; int color = IntentUtils.safeGetIntExtra( intent, CustomTabsIntent.EXTRA_SECONDARY_TOOLBAR_COLOR, defaultColor); @@ -612,8 +648,22 @@ * @return Whether the custom Tab should be opened in incognito mode. */ boolean isIncognito() { - // Only open custom tab in incognito mode for payment request. - return isTrustedIntent() && mIsOpenedByChrome && isForPaymentRequest() && mIsIncognito; + return mIsIncognito; + } + + /** + * @return Whether the Custom Tab should attempt to display a Trusted Web Activity. + * Will return false if native is not initialized. + * + * Trusted Web Activities require CustomTabsClient#warmup to have been called, meaning that + * native will have been initialized when the client is trying to use a TWA. + */ + boolean isTrustedWebActivity() { + if (!ChromeFeatureList.isInitialized()) return false; + if (!ChromeFeatureList.isEnabled(ChromeFeatureList.TRUSTED_WEB_ACTIVITY)) return false; + if (ChromeVersionInfo.isBetaBuild() || ChromeVersionInfo.isStableBuild()) return false; + + return mIsTrustedWebActivity; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java index 518789e..0fa95234 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -730,14 +730,6 @@ return null; } - /** - * See {@link ClientManager#canSessionLaunchInTrustedWebActivity(CustomTabsSessionToken, Uri)} - */ - public boolean canSessionLaunchInTrustedWebActivity( - CustomTabsSessionToken session, Uri origin) { - return mClientManager.canSessionLaunchInTrustedWebActivity(session, origin); - } - public int postMessage(CustomTabsSessionToken session, String message, Bundle extras) { int result; if (!mWarmupHasBeenCalled.get()) result = CustomTabsService.RESULT_FAILURE_DISALLOWED;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java index 5ea21cfd..253fbe5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java
@@ -29,7 +29,6 @@ import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.document.DocumentUtils; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.tabmodel.TabWindowManager; import org.chromium.chrome.browser.tabmodel.TabbedModeTabPersistencePolicy; import org.chromium.content_public.browser.BrowserStartupController; @@ -63,7 +62,7 @@ @Override protected void onHandleIntent(Intent intent) { - closeIncognitoTabsInRunningTabbedActivities(); + ThreadUtils.runOnUiThreadBlocking(IncognitoUtils::closeAllIncognitoTabs); boolean clearedIncognito = deleteIncognitoStateFilesInDirectory( TabbedModeTabPersistencePolicy.getOrCreateTabbedModeStateDirectory()); @@ -72,7 +71,7 @@ if (!clearedIncognito) return; ThreadUtils.runOnUiThreadBlocking(() -> { - if (!TabWindowManager.getInstance().canDestroyIncognitoProfile()) { + if (IncognitoUtils.doIncognitoTabsExist()) { assert false : "Not all incognito tabs closed as expected"; return; } @@ -167,37 +166,6 @@ } /** - * Iterate across the running activities and for any running tabbed mode activities close their - * incognito tabs. - * - * @see TabWindowManager#getIndexForWindow(Activity) - */ - private void closeIncognitoTabsInRunningTabbedActivities() { - ThreadUtils.runOnUiThreadBlocking(() -> { - List<WeakReference<Activity>> runningActivities = - ApplicationStatus.getRunningActivities(); - for (int i = 0; i < runningActivities.size(); i++) { - Activity activity = runningActivities.get(i).get(); - if (activity == null) continue; - if (!(activity instanceof ChromeTabbedActivity)) continue; - - ChromeTabbedActivity tabbedActivity = (ChromeTabbedActivity) activity; - if (tabbedActivity.isActivityDestroyed()) continue; - - // If the tabbed activity has not yet initialized, then finish the activity to avoid - // timing issues with clearing the incognito tab state in the background. - if (!tabbedActivity.areTabModelsInitialized() - || !tabbedActivity.didFinishNativeInitialization()) { - tabbedActivity.finish(); - continue; - } - - tabbedActivity.getTabModelSelector().getModel(true).closeAllTabs(false, false); - } - }); - } - - /** * @return Whether deleting all the incognito files was successful. */ private boolean deleteIncognitoStateFilesInDirectory(File directory) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHost.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHost.java new file mode 100644 index 0000000..0812ea2 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHost.java
@@ -0,0 +1,17 @@ +// Copyright 2018 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.incognito; + +/** + * Implemented by entities that may host incognito tabs. + */ +public interface IncognitoTabHost { + + /** Whether has any incognito tabs at the moment. */ + boolean hasIncognitoTabs(); + + /** Close all incognito tabs. */ + void closeAllIncognitoTabs(); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHostRegistry.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHostRegistry.java new file mode 100644 index 0000000..8cbfa5c --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabHostRegistry.java
@@ -0,0 +1,41 @@ +// Copyright 2018 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.incognito; + +import java.util.ArrayList; +import java.util.List; + +/** + * Registry for implementations of {@link IncognitoTabHost}. + * Every host of incognito tabs must be registered here as long as it is alive, so that its + * incognito tabs are included in such operations as removing all incognito tabs. + */ +public class IncognitoTabHostRegistry { + + private static IncognitoTabHostRegistry sInstance; + + public static IncognitoTabHostRegistry getInstance() { + if (sInstance == null) { + sInstance = new IncognitoTabHostRegistry(); + } + return sInstance; + } + + private final List<IncognitoTabHost> mHosts = new ArrayList<>(); + + /** Register an IncognitoTabHost */ + public void register(IncognitoTabHost host) { + mHosts.add(host); + } + + /** Unregister an IncognitoTabHost */ + public void unregister(IncognitoTabHost host) { + mHosts.remove(host); + } + + List<IncognitoTabHost> getHosts() { + return mHosts; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoUtils.java new file mode 100644 index 0000000..ed7f2d57 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoUtils.java
@@ -0,0 +1,107 @@ +// Copyright 2018 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.incognito; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Build; + +import org.chromium.base.ApplicationStatus; +import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.document.DocumentUtils; +import org.chromium.chrome.browser.profiles.Profile; + +import java.lang.ref.WeakReference; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Utilities for working with incognito tabs spread across multiple activities. + */ +public class IncognitoUtils { + + private IncognitoUtils() {} + + /** + * Determine whether the incognito profile needs to be destroyed as part of startup. This is + * only needed on L+ when it is possible to swipe away tasks from Android recents without + * killing the process. When this occurs, the normal incognito profile shutdown does not + * happen, which can leave behind incognito cookies from an existing session. + */ + @SuppressLint("NewApi") + public static boolean shouldDestroyIncognitoProfileOnStartup() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP + || !Profile.getLastUsedProfile().hasOffTheRecordProfile()) { + return false; + } + + Context context = ContextUtils.getApplicationContext(); + ActivityManager manager = + (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + PackageManager pm = context.getPackageManager(); + + Set<Integer> tabbedModeTaskIds = new HashSet<>(); + for (ActivityManager.AppTask task : manager.getAppTasks()) { + ActivityManager.RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); + if (info == null) continue; + String className = DocumentUtils.getTaskClassName(task, pm); + + if (ChromeTabbedActivity.isTabbedModeClassName(className)) { + tabbedModeTaskIds.add(info.id); + } + } + + if (tabbedModeTaskIds.size() == 0) { + return true; + } + + List<WeakReference<Activity>> activities = ApplicationStatus.getRunningActivities(); + for (int i = 0; i < activities.size(); i++) { + Activity activity = activities.get(i).get(); + if (activity == null) continue; + tabbedModeTaskIds.remove(activity.getTaskId()); + } + + // If all tabbed mode tasks listed in Android recents are alive, check to see if + // any have incognito tabs exist. If all are alive and no tabs exist, we should ensure that + // we delete the incognito profile if one is around still. + if (tabbedModeTaskIds.size() == 0) { + return !doIncognitoTabsExist(); + } + + // In this case, we have tabbed mode activities listed in recents that do not have an + // active running activity associated with them. We can not accurately get an incognito + // tab count as we do not know if any incognito tabs are associated with the yet unrestored + // tabbed mode. Thus we do not proactively destroy the incognito profile. + return false; + } + + + /** + * Determine whether there are any incognito tabs. + */ + public static boolean doIncognitoTabsExist() { + for (IncognitoTabHost host : IncognitoTabHostRegistry.getInstance().getHosts()) { + if (host.hasIncognitoTabs()) { + return true; + } + } + return false; + } + + /** + * Closes all incognito tabs. + */ + public static void closeAllIncognitoTabs() { + for (IncognitoTabHost host : IncognitoTabHostRegistry.getInstance().getHosts()) { + host.closeAllIncognitoTabs(); + } + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java index e4a89cf..3a70b8c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ReaderModeInfoBar.java
@@ -15,7 +15,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason; import org.chromium.chrome.browser.dom_distiller.ReaderModeManager; @@ -61,11 +60,7 @@ @Override protected void createCompactLayoutContent(InfoBarCompactLayout layout) { TextView prompt = new AccessibleTextView(getContext()); - if (ChromeFeatureList.isEnabled(ChromeFeatureList.ALLOW_READER_FOR_ACCESSIBILITY)) { - prompt.setText(R.string.reader_view_text_alt); - } else { - prompt.setText(R.string.reader_view_text); - } + prompt.setText(R.string.reader_view_text_alt); prompt.setTextSize(TypedValue.COMPLEX_UNIT_PX, getContext().getResources().getDimension(R.dimen.infobar_text_size)); prompt.setTextColor( @@ -84,11 +79,7 @@ @Override protected CharSequence getAccessibilityMessage(CharSequence defaultMessage) { - if (ChromeFeatureList.isEnabled(ChromeFeatureList.ALLOW_READER_FOR_ACCESSIBILITY)) { - return getContext().getString(R.string.reader_view_text_alt); - } else { - return getContext().getString(R.string.reader_view_text); - } + return getContext().getString(R.string.reader_view_text_alt); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerToolbar.java index da906fe..63472e69 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerToolbar.java
@@ -19,6 +19,7 @@ * Handles toolbar functionality for the Photo Picker class. */ public class PhotoPickerToolbar extends SelectableListToolbar<PickerBitmap> { + // TODO(finnur): Match style changes from Contacts Picker and delete blue_when_enabled. public PhotoPickerToolbar(Context context, AttributeSet attrs) { super(context, attrs); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/AccessibilityPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/AccessibilityPreferences.java index d5102a33..289ce33d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/AccessibilityPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/AccessibilityPreferences.java
@@ -11,7 +11,6 @@ import android.widget.ListView; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.accessibility.FontSizePrefs; import org.chromium.chrome.browser.accessibility.FontSizePrefs.FontSizePrefsObserver; import org.chromium.chrome.browser.util.AccessibilityUtil; @@ -33,7 +32,6 @@ private TextScalePreference mTextScalePref; private SeekBarLinkedCheckBoxPreference mForceEnableZoomPref; - private ChromeBaseCheckBoxPreference mReaderForAccessibilityPref; private ChromeBaseCheckBoxPreference mAccessibilityTabSwitcherPref; private FontSizePrefsObserver mFontSizePrefsObserver = new FontSizePrefsObserver() { @@ -65,15 +63,11 @@ mForceEnableZoomPref.setOnPreferenceChangeListener(this); mForceEnableZoomPref.setLinkedSeekBarPreference(mTextScalePref); - mReaderForAccessibilityPref = + ChromeBaseCheckBoxPreference readerForAccessibilityPref = (ChromeBaseCheckBoxPreference) findPreference(PREF_READER_FOR_ACCESSIBILITY); - if (ChromeFeatureList.isEnabled(ChromeFeatureList.ALLOW_READER_FOR_ACCESSIBILITY)) { - mReaderForAccessibilityPref.setChecked(PrefServiceBridge.getInstance().getBoolean( - Pref.READER_FOR_ACCESSIBILITY_ENABLED)); - mReaderForAccessibilityPref.setOnPreferenceChangeListener(this); - } else { - getPreferenceScreen().removePreference(mReaderForAccessibilityPref); - } + readerForAccessibilityPref.setChecked( + PrefServiceBridge.getInstance().getBoolean(Pref.READER_FOR_ACCESSIBILITY_ENABLED)); + readerForAccessibilityPref.setOnPreferenceChangeListener(this); mAccessibilityTabSwitcherPref = (ChromeBaseCheckBoxPreference) findPreference( ChromePreferenceManager.ACCESSIBILITY_TAB_SWITCHER);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java index c63c478..446efbf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
@@ -182,6 +182,8 @@ private static final String VERIFIED_DIGITAL_ASSET_LINKS = "verified_digital_asset_links"; + private static final String TRUSTED_WEB_ACTIVITY_DISCLOSURE_ACCEPTED_PACKAGES = + "trusted_web_activity_disclosure_accepted_packages"; /** * Whether VR assets component should be registered on startup. @@ -460,6 +462,31 @@ mSharedPreferences.edit().putStringSet(VERIFIED_DIGITAL_ASSET_LINKS, links).apply(); } + /** Do not modify the set returned by this method. */ + private Set<String> getTrustedWebActivityDisclosureAcceptedPackages() { + return mSharedPreferences.getStringSet( + TRUSTED_WEB_ACTIVITY_DISCLOSURE_ACCEPTED_PACKAGES, Collections.emptySet()); + } + + /** + * Sets that the user has accepted the Trusted Web Activity "Running in Chrome" disclosure for + * TWAs launched by the given package. + */ + public void setUserAcceptedTwaDisclosureForPackage(String packageName) { + Set<String> packages = new HashSet<>(getTrustedWebActivityDisclosureAcceptedPackages()); + packages.add(packageName); + mSharedPreferences.edit().putStringSet( + TRUSTED_WEB_ACTIVITY_DISCLOSURE_ACCEPTED_PACKAGES, packages).apply(); + } + + /** + * Checks whether the given package was previously passed to + * {@link #setUserAcceptedTwaDisclosureForPackage(String)}. + */ + public boolean hasUserAcceptedTwaDisclosureForPackage(String packageName) { + return getTrustedWebActivityDisclosureAcceptedPackages().contains(packageName); + } + /** * Writes the given int value to the named shared preference. * @param key The name of the preference to modify.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchBoxDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchBoxDataProvider.java index c00a75e1..f6c8fa2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchBoxDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchBoxDataProvider.java
@@ -89,6 +89,11 @@ } @Override + public boolean isPreview() { + return false; + } + + @Override public boolean shouldShowVerboseStatus() { return false; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java index 78fb3fa..a35a6d43 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
@@ -74,7 +74,8 @@ public static final int UMA_MISSING_FILES_NO_SD_CARD = 24; public static final int UMA_OFFLINE_INDICATOR = 25; public static final int UMA_FEED_NTP_STREAM = 26; - public static final int UMA_WEBAPK_TWA_PRIVACY_DISCLOSURE = 27; + public static final int UMA_WEBAPK_PRIVACY_DISCLOSURE = 27; + public static final int UMA_TWA_PRIVACY_DISCLOSURE = 28; private SnackbarController mController; private CharSequence mText;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java index b485305..16e6432 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java
@@ -111,12 +111,25 @@ return sProfileSyncService; } + /** + * Overrides the initialization for tests. The tests should call resetForTests() at shutdown. + */ @VisibleForTesting public static void overrideForTests(ProfileSyncService profileSyncService) { sProfileSyncService = profileSyncService; sInitialized = true; } + /** + * Resets the ProfileSyncService instance. Calling get() next time will initialize with a new + * instance. + */ + @VisibleForTesting + public static void resetForTests() { + sInitialized = false; + sProfileSyncService = null; + } + protected ProfileSyncService() { init(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java index d0c2114..7fd4f6b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java
@@ -6,14 +6,21 @@ import android.util.SparseArray; +import org.chromium.chrome.browser.incognito.IncognitoTabHost; +import org.chromium.chrome.browser.incognito.IncognitoTabHostRegistry; +import org.chromium.chrome.browser.tab.Tab; + /** * Data that will be used later when a tab is opened via an intent. Often only the necessary * subset of the data will be set. All data is removed once the tab finishes initializing. */ public class AsyncTabParamsManager { + /** A map of tab IDs to AsyncTabParams consumed by Activities started asynchronously. */ private static final SparseArray<AsyncTabParams> sAsyncTabParams = new SparseArray<>(); + private static boolean sAddedToIncognitoTabHostRegistry; + /** * Stores AsyncTabParams used when the tab with the given ID is launched via intent. * @param tabId The ID of the tab that will be launched via intent. @@ -21,6 +28,13 @@ */ public static void add(int tabId, AsyncTabParams params) { sAsyncTabParams.put(tabId, params); + + if (!sAddedToIncognitoTabHostRegistry) { + // Make sure async incognito tabs are taken into account when, for example, + // checking if any incognito tabs exist. + IncognitoTabHostRegistry.getInstance().register(new AsyncTabsIncognitoTabHost()); + sAddedToIncognitoTabHostRegistry = true; + } } /** @@ -62,4 +76,29 @@ private AsyncTabParamsManager() { } + + private static class AsyncTabsIncognitoTabHost implements IncognitoTabHost { + @Override + public boolean hasIncognitoTabs() { + SparseArray<AsyncTabParams> asyncTabParams = AsyncTabParamsManager.getAsyncTabParams(); + for (int i = 0; i < asyncTabParams.size(); i++) { + Tab tab = asyncTabParams.valueAt(i).getTabToReparent(); + if (tab != null && tab.isIncognito()) { + return true; + } + } + return false; + } + + @Override + public void closeAllIncognitoTabs() { + SparseArray<AsyncTabParams> asyncTabParams = AsyncTabParamsManager.getAsyncTabParams(); + for (int i = 0; i < asyncTabParams.size(); i++) { + Tab tab = asyncTabParams.valueAt(i).getTabToReparent(); + if (tab != null && tab.isIncognito()) { + AsyncTabParamsManager.remove(tab.getId()); + } + } + } + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java index 0995390..d3bb5fc8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.tabmodel; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.tabmodel.IncognitoTabModel.IncognitoTabModelDelegate; import org.chromium.chrome.browser.tabmodel.TabCreatorManager.TabCreator; @@ -56,6 +57,6 @@ @Override public boolean doIncognitoTabsExist() { - return !TabWindowManager.getInstance().canDestroyIncognitoProfile(); + return IncognitoUtils.doIncognitoTabsExist(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java index 7d1cb10..103d0fd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java
@@ -151,14 +151,6 @@ } /** - * @return Whether the incognito profile can be destroyed. It cannot be destroyed if it is - * in use by any live tab model selectors. - */ - public boolean canDestroyIncognitoProfile() { - return getIncognitoTabCount() == 0; - } - - /** * @param tabId The ID of the tab in question. * @return Whether the given tab exists in any currently loaded selector. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarDataProvider.java index 2b39265..4d3cfe3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarDataProvider.java
@@ -82,6 +82,11 @@ boolean isOfflinePage(); /** + * @return Whether the page currently shown is a preview. + */ + boolean isPreview(); + + /** * @param urlBarText The text currently displayed in the url bar. * @return Whether the Google 'G' should be shown in the location bar. */ @@ -110,6 +115,12 @@ */ @ColorRes default int getVerboseStatusTextColor(Resources res, boolean useDarkColors) { + if (isPreview()) { + return ApiCompatibilityUtils.getColor(res, + useDarkColors ? R.color.locationbar_status_preview_color + : R.color.locationbar_status_preview_color_light); + } + if (isOfflinePage()) { return ApiCompatibilityUtils.getColor(res, useDarkColors ? R.color.locationbar_status_offline_color @@ -135,6 +146,9 @@ */ @StringRes default int getVerboseStatusString() { + if (isPreview()) { + return R.string.location_bar_verbose_status_preview; + } if (isOfflinePage()) { return R.string.location_bar_verbose_status_offline; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java index a47dfef..c5c8b2ce 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java
@@ -224,6 +224,11 @@ } @Override + public boolean isPreview() { + return false; + } + + @Override public boolean shouldShowGoogleG(String urlBarText) { return false; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java index cbba5fcd..07ffdb66 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
@@ -324,6 +324,12 @@ } @Override + public boolean isPreview() { + // TODO(crbug.com/871839): Link this up with the native previews state. + return false; + } + + @Override public boolean shouldShowGoogleG(String urlBarText) { LocaleManager localeManager = LocaleManager.getInstance(); if (localeManager.hasCompletedSearchEnginePromo() @@ -346,7 +352,7 @@ // Because is offline page is cleared a bit slower, we also ensure that connection security // level is NONE or HTTP_SHOW_WARNING (http://crbug.com/671453). int securityLevel = getSecurityLevel(); - return isOfflinePage() + return (isOfflinePage() || isPreview()) && (securityLevel == ConnectionSecurityLevel.NONE || securityLevel == ConnectionSecurityLevel.HTTP_SHOW_WARNING); } @@ -365,7 +371,7 @@ if (shouldDisplaySearchTerms()) { return R.drawable.omnibox_search; } - return getSecurityIconResource(getSecurityLevel(), !isTablet, isOfflinePage()); + return getSecurityIconResource(getSecurityLevel(), !isTablet, isOfflinePage(), isPreview()); } @VisibleForTesting @@ -388,8 +394,12 @@ @VisibleForTesting @DrawableRes static int getSecurityIconResource( - int securityLevel, boolean isSmallDevice, boolean isOfflinePage) { - if (isOfflinePage) { + int securityLevel, boolean isSmallDevice, boolean isOfflinePage, boolean isPreview) { + // Checking for a preview first because one possible preview type is showing an offline page + // on a slow connection. In this case, the previews UI takes precedence. + if (isPreview) { + return R.drawable.preview_pin_round; + } else if (isOfflinePage) { return R.drawable.offline_pin_round; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java index 5e932d5..8676ed7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -588,7 +588,7 @@ CustomTabIntentDataProvider.CustomTabsUiType.MINIMAL_UI_WEBAPP, new ArrayList<String>(), true /* is opened by Chrome */, true /* should show share */, false /* should show star (bookmarking) */, - false /* should show download */); + false /* should show download */, false /* is incognito */); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDisclosureSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDisclosureSnackbarController.java index 1e444365..0e56689 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDisclosureSnackbarController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDisclosureSnackbarController.java
@@ -53,7 +53,7 @@ Snackbar.make(activity.getResources().getString( R.string.app_running_in_chrome_disclosure), this, Snackbar.TYPE_PERSISTENT, - Snackbar.UMA_WEBAPK_TWA_PRIVACY_DISCLOSURE) + Snackbar.UMA_WEBAPK_PRIVACY_DISCLOSURE) .setAction( activity.getResources().getString(R.string.ok_got_it), storage) .setSingleLine(false));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java index d12dced..2680bb1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java
@@ -53,9 +53,9 @@ protected void onFinishInflate() { super.onFinishInflate(); - mIconView = findViewById(R.id.icon_view); - mTitleView = findViewById(R.id.title); - mDescriptionView = findViewById(R.id.description); + mIconView = (TintedImageView) findViewById(R.id.icon_view); + mTitleView = (TextView) findViewById(R.id.title); + mDescriptionView = (TextView) findViewById(R.id.description); if (mIconView != null) { mIconView.setBackgroundResource(R.drawable.list_item_icon_modern_bg);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java index b8708a2..e6c761b4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListLayout.java
@@ -156,8 +156,8 @@ mRecyclerView = recyclerView; // Replace the inflated recycler view with the one supplied to this method. - FrameLayout contentView = findViewById(R.id.list_content); - RecyclerView existingView = contentView.findViewById(R.id.recycler_view); + FrameLayout contentView = (FrameLayout) findViewById(R.id.list_content); + RecyclerView existingView = (RecyclerView) contentView.findViewById(R.id.recycler_view); contentView.removeView(existingView); contentView.addView(mRecyclerView, 0); }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index ad3b4fd6..59b760e 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3021,6 +3021,9 @@ <message name="IDS_LOCATION_BAR_VERBOSE_STATUS_OFFLINE" desc="Verbose indication of offline status in the location bar. [CHAR-LIMIT=20]"> Offline </message> + <message name="IDS_LOCATION_BAR_VERBOSE_STATUS_PREVIEW" desc="An indication in the location bar that the page the user is viewing has been modified in order to speed up the page load or decrease the amount of data used to load the page. [CHAR-LIMIT=10]"> + Lite + </message> <!-- Voice search --> <message name="IDS_VOICE_SEARCH_ERROR" desc="Toast when the voice search activity couldn't be started. [CHAR-LIMIT=40]"> @@ -3033,15 +3036,15 @@ <message name="IDS_MENU_OPEN_IN_CHROME" desc="Context sensitive menu item for opening a link in Chrome. [CHAR-LIMIT=30]"> Open in Chrome </message> + <message name="IDS_MENU_OPEN_IN_INCOGNITO_CHROME" desc="Context sensitive menu item for opening a link in Chrome in an Incognito tab. [CHAR-LIMIT=30]" translateable="false"> + Open in Incognito Chrome + </message> <message name="IDS_MENU_OPEN_IN_PRODUCT" desc="App menu item for opening link in the browser. [CHAR-LIMIT=30]"> Open in <ph name="PRODUCT_NAME">%1$s<ex>Chrome</ex></ph> </message> <message name="IDS_MENU_OPEN_IN_PRODUCT_DEFAULT" desc="Default title for menu item for opening link in browser. [CHAR-LIMIT=30]"> Open in browser </message> - <message name="IDS_READER_VIEW_TEXT" desc='Message shown on the reader mode button bar, to invite the user to tap to open a reader mode. Reader mode extracts content and removes clutter from a web page and puts the result in a panel making it easier to read. This is used when "Reader Mode for Accessibility" is not available.'> - Make page mobile-friendly - </message> <message name="IDS_READER_VIEW_TEXT_ALT" desc='Message shown on the reader mode button bar, to invite the user to tap to open a reader mode. Reader mode extracts content and removes clutter from a web page and puts the result in a panel making it easier to read. This is used when "Reader Mode for Accessibility" is available.'> Show simplified view </message> @@ -3397,6 +3400,11 @@ <ph name="BEGIN_LINK"><link></ph>Get help<ph name="END_LINK"></link></ph> </message> + <!-- Contacts Picker strings --> + <message name="IDS_CONTACTS_PICKER_SELECT_CONTACTS" desc="The label at the top of the dialog that allows users to select contacts from their device and share the details with a web page."> + Select contacts + </message> + <!-- Photo Picker strings --> <message name="IDS_DECODER_DESCRIPTION" desc="The title for the image decoder utility service."> Image decoder @@ -3433,6 +3441,10 @@ <message name="IDS_APP_RUNNING_IN_CHROME_DISCLOSURE" desc="Message on the snackbar that indicates an app may use Chrome data."> This app is running in Chrome. </message> + <message name="IDS_TWA_RUNNING_IN_CHROME" desc="Message on a snackbar indicating that the current Activity may use Chrome data (the rest of the app may not be)." translateable="false"> + Running in Chrome + </message> + <message name="IDS_WEBAPP_TAP_TO_COPY_URL" desc="Message on the notification that indicates that taping it will copy a Web App's URL into the clipboard."> Tap to copy the URL for this app </message>
diff --git a/chrome/android/java/strings/android_chrome_strings_grd/IDS_CONTACTS_PICKER_SELECT_CONTACTS.png.sha1 b/chrome/android/java/strings/android_chrome_strings_grd/IDS_CONTACTS_PICKER_SELECT_CONTACTS.png.sha1 new file mode 100644 index 0000000..85d72cf --- /dev/null +++ b/chrome/android/java/strings/android_chrome_strings_grd/IDS_CONTACTS_PICKER_SELECT_CONTACTS.png.sha1
@@ -0,0 +1 @@ +dd7eff76d816beaf11e0fe267ec43250c56f9f03 \ No newline at end of file
diff --git a/chrome/android/java/strings/android_chrome_strings_grd/IDS_TWA_RUNNING_IN_CHROME.png.sha1 b/chrome/android/java/strings/android_chrome_strings_grd/IDS_TWA_RUNNING_IN_CHROME.png.sha1 new file mode 100644 index 0000000..5af505c --- /dev/null +++ b/chrome/android/java/strings/android_chrome_strings_grd/IDS_TWA_RUNNING_IN_CHROME.png.sha1
@@ -0,0 +1 @@ +45c465d4b5b4d269d9bf96ffc491371a90e81f32 \ No newline at end of file
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 8c3e1bd0..72941c4 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -166,6 +166,7 @@ "java/src/org/chromium/chrome/browser/browserservices/OriginVerifier.java", "java/src/org/chromium/chrome/browser/browserservices/PostMessageHandler.java", "java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClient.java", + "java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java", "java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java", "java/src/org/chromium/chrome/browser/browserservices/UkmRecorder.java", "java/src/org/chromium/chrome/browser/browserservices/VerificationState.java", @@ -267,7 +268,12 @@ "java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java", "java/src/org/chromium/chrome/browser/compositor/scene_layer/ToolbarSceneLayer.java", "java/src/org/chromium/chrome/browser/consent_auditor/ConsentAuditorBridge.java", + "java/src/org/chromium/chrome/browser/contacts_picker/ContactDetails.java", "java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialog.java", + "java/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerToolbar.java", + "java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java", + "java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java", + "java/src/org/chromium/chrome/browser/contacts_picker/PickerCategoryView.java", "java/src/org/chromium/chrome/browser/content/ContentUtils.java", "java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java", "java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java", @@ -639,7 +645,10 @@ "java/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGenerator.java", "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java", "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoTabHost.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoTabHostRegistry.java", "java/src/org/chromium/chrome/browser/incognito/IncognitoTabSnapshotController.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoUtils.java", "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java", "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarDelegateAndroid.java", "java/src/org/chromium/chrome/browser/infobar/AutofillCreditCardFillingInfoBar.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/EnabledStateMonitorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/EnabledStateMonitorTest.java index f4b3818..2b2c077 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/EnabledStateMonitorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/EnabledStateMonitorTest.java
@@ -82,6 +82,8 @@ public void tearDown() throws Exception { ThreadUtils.runOnUiThreadBlocking(() -> { ChromeSigninController.get().setSignedInAccountName(mOriginalSignedInAccountName); + // Clear ProfileSyncService in case it was mocked. + ProfileSyncService.resetForTests(); }); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandlerTest.java index f06207a20..3758d978 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandlerTest.java
@@ -219,6 +219,11 @@ } @Override + public boolean isPreview() { + return false; + } + + @Override public boolean shouldShowGoogleG(String urlBarText) { return false; } @@ -594,4 +599,4 @@ == mHandler.getVoiceConfidenceValue()); }); } -} \ No newline at end of file +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java index f6723cb..b1eb552 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java
@@ -12,6 +12,7 @@ import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -75,6 +76,11 @@ mAccountManager.addAccountHolderBlocking(accountHolder.build()); } + @After + public void tearDown() throws Exception { + ThreadUtils.runOnUiThreadBlocking(() -> ProfileSyncService.resetForTests()); + } + /** * Launches the main preferences. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasicTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasicTest.java index b9de0b3..81e8d85 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasicTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasicTest.java
@@ -59,7 +59,7 @@ @After public void tearDown() throws Exception { - ProfileSyncService.overrideForTests(null); + ThreadUtils.runOnUiThreadBlocking(() -> ProfileSyncService.resetForTests()); } private static class StubProfileSyncService extends ProfileSyncService {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java index 67f78e0..1acf1c83 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java
@@ -50,7 +50,7 @@ @After public void tearDown() throws Exception { // Clear ProfileSyncService in case it was mocked. - ProfileSyncService.overrideForTests(null); + ThreadUtils.runOnUiThreadBlocking(() -> ProfileSyncService.resetForTests()); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/jsdialog/VrBrowserJavaScriptModalDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/jsdialog/VrBrowserJavaScriptModalDialogTest.java index 74ce2f4..0d9b56e7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/jsdialog/VrBrowserJavaScriptModalDialogTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/jsdialog/VrBrowserJavaScriptModalDialogTest.java
@@ -19,7 +19,6 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; -import org.chromium.base.test.util.UrlUtils; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.jsdialog.JavascriptTabModalDialog; @@ -32,14 +31,15 @@ import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.JavaScriptUtils; +import java.io.IOException; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; /** * Test JavaScript modal dialogs in VR. */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM) public class VrBrowserJavaScriptModalDialogTest { @Rule public ChromeTabbedActivityVrTestRule mActivityTestRule = new ChromeTabbedActivityVrTestRule(); @@ -48,9 +48,6 @@ public RenderTestRule mRenderTestRule = new RenderTestRule("components/test/data/js_dialogs/render_tests"); - private static final String EMPTY_PAGE = UrlUtils.encodeHtmlDataUri( - "<html><title>Modal Dialog Test</title><p>Testcase.</p></title></html>"); - private ChromeTabbedActivity mActivity; @Before @@ -63,20 +60,43 @@ */ @Test @MediumTest - @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM) @Feature({"Browser", "RenderTest"}) - public void testAlertModalDialog() - throws InterruptedException, TimeoutException, ExecutionException, Throwable { + public void testAlertModalDialog() throws ExecutionException, IOException { + testModalDialogImpl("js_modal_view_vr_alert", "alert('Hello Android!')"); + } + + /** + * Verifies modal confirm-dialog appearance and that it looks as it is expected. + */ + @Test + @MediumTest + @Feature({"Browser", "RenderTest"}) + public void testConfirmModalDialog() throws ExecutionException, IOException { + testModalDialogImpl("js_modal_view_vr_confirm", "confirm('Deny?')"); + } + + /** + * Verifies modal prompt-dialog appearance and that it looks as it is expected. + */ + @Test + @MediumTest + @Feature({"Browser", "RenderTest"}) + public void testPromptModalDialog() throws ExecutionException, IOException { + testModalDialogImpl( + "js_modal_view_vr_prompt", "prompt('Is the tree closed?', 'Hopefully not')"); + } + + private void testModalDialogImpl(String name, String js) + throws ExecutionException, IOException { VrBrowserTransitionUtils.forceEnterVrBrowserOrFail(POLL_TIMEOUT_LONG_MS); - executeJavaScriptAndWaitForDialog("alert('Hello Android!')"); + executeJavaScriptAndWaitForDialog(js); JavascriptTabModalDialog jsDialog = getCurrentDialog(); Assert.assertNotNull("No dialog showing.", jsDialog); Assert.assertEquals(NativeUiUtils.getVrViewContainer().getChildCount(), 1); - mRenderTestRule.render( - NativeUiUtils.getVrViewContainer().getChildAt(0), "js_modal_view_vr"); + mRenderTestRule.render(NativeUiUtils.getVrViewContainer().getChildAt(0), name); } /**
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java index 485a94a..1f3e5d6 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
@@ -142,6 +142,7 @@ @After public void tearDown() { AccountManagerFacade.resetAccountManagerFacadeForTests(); + ProfileSyncService.resetForTests(); } /**
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java index 14a8a086..4edd3b59 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java
@@ -27,6 +27,7 @@ public final class ToolbarSecurityIconTest { private static final boolean IS_SMALL_DEVICE = true; private static final boolean IS_OFFLINE_PAGE = true; + private static final boolean IS_PREVIEW = true; private static final int[] SECURITY_LEVELS = new int[] {ConnectionSecurityLevel.NONE, ConnectionSecurityLevel.HTTP_SHOW_WARNING, ConnectionSecurityLevel.DANGEROUS, ConnectionSecurityLevel.SECURE, ConnectionSecurityLevel.EV_SECURE}; @@ -74,55 +75,63 @@ assertEquals("Wrong phone resource for security level " + securityLevel, R.drawable.offline_pin_round, ToolbarModel.getSecurityIconResource( - securityLevel, IS_SMALL_DEVICE, IS_OFFLINE_PAGE)); + securityLevel, IS_SMALL_DEVICE, IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals("Wrong tablet resource for security level " + securityLevel, R.drawable.offline_pin_round, ToolbarModel.getSecurityIconResource( - securityLevel, !IS_SMALL_DEVICE, IS_OFFLINE_PAGE)); + securityLevel, !IS_SMALL_DEVICE, IS_OFFLINE_PAGE, !IS_PREVIEW)); + assertEquals("Wrong phone resource for security level " + securityLevel, + R.drawable.preview_pin_round, + ToolbarModel.getSecurityIconResource( + securityLevel, IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, IS_PREVIEW)); + assertEquals("Wrong tablet resource for security level " + securityLevel, + R.drawable.preview_pin_round, + ToolbarModel.getSecurityIconResource( + securityLevel, !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, IS_PREVIEW)); } assertEquals(0, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.NONE, IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.NONE, IS_SMALL_DEVICE, + !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_info, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.NONE, !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.NONE, !IS_SMALL_DEVICE, + !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_info, ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.HTTP_SHOW_WARNING, - IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_info, ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.HTTP_SHOW_WARNING, - !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_invalid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.DANGEROUS, IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.DANGEROUS, + IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_invalid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.DANGEROUS, !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.DANGEROUS, + !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, ToolbarModel.getSecurityIconResource( ConnectionSecurityLevel.SECURE_WITH_POLICY_INSTALLED_CERT, IS_SMALL_DEVICE, - !IS_OFFLINE_PAGE)); + !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, ToolbarModel.getSecurityIconResource( ConnectionSecurityLevel.SECURE_WITH_POLICY_INSTALLED_CERT, !IS_SMALL_DEVICE, - !IS_OFFLINE_PAGE)); + !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.SECURE, IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.SECURE, + IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.SECURE, !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.SECURE, + !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.EV_SECURE, IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.EV_SECURE, + IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); assertEquals(R.drawable.omnibox_https_valid, - ToolbarModel.getSecurityIconResource( - ConnectionSecurityLevel.EV_SECURE, !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE)); + ToolbarModel.getSecurityIconResource(ConnectionSecurityLevel.EV_SECURE, + !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW)); } }
diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java index 9969ef43..dc7ebf9 100644 --- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java +++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java
@@ -18,6 +18,7 @@ import android.widget.EditText; import android.widget.TextView; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -112,6 +113,11 @@ mPreferences = null; } + @After + public void tearDown() throws Exception { + ThreadUtils.runOnUiThreadBlocking(() -> ProfileSyncService.resetForTests()); + } + @Test @SmallTest @Feature({"Sync"})
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index 1f25eca..a42b8205 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h
@@ -179,6 +179,7 @@ #define IDC_CUSTOMIZE_TOUCH_BAR 40251 #define IDC_SHOW_BETA_FORUM 40252 #define IDC_TOGGLE_JAVASCRIPT_APPLE_EVENTS 40253 +#define IDC_TOGGLE_CONFIRM_TO_QUIT_OPTION 40254 // Spell-check // Insert any additional suggestions before _LAST; these have to be consecutive.
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 0565b60..8b450b6 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5212,8 +5212,12 @@ </if> <if expr="is_win or (is_linux and not chromeos)"> - <message name="IDS_QUIT_ACCELERATOR_TUTORIAL" desc="Instructions for how the user should quit using keyboard shortcuts."> - Press |<ph name="ACCELERATOR1">$1<ex>Ctrl</ex></ph>|+|<ph name="ACCELERATOR2">$2<ex>Shift</ex></ph>| followed by |<ph name="ACCELERATOR3">$3<ex>Q</ex></ph>| to exit + <!-- Confirm to quit panel --> + <message name="IDS_CONFIRM_TO_QUIT_DESCRIPTION" desc="Instructions for how the user should confirm quitting."> + Hold |<ph name="ACCELERATOR1">$1<ex>Ctrl</ex></ph>|+|<ph name="ACCELERATOR2">$2<ex>Shift</ex></ph>|+|<ph name="ACCELERATOR3">$3<ex>Q</ex></ph>| to exit + </message> + <message name="IDS_CONFIRM_TO_QUIT_OPTION" desc="The label of the checkbox preference that enables the confirm-to-quit feature."> + Warn before exiting (<ph name="KEY_EQUIVALENT">$1<ex>Ctrl+Shift+Q</ex></ph>) </message> </if>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 20407695..9fbfd1f9 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -793,6 +793,49 @@ "scrgb-linear"}, }; +const FeatureEntry::FeatureParam kAutofillPreviewStyleBlackOnBlue050[] = { + {blink::features::kAutofillPreviewStyleExperimentBgColorParameterName, + "#E8F0F3"}, + {blink::features::kAutofillPreviewStyleExperimentColorParameterName, + "#000000"}, +}; +const FeatureEntry::FeatureParam kAutofillPreviewStyleBlackOnBlue100[] = { + {blink::features::kAutofillPreviewStyleExperimentBgColorParameterName, + "#D2E3FC"}, + {blink::features::kAutofillPreviewStyleExperimentColorParameterName, + "#000000"}, +}; +const FeatureEntry::FeatureParam kAutofillPreviewStyleBlue900OnBlue050[] = { + {blink::features::kAutofillPreviewStyleExperimentBgColorParameterName, + "#E8F0F3"}, + {blink::features::kAutofillPreviewStyleExperimentColorParameterName, + "#174EA6"}, +}; +const FeatureEntry::FeatureParam kAutofillPreviewStyleBlackOnGreen050[] = { + {blink::features::kAutofillPreviewStyleExperimentBgColorParameterName, + "#E6F4EA"}, + {blink::features::kAutofillPreviewStyleExperimentColorParameterName, + "#000000"}, +}; +const FeatureEntry::FeatureParam kAutofillPreviewStyleBlackOnYellow050[] = { + {blink::features::kAutofillPreviewStyleExperimentBgColorParameterName, + "#FEF7E0"}, + {blink::features::kAutofillPreviewStyleExperimentColorParameterName, + "#000000"}, +}; + +const FeatureEntry::FeatureVariation kAutofillPreviewStyleVariations[] = { + {"(Black on GoogleBlue050)", kAutofillPreviewStyleBlackOnBlue050, + base::size(kAutofillPreviewStyleBlackOnBlue050), nullptr}, + {"(Black on GoogleBlue100)", kAutofillPreviewStyleBlackOnBlue100, + base::size(kAutofillPreviewStyleBlackOnBlue100), nullptr}, + {"(GoogleBlue900 on GoogleBlue050)", kAutofillPreviewStyleBlue900OnBlue050, + base::size(kAutofillPreviewStyleBlue900OnBlue050), nullptr}, + {"(Black on GoogleGreen050)", kAutofillPreviewStyleBlackOnGreen050, + base::size(kAutofillPreviewStyleBlackOnGreen050), nullptr}, + {"(Black on GoogleYellow050)", kAutofillPreviewStyleBlackOnYellow050, + base::size(kAutofillPreviewStyleBlackOnYellow050), nullptr}}; + const FeatureEntry::Choice kAutoplayPolicyChoices[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, {flag_descriptions::kAutoplayPolicyNoUserGestureRequired, @@ -2508,6 +2551,11 @@ flag_descriptions::kEnableInputImeApiDescription, kOsWin | kOsLinux, ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInputImeAPI, switches::kDisableInputImeAPI)}, +#if !defined(OS_CHROMEOS) + {"warn-before-quitting", flag_descriptions::kWarnBeforeQuittingFlagName, + flag_descriptions::kWarnBeforeQuittingFlagDescription, kOsWin | kOsLinux, + FEATURE_VALUE_TYPE(features::kWarnBeforeQuitting)}, +#endif // OS_CHROMEOS #endif // OS_WIN || OS_LINUX {"enable-origin-trials", flag_descriptions::kOriginTrialsName, flag_descriptions::kOriginTrialsDescription, kOsAll, @@ -3603,13 +3651,6 @@ FEATURE_VALUE_TYPE(media::kOverflowIconsForMediaControls)}, #if defined(OS_ANDROID) - {"allow-reader-for-accessibility", - flag_descriptions::kAllowReaderForAccessibilityName, - flag_descriptions::kAllowReaderForAccessibilityDescription, kOsAndroid, - FEATURE_VALUE_TYPE(chrome::android::kAllowReaderForAccessibility)}, -#endif // defined(OS_ANDROID) - -#if defined(OS_ANDROID) {"enable-downloads-foreground", flag_descriptions::kDownloadsForegroundName, flag_descriptions::kDownloadsForegroundDescription, kOsAndroid, FEATURE_VALUE_TYPE(features::kDownloadsForeground)}, @@ -3868,6 +3909,14 @@ flag_descriptions::kAutofillDynamicFormsDescription, kOsAll, FEATURE_VALUE_TYPE(autofill::features::kAutofillDynamicForms)}, + {"autofill-preview-style", + flag_descriptions::kAutofillPreviewStyleExperimentName, + flag_descriptions::kAutofillPreviewStyleExperimentDescription, kOsAll, + FEATURE_WITH_PARAMS_VALUE_TYPE( + blink::features::kAutofillPreviewStyleExperiment, + kAutofillPreviewStyleVariations, + "AutofillPreviewStyle")}, + {"autofill-prefilled-fields", flag_descriptions::kAutofillPrefilledFieldsName, flag_descriptions::kAutofillPrefilledFieldsDescription, kOsAll,
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 96782101..f68c12a 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -69,7 +69,6 @@ &features::kWebPayments, &feed::kInterestFeedContentSuggestions, &kAdjustWebApkInstallationSpace, - &kAllowReaderForAccessibility, &kAndroidPayIntegrationV1, &kAndroidPayIntegrationV2, &kAndroidPaymentApps, @@ -187,9 +186,6 @@ const base::Feature kAdjustWebApkInstallationSpace = { "AdjustWebApkInstallationSpace", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kAllowReaderForAccessibility = { - "AllowReaderForAccessibility", base::FEATURE_ENABLED_BY_DEFAULT}; - const base::Feature kAndroidPayIntegrationV1{"AndroidPayIntegrationV1", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index ec1a550..8e17326 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -13,7 +13,6 @@ // Alphabetical: extern const base::Feature kAdjustWebApkInstallationSpace; -extern const base::Feature kAllowReaderForAccessibility; extern const base::Feature kAndroidPayIntegrationV1; extern const base::Feature kAndroidPayIntegrationV2; extern const base::Feature kAndroidPaymentApps;
diff --git a/chrome/browser/android/vr/gvr_keyboard_shim.cc b/chrome/browser/android/vr/gvr_keyboard_shim.cc index c64cd3e7..593495a1 100644 --- a/chrome/browser/android/vr/gvr_keyboard_shim.cc +++ b/chrome/browser/android/vr/gvr_keyboard_shim.cc
@@ -27,6 +27,7 @@ CALL(gvr_keyboard_show) \ CALL(gvr_keyboard_update_button_state) \ CALL(gvr_keyboard_update_controller_ray) \ + CALL(gvr_keyboard_update_controller_touch) \ CALL(gvr_keyboard_get_text) \ CALL(gvr_keyboard_set_text) \ CALL(gvr_keyboard_get_selection_indices) \ @@ -41,7 +42,14 @@ CALL(gvr_keyboard_render) \ CALL(gvr_keyboard_hide) \ CALL(gvr_keyboard_destroy) \ - CALL(gvr_keyboard_update_controller_touch) + CALL(gvr_keyboard_set_anti_alias_enabled) \ + CALL(gvr_keyboard_set_voice_input_enabled) \ + CALL(gvr_keyboard_set_voice_permission_callback_enabled) \ + CALL(gvr_keyboard_request_voice_permission) \ + CALL(gvr_keyboard_set_multiview_enabled) \ + CALL(gvr_keyboard_multiview_set_viewport) \ + CALL(gvr_keyboard_multiview_render) \ + CALL(gvr_keyboard_get_hit_normal) // The min API version that is guaranteed to exists on the user's device if they // have some version of the Daydream keyboard installed. @@ -157,6 +165,46 @@ return keyboard_api->impl_gvr_keyboard_create(closure, callback); } +bool gvr_keyboard_set_anti_alias_enabled(bool enabled) { + if (keyboard_api->impl_gvr_keyboard_set_anti_alias_enabled) { + keyboard_api->impl_gvr_keyboard_set_anti_alias_enabled(enabled); + return true; + } + return false; +} + +bool gvr_keyboard_set_voice_input_enabled(bool enabled) { + if (keyboard_api->impl_gvr_keyboard_set_voice_input_enabled) { + keyboard_api->impl_gvr_keyboard_set_voice_input_enabled(enabled); + return true; + } + return false; +} + +bool gvr_keyboard_set_voice_permission_callback_enabled(bool enabled) { + if (keyboard_api->impl_gvr_keyboard_set_voice_permission_callback_enabled) { + keyboard_api->impl_gvr_keyboard_set_voice_permission_callback_enabled( + enabled); + return true; + } + return false; +} + +bool gvr_keyboard_request_voice_permission(gvr_keyboard_context* context) { + if (keyboard_api->impl_gvr_keyboard_request_voice_permission) { + return keyboard_api->impl_gvr_keyboard_request_voice_permission(context); + } + return false; +} + +bool gvr_keyboard_set_multiview_enabled(bool enabled) { + if (keyboard_api->impl_gvr_keyboard_set_multiview_enabled) { + keyboard_api->impl_gvr_keyboard_set_multiview_enabled(enabled); + return true; + } + return false; +} + void gvr_keyboard_destroy(gvr_keyboard_context** context) { keyboard_api->impl_gvr_keyboard_destroy(context); CloseSdk(); @@ -203,6 +251,14 @@ end, hit); } +bool gvr_keyboard_get_hit_normal(gvr_keyboard_context* context, + gvr_vec3f* normal) { + if (keyboard_api->impl_gvr_keyboard_get_hit_normal) { + return keyboard_api->impl_gvr_keyboard_get_hit_normal(context, normal); + } + return false; +} + void gvr_keyboard_update_controller_touch(gvr_keyboard_context* context, bool touched, const gvr_vec2f* pos) { @@ -264,6 +320,13 @@ projection); } +void gvr_keyboard_multiview_set_viewport(gvr_keyboard_context* context, + const gvr_recti* viewport) { + if (keyboard_api->impl_gvr_keyboard_multiview_set_viewport) { + keyboard_api->impl_gvr_keyboard_multiview_set_viewport(context, viewport); + } +} + void gvr_keyboard_set_viewport(gvr_keyboard_context* context, int32_t eye_type, const gvr_recti* viewport) { @@ -278,6 +341,11 @@ keyboard_api->impl_gvr_keyboard_render(context, eye_type); } +void gvr_keyboard_multiview_render(gvr_keyboard_context* context) { + if (keyboard_api->impl_gvr_keyboard_multiview_render) { + keyboard_api->impl_gvr_keyboard_multiview_render(context); + } +} void gvr_keyboard_hide(gvr_keyboard_context* context) { keyboard_api->impl_gvr_keyboard_hide(context); }
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 8ca357fc..5dff86767 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc
@@ -170,6 +170,7 @@ #include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/ui/apps/chrome_app_window_client.h" +#include "chrome/common/initialize_extensions_client.h" #include "components/storage_monitor/storage_monitor.h" #include "extensions/common/extension_l10n_util.h" #endif @@ -258,8 +259,7 @@ extension_event_router_forwarder_ = base::MakeRefCounted<extensions::EventRouterForwarder>(); - extensions::ExtensionsClient::Set( - extensions::ChromeExtensionsClient::GetInstance()); + EnsureExtensionsClientInitialized(); extensions_browser_client_ = std::make_unique<extensions::ChromeExtensionsBrowserClient>();
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index d0c3dd9..06d2a77 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1332,6 +1332,25 @@ #endif } +bool ChromeContentBrowserClient:: + ShouldCompareEffectiveURLsForSiteInstanceSelection( + content::BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url) { + DCHECK(browser_context); + DCHECK(candidate_site_instance); +#if BUILDFLAG(ENABLE_EXTENSIONS) + return ChromeContentBrowserClientExtensionsPart:: + ShouldCompareEffectiveURLsForSiteInstanceSelection( + browser_context, candidate_site_instance, is_main_frame, + candidate_url, destination_url); +#else + return true; +#endif +} + bool ChromeContentBrowserClient::ShouldUseMobileFlingCurve() const { #if defined(OS_ANDROID) return true;
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 620b1a43..62b57ea 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -109,6 +109,12 @@ bool AllowGpuLaunchRetryOnIOThread() override; GURL GetEffectiveURL(content::BrowserContext* browser_context, const GURL& url) override; + bool ShouldCompareEffectiveURLsForSiteInstanceSelection( + content::BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url) override; bool ShouldUseMobileFlingCurve() const override; bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, const GURL& effective_url) override;
diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc index 600725b..87572d93 100644 --- a/chrome/browser/chrome_content_browser_client_browsertest.cc +++ b/chrome/browser/chrome_content_browser_client_browsertest.cc
@@ -32,6 +32,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/test_navigation_observer.h" #include "net/dns/mock_host_resolver.h" #include "net/http/http_status_code.h" #include "net/test/embedded_test_server/embedded_test_server.h" @@ -399,4 +400,72 @@ EXPECT_EQ(iter->second, kTestPolicyHeader); } +// Helper class to test window creation from NTP. +class OpenWindowFromNTPBrowserTest : public InProcessBrowserTest, + public InstantTestBase { + public: + OpenWindowFromNTPBrowserTest() {} + + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitch(switches::kIgnoreCertificateErrors); + } + + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(https_test_server().InitializeAndListen()); + https_test_server().StartAcceptingConnections(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(OpenWindowFromNTPBrowserTest); +}; + +// Test checks that navigations from NTP tab to URLs with same host as NTP but +// different path do not reuse NTP SiteInstance. See https://crbug.com/859062 +// for details. +IN_PROC_BROWSER_TEST_F(OpenWindowFromNTPBrowserTest, + TransferFromNTPCreateNewTab) { + GURL search_url = + https_test_server().GetURL("ntp.com", "/instant_extended.html"); + GURL ntp_url = + https_test_server().GetURL("ntp.com", "/instant_extended_ntp.html"); + InstantTestBase::Init(search_url, ntp_url, false); + + SetupInstant(browser()); + + // Navigate to the NTP URL and verify that the resulting process is marked as + // an Instant process. + ui_test_utils::NavigateToURL(browser(), ntp_url); + content::WebContents* ntp_tab = + browser()->tab_strip_model()->GetActiveWebContents(); + InstantService* instant_service = + InstantServiceFactory::GetForProfile(browser()->profile()); + EXPECT_TRUE(instant_service->IsInstantProcess( + ntp_tab->GetMainFrame()->GetProcess()->GetID())); + + // Execute script that creates new window from ntp tab with + // ntp.com/title1.html as target url. Host is same as remote-ntp host, yet + // path is different. + GURL generic_url(https_test_server().GetURL("ntp.com", "/title1.html")); + content::TestNavigationObserver opened_tab_observer(nullptr); + opened_tab_observer.StartWatchingNewWebContents(); + EXPECT_TRUE( + ExecuteScript(ntp_tab, "window.open('" + generic_url.spec() + "');")); + opened_tab_observer.Wait(); + ASSERT_EQ(2, browser()->tab_strip_model()->count()); + + content::WebContents* opened_tab = + browser()->tab_strip_model()->GetActiveWebContents(); + + // Wait until newly opened tab is fully loaded. + EXPECT_TRUE(WaitForLoadStop(opened_tab)); + + EXPECT_NE(opened_tab, ntp_tab); + EXPECT_EQ(generic_url, opened_tab->GetLastCommittedURL()); + // New created tab should not reside in an Instant process. + EXPECT_FALSE(instant_service->IsInstantProcess( + opened_tab->GetMainFrame()->GetProcess()->GetID())); +} + } // namespace content
diff --git a/chrome/browser/chrome_do_not_track_browsertest.cc b/chrome/browser/chrome_do_not_track_browsertest.cc index a42513c5..b5f043c 100644 --- a/chrome/browser/chrome_do_not_track_browsertest.cc +++ b/chrome/browser/chrome_do_not_track_browsertest.cc
@@ -69,7 +69,8 @@ const GURL fetch_url = embedded_test_server()->GetURL("/echoheader?DNT"); const GURL url = embedded_test_server()->GetURL( - std::string("/workers/fetch_from_worker.html")); + std::string("/workers/fetch_from_worker.html?" + "script=fetch_from_worker.js")); ui_test_utils::NavigateToURL(browser(), url); const std::string script = "fetch_from_worker('" + fetch_url.spec() + "');"; @@ -82,15 +83,44 @@ ExpectPageTextEq("1"); // Updating settings should be reflected immediately. - // Disabled due to crbug.com/853085. - // - // SetEnableDoNotTrack(false /* enabled */); - // ASSERT_TRUE(ExecJs(GetWebContents(), script)); - // { - // content::TitleWatcher watcher(GetWebContents(), title); - // EXPECT_EQ(title, watcher.WaitAndGetTitle()); - // } - // ExpectPageTextEq("None"); + SetEnableDoNotTrack(false /* enabled */); + ASSERT_TRUE(ExecJs(GetWebContents(), script)); + { + content::TitleWatcher watcher(GetWebContents(), title); + EXPECT_EQ(title, watcher.WaitAndGetTitle()); + } + ExpectPageTextEq("None"); +} + +// Checks that the DNT header is preserved when fetching from a dedicated +// worker created from a dedicated worker. +IN_PROC_BROWSER_TEST_F(ChromeDoNotTrackTest, FetchFromNestedWorker) { + ASSERT_TRUE(embedded_test_server()->Start()); + SetEnableDoNotTrack(true /* enabled */); + + const GURL fetch_url = embedded_test_server()->GetURL("/echoheader?DNT"); + const GURL url = embedded_test_server()->GetURL( + std::string("/workers/fetch_from_worker.html?" + "script=fetch_from_nested_worker.js")); + ui_test_utils::NavigateToURL(browser(), url); + + const std::string script = "fetch_from_worker('" + fetch_url.spec() + "');"; + ASSERT_TRUE(ExecJs(GetWebContents(), script)); + const base::string16 title = base::ASCIIToUTF16("DONE"); + { + content::TitleWatcher watcher(GetWebContents(), title); + EXPECT_EQ(title, watcher.WaitAndGetTitle()); + } + ExpectPageTextEq("1"); + + // Updating settings should be reflected immediately. + SetEnableDoNotTrack(false /* enabled */); + ASSERT_TRUE(ExecJs(GetWebContents(), script)); + { + content::TitleWatcher watcher(GetWebContents(), title); + EXPECT_EQ(title, watcher.WaitAndGetTitle()); + } + ExpectPageTextEq("None"); } // Checks that the DNT header is preserved when fetching from a shared worker. @@ -122,15 +152,13 @@ ExpectPageTextEq("1"); // Updating settings should be reflected immediately. - // Disabled due to crbug.com/853085. - // - // SetEnableDoNotTrack(false /* enabled */); - // ASSERT_TRUE(ExecJs(GetWebContents(), script)); - // { - // content::TitleWatcher watcher(GetWebContents(), title); - // EXPECT_EQ(title, watcher.WaitAndGetTitle()); - // } - // ExpectPageTextEq("None"); + SetEnableDoNotTrack(false /* enabled */); + ASSERT_TRUE(ExecJs(GetWebContents(), script)); + { + content::TitleWatcher watcher(GetWebContents(), title); + EXPECT_EQ(title, watcher.WaitAndGetTitle()); + } + ExpectPageTextEq("None"); } // Checks that the DNT header is preserved when fetching from a service worker.
diff --git a/chrome/browser/chromeos/accessibility/chromevox_panel.cc b/chrome/browser/chromeos/accessibility/chromevox_panel.cc index 7fba88fb..6bf946b 100644 --- a/chrome/browser/chromeos/accessibility/chromevox_panel.cc +++ b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
@@ -18,16 +18,6 @@ const char kFocusURLFragment[] = "focus"; const char kFullscreenURLFragment[] = "fullscreen"; const char kWidgetName[] = "ChromeVoxPanel"; -const int kPanelHeight = 35; - -ash::mojom::AccessibilityControllerPtr GetAccessibilityController() { - // Connect to the accessibility mojo interface in ash. - ash::mojom::AccessibilityControllerPtr accessibility_controller; - content::ServiceManagerConnection::GetForProcess() - ->GetConnector() - ->BindInterface(ash::mojom::kServiceName, &accessibility_controller); - return accessibility_controller; -} } // namespace @@ -64,8 +54,6 @@ : AccessibilityPanel(browser_context, GetUrlForContent(), kWidgetName) { web_contents_observer_.reset( new ChromeVoxPanelWebContentsObserver(GetWebContents(), this)); - - SetAccessibilityPanelFullscreen(false); } ChromeVoxPanel::~ChromeVoxPanel() {} @@ -88,10 +76,12 @@ } void ChromeVoxPanel::SetAccessibilityPanelFullscreen(bool fullscreen) { - gfx::Rect bounds(0, 0, 0, kPanelHeight); - auto state = fullscreen ? ash::mojom::AccessibilityPanelState::FULLSCREEN - : ash::mojom::AccessibilityPanelState::FULL_WIDTH; - GetAccessibilityController()->SetAccessibilityPanelBounds(bounds, state); + // Connect to the accessibility mojo interface in ash. + ash::mojom::AccessibilityControllerPtr accessibility_controller; + content::ServiceManagerConnection::GetForProcess() + ->GetConnector() + ->BindInterface(ash::mojom::kServiceName, &accessibility_controller); + accessibility_controller->SetAccessibilityPanelFullscreen(fullscreen); } std::string ChromeVoxPanel::GetUrlForContent() {
diff --git a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc index 3253e83..35d9d97 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc
@@ -233,7 +233,10 @@ // Verifies that when a force-install list policy referencing an extension is // set and the cache is started, the loader downloads, caches and serves the // extension. -TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, ForceInstallListSet) { +// https://crbug.com/865453: Sometimes the last EXPECT fails because there are +// some irrelevant tasks still pending. +TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, + DISABLED_ForceInstallListSet) { // Set a force-install list policy that contains an invalid entry (which // should be ignored) and a valid reference to an extension. SetForceInstallListPolicy();
diff --git a/chrome/browser/chromeos/login/screens/reset_screen.cc b/chrome/browser/chromeos/login/screens/reset_screen.cc index 82cfd7f..6a45bf9 100644 --- a/chrome/browser/chromeos/login/screens/reset_screen.cc +++ b/chrome/browser/chromeos/login/screens/reset_screen.cc
@@ -75,6 +75,9 @@ case tpm_firmware_update::Mode::kPreserveDeviceState: mode_string = "preserve_stateful"; break; + case tpm_firmware_update::Mode::kCleanup: + mode_string = "cleanup"; + break; } if (mode_string.empty()) {
diff --git a/chrome/browser/chromeos/tpm_firmware_update.cc b/chrome/browser/chromeos/tpm_firmware_update.cc index 04ede59..3038238 100644 --- a/chrome/browser/chromeos/tpm_firmware_update.cc +++ b/chrome/browser/chromeos/tpm_firmware_update.cc
@@ -31,7 +31,7 @@ namespace { -// Checks whether |kSettingsKeyAllowPowerwash| is set to true in |settings|. +// Decodes a |settings| dictionary into a set of allowed update modes. std::set<Mode> GetModesFromSetting(const base::Value* settings) { std::set<Mode> modes; if (!settings) @@ -87,7 +87,11 @@ // away all the gory threading details. class AvailabilityChecker { public: - using ResponseCallback = base::OnceCallback<void(bool)>; + struct Status { + bool update_available = false; + bool srk_vulnerable_roca = false; + }; + using ResponseCallback = base::OnceCallback<void(const Status&)>; ~AvailabilityChecker() { Cancel(); } @@ -126,9 +130,19 @@ return update_location_file; } - static bool IsUpdateAvailable() { + static bool CheckAvailabilityStatus(Status* status) { int64_t size; - return base::GetFileSize(GetUpdateLocationFilePath(), &size) && size; + if (!base::GetFileSize(GetUpdateLocationFilePath(), &size)) { + // File doesn't exist or error - can't determine availability status. + return false; + } + status->update_available = size > 0; + base::FilePath srk_vulnerable_roca_file; + CHECK(base::PathService::Get( + chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA, + &srk_vulnerable_roca_file)); + status->srk_vulnerable_roca = base::PathExists(srk_vulnerable_roca_file); + return true; } static void StartOnBackgroundThread( @@ -144,18 +158,18 @@ base::WeakPtr<AvailabilityChecker> checker, const base::FilePath& target, bool error) { - bool available = IsUpdateAvailable(); - if (available || error) { + Status status; + if (CheckAvailabilityStatus(&status) || error) { origin_task_runner->PostTask( FROM_HERE, - base::BindOnce(&AvailabilityChecker::Resolve, checker, available)); + base::BindOnce(&AvailabilityChecker::Resolve, checker, status)); } } - void Resolve(bool available) { + void Resolve(const Status& status) { Cancel(); if (callback_) { - std::move(callback_).Run(available); + std::move(callback_).Run(status); } } @@ -173,10 +187,13 @@ // this function terminates. Thus, the final check needs to run independent // of |this| and takes |callback_| ownership. if (callback_) { - base::PostTaskAndReplyWithResult( - background_task_runner_.get(), FROM_HERE, - base::BindOnce(&AvailabilityChecker::IsUpdateAvailable), - std::move(callback_)); + base::PostTaskAndReplyWithResult(background_task_runner_.get(), FROM_HERE, + base::BindOnce([]() { + Status status; + CheckAvailabilityStatus(&status); + return status; + }), + std::move(callback_)); } } @@ -254,10 +271,25 @@ base::BindOnce( [](std::set<Mode> modes, base::OnceCallback<void(const std::set<Mode>&)> callback, - bool available) { - std::move(callback).Run(available ? modes : std::set<Mode>()); + const AvailabilityChecker::Status& status) { + DCHECK_LT(0U, modes.size()); + DCHECK_EQ(0U, modes.count(Mode::kCleanup)); + if (status.update_available) { + std::move(callback).Run(modes); + return; + } + + // If there is no update, but the SRK is vulnerable, allow cleanup + // to take place. Note that at least one allowed actual mode is + // allowed, which is taken to imply cleanup is also allowed. + if (status.srk_vulnerable_roca) { + std::move(callback).Run(std::set<Mode>({Mode::kCleanup})); + return; + } + + std::move(callback).Run(std::set<Mode>()); }, - std::move(modes), callback), + std::move(modes), std::move(callback)), timeout); }
diff --git a/chrome/browser/chromeos/tpm_firmware_update.h b/chrome/browser/chromeos/tpm_firmware_update.h index d45728f..e6f5161 100644 --- a/chrome/browser/chromeos/tpm_firmware_update.h +++ b/chrome/browser/chromeos/tpm_firmware_update.h
@@ -32,6 +32,9 @@ kPowerwash = 1, // Device-state preserving update flow. Destroys all user data. kPreserveDeviceState = 2, + // Force clear TPM after successful update, useful to flush out vulnerable + // SRK that might be left behind. + kCleanup = 3, }; // Settings dictionary key constants.
diff --git a/chrome/browser/chromeos/tpm_firmware_update_unittest.cc b/chrome/browser/chromeos/tpm_firmware_update_unittest.cc index 18bb708..3a0cd0e2 100644 --- a/chrome/browser/chromeos/tpm_firmware_update_unittest.cc +++ b/chrome/browser/chromeos/tpm_firmware_update_unittest.cc
@@ -43,7 +43,8 @@ public: enum class Availability { kPending, - kUnavailble, + kUnavailable, + kUnavailableROCAVulnerable, kAvailable, }; @@ -55,9 +56,16 @@ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); base::FilePath update_location_path = temp_dir_.GetPath().AppendASCII("tpm_firmware_update_location"); - path_override_ = std::make_unique<base::ScopedPathOverride>( + path_override_location_ = std::make_unique<base::ScopedPathOverride>( chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION, update_location_path, update_location_path.IsAbsolute(), false); + base::FilePath srk_vulnerable_roca_path = temp_dir_.GetPath().AppendASCII( + "tpm_firmware_update_srk_vulnerable_roca"); + path_override_srk_vulnerable_roca_ = + std::make_unique<base::ScopedPathOverride>( + chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA, + srk_vulnerable_roca_path, srk_vulnerable_roca_path.IsAbsolute(), + false); SetUpdateAvailability(Availability::kAvailable); callback_ = base::BindOnce(&TPMFirmwareUpdateModesTest::RecordResponse, base::Unretained(this)); @@ -69,6 +77,22 @@ } void SetUpdateAvailability(Availability availability) { + base::FilePath srk_vulnerable_roca_path; + ASSERT_TRUE(base::PathService::Get( + chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA, + &srk_vulnerable_roca_path)); + switch (availability) { + case Availability::kPending: + case Availability::kUnavailable: + base::DeleteFile(srk_vulnerable_roca_path, false); + break; + case Availability::kAvailable: + case Availability::kUnavailableROCAVulnerable: + ASSERT_TRUE(base::ImportantFileWriter::WriteFileAtomically( + srk_vulnerable_roca_path, "")); + break; + } + base::FilePath update_location_path; ASSERT_TRUE(base::PathService::Get( chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION, @@ -77,7 +101,8 @@ case Availability::kPending: base::DeleteFile(update_location_path, false); break; - case Availability::kUnavailble: + case Availability::kUnavailable: + case Availability::kUnavailableROCAVulnerable: ASSERT_TRUE(base::ImportantFileWriter::WriteFileAtomically( update_location_path, "")); break; @@ -91,7 +116,8 @@ std::unique_ptr<base::test::ScopedFeatureList> feature_list_; base::ScopedTempDir temp_dir_; - std::unique_ptr<base::ScopedPathOverride> path_override_; + std::unique_ptr<base::ScopedPathOverride> path_override_location_; + std::unique_ptr<base::ScopedPathOverride> path_override_srk_vulnerable_roca_; base::test::ScopedTaskEnvironment scoped_task_environment_{ base::test::ScopedTaskEnvironment::MainThreadType::MOCK_TIME}; ScopedCrosSettingsTestHelper cros_settings_test_helper_; @@ -163,6 +189,22 @@ EXPECT_FALSE(callback_received_); } +TEST_F(TPMFirmwareUpdateModesTest, NoUpdateVulnerableSRK) { + SetUpdateAvailability(Availability::kUnavailableROCAVulnerable); + GetAvailableUpdateModes(std::move(callback_), base::TimeDelta()); + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(callback_received_); + EXPECT_EQ(std::set<Mode>{Mode::kCleanup}, callback_modes_); +} + +TEST_F(TPMFirmwareUpdateModesTest, NoUpdateNonVulnerableSRK) { + SetUpdateAvailability(Availability::kUnavailable); + GetAvailableUpdateModes(std::move(callback_), base::TimeDelta()); + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(callback_received_); + EXPECT_EQ(std::set<Mode>(), callback_modes_); +} + TEST_F(TPMFirmwareUpdateModesTest, Timeout) { SetUpdateAvailability(Availability::kPending); GetAvailableUpdateModes(std::move(callback_), @@ -251,5 +293,14 @@ EXPECT_EQ(std::set<Mode>({Mode::kPreserveDeviceState}), callback_modes_); } +TEST_F(TPMFirmwareUpdateModesEnterpriseTest, VulnerableSRK) { + SetUpdateAvailability(Availability::kUnavailableROCAVulnerable); + SetPolicy({Mode::kPreserveDeviceState}); + GetAvailableUpdateModes(std::move(callback_), base::TimeDelta()); + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(callback_received_); + EXPECT_EQ(std::set<Mode>({Mode::kCleanup}), callback_modes_); +} + } // namespace tpm_firmware_update } // namespace chromeos
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc index c602d40c..422c5713 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
@@ -268,6 +268,12 @@ return registry->enabled_extensions().GetByID(effective_url.host()); } +bool HasEffectiveUrl(content::BrowserContext* browser_context, + const GURL& url) { + return ChromeContentBrowserClientExtensionsPart::GetEffectiveURL( + Profile::FromBrowserContext(browser_context), url) != url; +} + } // namespace ChromeContentBrowserClientExtensionsPart:: @@ -330,6 +336,35 @@ } // static +bool ChromeContentBrowserClientExtensionsPart:: + ShouldCompareEffectiveURLsForSiteInstanceSelection( + content::BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url) { + // Don't compare effective URLs for any subframe navigations, since we don't + // want to create OOPIFs based on that mechanism (e.g., for hosted apps). For + // main frames, don't compare effective URLs when transitioning from app to + // non-app URLs if there exists another app WebContents that might script + // this one. These navigations should stay in the app process to not break + // scripting when a hosted app opens a same-site popup. See + // https://crbug.com/718516 and https://crbug.com/828720 and + // https://crbug.com/859062. + if (!is_main_frame) + return false; + size_t candidate_active_contents_count = + candidate_site_instance->GetRelatedActiveContentsCount(); + bool src_has_effective_url = HasEffectiveUrl(browser_context, candidate_url); + bool dest_has_effective_url = + HasEffectiveUrl(browser_context, destination_url); + if (src_has_effective_url && !dest_has_effective_url && + candidate_active_contents_count > 1u) + return false; + return true; +} + +// static bool ChromeContentBrowserClientExtensionsPart::ShouldUseProcessPerSite( Profile* profile, const GURL& effective_url) { const Extension* extension =
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h index 4cda9e87..d5ed7944 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
@@ -36,6 +36,12 @@ // Corresponds to the ChromeContentBrowserClient function of the same name. static GURL GetEffectiveURL(Profile* profile, const GURL& url); + static bool ShouldCompareEffectiveURLsForSiteInstanceSelection( + content::BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url); static bool ShouldUseProcessPerSite(Profile* profile, const GURL& effective_url); static bool ShouldUseSpareRenderProcessHost(Profile* profile,
diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc index a972dc9..ae3a4c1 100644 --- a/chrome/browser/extensions/startup_helper.cc +++ b/chrome/browser/extensions/startup_helper.cc
@@ -14,7 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/extensions/chrome_extensions_client.h" +#include "chrome/common/initialize_extensions_client.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/service_manager_connection.h" #include "extensions/browser/extension_file_task_runner.h" @@ -35,7 +35,7 @@ } // namespace StartupHelper::StartupHelper() : pack_job_succeeded_(false) { - ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); + EnsureExtensionsClientInitialized(); } void StartupHelper::OnPackSuccess(
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 3dce2be..8792fa1d 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -88,6 +88,11 @@ const char kAutofillPrefilledFieldsDescription[] = "Allows autofill to fill fields previously filled by the website"; +extern const char kAutofillPreviewStyleExperimentName[] = + "Autofill Preview Style Experiment"; +extern const char kAutofillPreviewStyleExperimentDescription[] = + "Allows experimentation with the Autofill field preview's style."; + const char kAutofillRationalizeRepeatedServerPredictionsName[] = "Autofill Rationalization of Repeated Server Field Type Predictions"; const char kAutofillRationalizeRepeatedServerPredictionsDescription[] = @@ -2161,10 +2166,6 @@ const char kAccessibilityTabSwitcherDescription[] = "Enable the accessibility tab switcher for Android."; -const char kAllowReaderForAccessibilityName[] = "Reader Mode for Accessibility"; -const char kAllowReaderForAccessibilityDescription[] = - "Allows Reader Mode on any articles, even if the page is mobile-friendly."; - const char kAndroidAutofillAccessibilityName[] = "Autofill Accessibility"; const char kAndroidAutofillAccessibilityDescription[] = "Enable accessibility for autofill popup."; @@ -3498,6 +3499,14 @@ const char kEnableInputImeApiDescription[] = "Enable the use of chrome.input.ime API."; +#if !defined(OS_CHROMEOS) + +const char kWarnBeforeQuittingFlagName[] = "Warn Before Quitting"; +const char kWarnBeforeQuittingFlagDescription[] = + "Confirm to quit by either holding the quit shortcut or pressing it twice."; + +#endif // !defined(OS_CHROMEOS) + #endif // defined(OS_WIN) || defined(OS_LINUX) #if defined(OS_WIN) || defined(OS_MACOSX)
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index bd20cf3f8..9178091 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -90,6 +90,9 @@ extern const char kAutofillPrefilledFieldsName[]; extern const char kAutofillPrefilledFieldsDescription[]; +extern const char kAutofillPreviewStyleExperimentName[]; +extern const char kAutofillPreviewStyleExperimentDescription[]; + extern const char kAutofillRationalizeRepeatedServerPredictionsName[]; extern const char kAutofillRationalizeRepeatedServerPredictionsDescription[]; @@ -1307,9 +1310,6 @@ extern const char kAccessibilityTabSwitcherName[]; extern const char kAccessibilityTabSwitcherDescription[]; -extern const char kAllowReaderForAccessibilityName[]; -extern const char kAllowReaderForAccessibilityDescription[]; - extern const char kAndroidAutofillAccessibilityName[]; extern const char kAndroidAutofillAccessibilityDescription[]; @@ -2136,6 +2136,13 @@ extern const char kEnableInputImeApiName[]; extern const char kEnableInputImeApiDescription[]; +#if !defined(OS_CHROMEOS) + +extern const char kWarnBeforeQuittingFlagName[]; +extern const char kWarnBeforeQuittingFlagDescription[]; + +#endif // !defined(OS_CHROMEOS) + #endif // defined(OS_WIN) || defined(OS_LINUX) extern const char kExperimentalUiName[];
diff --git a/chrome/browser/lifetime/browser_shutdown_browsertest.cc b/chrome/browser/lifetime/browser_shutdown_browsertest.cc index a8d1f9e..3931fb3 100644 --- a/chrome/browser/lifetime/browser_shutdown_browsertest.cc +++ b/chrome/browser/lifetime/browser_shutdown_browsertest.cc
@@ -82,7 +82,8 @@ #endif // !defined(OS_CHROMEOS) // EventGenerator doesn't work on Mac. See https://crbug.com/814675 -#if defined(OS_MACOSX) +// Flaking on Windows. See https://crbug.com/874370 +#if defined(OS_MACOSX) || defined(OS_WIN) #define MAYBE_ShutdownConfirmation DISABLED_ShutdownConfirmation #else #define MAYBE_ShutdownConfirmation ShutdownConfirmation @@ -105,5 +106,9 @@ generator.ReleaseKey(ui::VKEY_Q, modifiers); base::RunLoop().RunUntilIdle(); +#if defined(OS_CHROMEOS) EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); +#else + EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); +#endif }
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc index 44316d5..1a4e508 100644 --- a/chrome/browser/media/encrypted_media_browsertest.cc +++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -727,7 +727,6 @@ // be closed. // Flaky: crbug.com/832800 IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DISABLED_CDMCrashDuringDecode) { - IgnorePluginCrash(); TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, kEmeSessionClosedAndError); }
diff --git a/chrome/browser/media/media_browsertest.cc b/chrome/browser/media/media_browsertest.cc index d803014..cbc9e42 100644 --- a/chrome/browser/media/media_browsertest.cc +++ b/chrome/browser/media/media_browsertest.cc
@@ -17,7 +17,7 @@ #include "media/base/test_data_util.h" #include "net/test/embedded_test_server/embedded_test_server.h" -MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) {} +MediaBrowserTest::MediaBrowserTest() {} MediaBrowserTest::~MediaBrowserTest() {} @@ -47,8 +47,7 @@ const std::string& expected_title) { DVLOG(0) << base::TimeFormatTimeOfDayWithMilliseconds(base::Time::Now()) << " Running test URL: " << gurl; - // Observe the web contents for plugin crashes. - Observe(browser()->tab_strip_model()->GetActiveWebContents()); + content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), base::ASCIIToUTF16(expected_title)); @@ -63,15 +62,3 @@ title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kError)); title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kFailed)); } - -void MediaBrowserTest::PluginCrashed(const base::FilePath& plugin_path, - base::ProcessId plugin_pid) { - DVLOG(0) << "Plugin crashed: " << plugin_path.value(); - if (ignore_plugin_crash_) - return; - ADD_FAILURE() << "Failing test due to plugin crash."; -} - -void MediaBrowserTest::IgnorePluginCrash() { - ignore_plugin_crash_ = true; -}
diff --git a/chrome/browser/media/media_browsertest.h b/chrome/browser/media/media_browsertest.h index a7ec7db..9c50ba2 100644 --- a/chrome/browser/media/media_browsertest.h +++ b/chrome/browser/media/media_browsertest.h
@@ -8,7 +8,6 @@ #include <string> #include "chrome/test/base/in_process_browser_test.h" -#include "content/public/browser/web_contents_observer.h" #include "media/base/test_data_util.h" namespace content { @@ -18,8 +17,7 @@ // Class used to automate running media related browser tests. The functions // assume that media files are located under media/ folder known to the test // http server. -class MediaBrowserTest : public InProcessBrowserTest, - public content::WebContentsObserver { +class MediaBrowserTest : public InProcessBrowserTest { protected: MediaBrowserTest(); ~MediaBrowserTest() override; @@ -38,17 +36,6 @@ std::string RunTest(const GURL& gurl, const std::string& expected); virtual void AddWaitForTitles(content::TitleWatcher* title_watcher); - - // Fails test and sets document title to kPluginCrashed when a plugin crashes. - // If IgnorePluginCrash(true) is called then plugin crash is ignored. - void PluginCrashed(const base::FilePath& plugin_path, - base::ProcessId plugin_pid) override; - - // When called, the test will ignore any plugin crashes and not fail the test. - void IgnorePluginCrash(); - - private: - bool ignore_plugin_crash_; }; #endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
diff --git a/chrome/browser/net/network_context_configuration_browsertest.cc b/chrome/browser/net/network_context_configuration_browsertest.cc index 5854420..febb7bc 100644 --- a/chrome/browser/net/network_context_configuration_browsertest.cc +++ b/chrome/browser/net/network_context_configuration_browsertest.cc
@@ -1213,7 +1213,16 @@ EXPECT_FALSE(GetCookies(embedded_test_server()->base_url()).empty()); } -IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, CookiesEnabled) { +#if defined(OS_MACOSX) +// Disable the test on Mac OSX since it fails on the bot. +// (https://crbug.com/847555) +#define MAYBE_CookiesEnabled DISABLED_CookiesEnabled +#else +#define MAYBE_CookiesEnabled CookiesEnabled +#endif + +IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, + MAYBE_CookiesEnabled) { // Check that the cookie from the first stage of the test was / was not // preserved between browser restarts, as expected. bool has_cookies = !GetCookies(embedded_test_server()->base_url()).empty();
diff --git a/chrome/browser/password_manager/password_generation_interactive_uitest.cc b/chrome/browser/password_manager/password_generation_interactive_uitest.cc index 8eafd4b..120150ec 100644 --- a/chrome/browser/password_manager/password_generation_interactive_uitest.cc +++ b/chrome/browser/password_manager/password_generation_interactive_uitest.cc
@@ -300,8 +300,9 @@ EXPECT_TRUE(GenerationPopupShowing()); } +// https://crbug.com/791389 IN_PROC_BROWSER_TEST_F(PasswordGenerationInteractiveTest, - AutoSavingGeneratedPassword) { + DISABLED_AutoSavingGeneratedPassword) { scoped_refptr<password_manager::TestPasswordStore> password_store = static_cast<password_manager::TestPasswordStore*>( PasswordStoreFactory::GetForProfile( @@ -318,7 +319,9 @@ content::SimulateKeyPress(WebContents(), ui::DomKey::FromCharacter('U'), ui::DomCode::US_U, ui::VKEY_U, false, false, false, false); - WaitForElementValue("username_field", "U"); + content::SimulateKeyPress(WebContents(), ui::DomKey::FromCharacter('N'), + ui::DomCode::US_N, ui::VKEY_N, false, false, false, + false); // Submit form. NavigationObserver observer(WebContents()); @@ -335,6 +338,6 @@ password_store->stored_passwords(); EXPECT_EQ(1u, stored_passwords.size()); EXPECT_EQ(1u, stored_passwords.begin()->second.size()); - EXPECT_EQ(base::UTF8ToUTF16("U"), + EXPECT_EQ(base::UTF8ToUTF16("UN"), (stored_passwords.begin()->second)[0].username_value); }
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc index a668fe0..b61f63c4 100644 --- a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc +++ b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
@@ -424,6 +424,126 @@ .WaitAndGetTitle()); } +// Tests that when a custom control is clicked on a Picture-in-Picture window +// with one custom control on it, the correct event is sent to the caller. +IN_PROC_BROWSER_TEST_F(ControlPictureInPictureWindowControllerBrowserTest, + PictureInPictureAddControlAndFireEvent) { + GURL test_page_url = ui_test_utils::GetTestUrl( + base::FilePath(base::FilePath::kCurrentDirectory), + base::FilePath( + FILE_PATH_LITERAL("media/picture-in-picture/window-size.html"))); + ui_test_utils::NavigateToURL(browser(), test_page_url); + + content::WebContents* active_web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(active_web_contents); + + SetUpWindowController(active_web_contents); + ASSERT_TRUE(window_controller()); + + content::OverlayWindow* overlay_window = + window_controller()->GetWindowForTesting(); + ASSERT_TRUE(overlay_window); + ASSERT_FALSE(overlay_window->IsVisible()); + + LoadTabAndEnterPictureInPicture(browser()); + + const std::string kControlId = "control_id"; + EXPECT_EQ(true, content::EvalJs( + active_web_contents, + content::JsReplace("setControls([$1]);", kControlId))); + + base::string16 expected_title = base::ASCIIToUTF16(kControlId); + + static_cast<OverlayWindowViews*>(overlay_window) + ->ClickCustomControl(kControlId); + EXPECT_EQ(expected_title, + content::TitleWatcher(active_web_contents, expected_title) + .WaitAndGetTitle()); +} + +// Tests that when the first custom control added to a Picture-in-Picture window +// with two custom controls on it is clicked the corresponding event is sent to +// the caller. +IN_PROC_BROWSER_TEST_F(ControlPictureInPictureWindowControllerBrowserTest, + PictureInPictureAddTwoControlsAndFireLeftEvent) { + GURL test_page_url = ui_test_utils::GetTestUrl( + base::FilePath(base::FilePath::kCurrentDirectory), + base::FilePath( + FILE_PATH_LITERAL("media/picture-in-picture/window-size.html"))); + ui_test_utils::NavigateToURL(browser(), test_page_url); + + content::WebContents* active_web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(active_web_contents); + + SetUpWindowController(active_web_contents); + ASSERT_TRUE(window_controller()); + + content::OverlayWindow* overlay_window = + window_controller()->GetWindowForTesting(); + ASSERT_TRUE(overlay_window); + ASSERT_FALSE(overlay_window->IsVisible()); + + LoadTabAndEnterPictureInPicture(browser()); + + const std::string kLeftControlId = "left-control"; + const std::string kRightControlId = "right-control"; + EXPECT_EQ(true, content::EvalJs( + active_web_contents, + content::JsReplace("setControls([$1, $2]);", + kLeftControlId, kRightControlId))); + + base::string16 left_expected_title = base::ASCIIToUTF16(kLeftControlId); + + static_cast<OverlayWindowViews*>(overlay_window) + ->ClickCustomControl(kLeftControlId); + EXPECT_EQ(left_expected_title, + content::TitleWatcher(active_web_contents, left_expected_title) + .WaitAndGetTitle()); +} + +// Tests that when the second custom control added to a Picture-in-Picture +// window with two custom controls on it is clicked the corresponding event is +// sent to the caller. +IN_PROC_BROWSER_TEST_F(ControlPictureInPictureWindowControllerBrowserTest, + PictureInPictureAddTwoControlsAndFireRightEvent) { + GURL test_page_url = ui_test_utils::GetTestUrl( + base::FilePath(base::FilePath::kCurrentDirectory), + base::FilePath( + FILE_PATH_LITERAL("media/picture-in-picture/window-size.html"))); + ui_test_utils::NavigateToURL(browser(), test_page_url); + + content::WebContents* active_web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(active_web_contents); + + SetUpWindowController(active_web_contents); + ASSERT_TRUE(window_controller()); + + content::OverlayWindow* overlay_window = + window_controller()->GetWindowForTesting(); + ASSERT_TRUE(overlay_window); + ASSERT_FALSE(overlay_window->IsVisible()); + + LoadTabAndEnterPictureInPicture(browser()); + + const std::string kLeftControlId = "left-control"; + const std::string kRightControlId = "right-control"; + EXPECT_EQ(true, content::EvalJs( + active_web_contents, + content::JsReplace("setControls([$1, $2]);", + kLeftControlId, kRightControlId))); + + base::string16 right_expected_title = base::ASCIIToUTF16(kRightControlId); + + static_cast<OverlayWindowViews*>(overlay_window) + ->ClickCustomControl(kRightControlId); + EXPECT_EQ(right_expected_title, + content::TitleWatcher(active_web_contents, right_expected_title) + .WaitAndGetTitle()); +} + #endif // !defined(OS_ANDROID) // Tests that when closing a Picture-in-Picture window, the video element is @@ -702,9 +822,8 @@ OverlayWindowViews* overlay_window = static_cast<OverlayWindowViews*>( window_controller()->GetWindowForTesting()); - EXPECT_FALSE(overlay_window->play_pause_controls_view_for_testing() - ->layer() - ->visible()); + EXPECT_FALSE( + overlay_window->controls_parent_view_for_testing()->layer()->visible()); #endif }
diff --git a/chrome/browser/prefs/pref_service_incognito_whitelist.cc b/chrome/browser/prefs/pref_service_incognito_whitelist.cc index d976e9a..e5bd2dde 100644 --- a/chrome/browser/prefs/pref_service_incognito_whitelist.cc +++ b/chrome/browser/prefs/pref_service_incognito_whitelist.cc
@@ -19,8 +19,6 @@ #include "components/metrics/metrics_pref_names.h" #include "components/omnibox/browser/omnibox_pref_names.h" #include "components/onc/onc_pref_names.h" -#include "components/proxy_config/proxy_config_pref_names.h" -#include "components/proxy_config/proxy_prefs.h" #include "components/rappor/rappor_pref_names.h" #include "components/reading_list/core/reading_list_pref_names.h" #include "components/search_engines/search_engines_pref_names.h" @@ -782,15 +780,6 @@ onc::prefs::kDeviceOpenNetworkConfiguration, onc::prefs::kOpenNetworkConfiguration, - // components/proxy_config/proxy_config_pref_names.h - // proxy_config::prefs::kProxy, - proxy_config::prefs::kUseSharedProxies, - - // components/proxy_config/proxy_prefs.h - ProxyPrefs::kDirectProxyModeName, ProxyPrefs::kAutoDetectProxyModeName, - ProxyPrefs::kPacScriptProxyModeName, ProxyPrefs::kFixedServersProxyModeName, - ProxyPrefs::kSystemProxyModeName, - // components/reading_list/core/reading_list_pref_names.h reading_list::prefs::kReadingListHasUnseenEntries,
diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc index 5c8bdc8c..fbe1a47b 100644 --- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
@@ -1311,10 +1311,17 @@ DISALLOW_COPY_AND_ASSIGN(ShowDefinitionForWordObserver); }; +#if defined(OS_MACOSX) +#define MAYBE_LookUpStringForRangeRoutesToFocusedWidget \ + DISABLED_LookUpStringForRangeRoutesToFocusedWidget +#else +#define MAYBE_LookUpStringForRangeRoutesToFocusedWidget \ + LookUpStringForRangeRoutesToFocusedWidget +#endif // This test verifies that requests for dictionary lookup based on selection // range are routed to the focused RenderWidgetHost. IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, - LookUpStringForRangeRoutesToFocusedWidget) { + MAYBE_LookUpStringForRangeRoutesToFocusedWidget) { CreateIframePage("a(b)"); std::vector<content::RenderFrameHost*> frames{GetFrame(IndexVector{}), GetFrame(IndexVector{0})};
diff --git a/chrome/browser/resources/local_ntp/custom_links_edit.js b/chrome/browser/resources/local_ntp/custom_links_edit.js index f86a081..4c4f06e 100644 --- a/chrome/browser/resources/local_ntp/custom_links_edit.js +++ b/chrome/browser/resources/local_ntp/custom_links_edit.js
@@ -337,10 +337,10 @@ }); $(IDS.DELETE).addEventListener('click', deleteLink); $(IDS.CANCEL).addEventListener('click', closeDialog); - $(IDS.DONE).addEventListener('click', finishEditLink); $(IDS.FORM).addEventListener('submit', (event) => { // Prevent the form from submitting and modifying the URL. event.preventDefault(); + finishEditLink(); }); let finishEditOrClose = (event) => { if (event.keyCode === KEYCODES.ENTER) {
diff --git a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc index 86c3072..c7e32399 100644 --- a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc +++ b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc
@@ -217,7 +217,8 @@ AdsPageLoadMetricsObserver::AdOriginStatus::kSame, 1); } -IN_PROC_BROWSER_TEST_F(AdTaggingBrowserTest, VerifyCrossOriginWithoutNavigate) { +IN_PROC_BROWSER_TEST_F(AdTaggingBrowserTest, + DISABLED_VerifyCrossOriginWithoutNavigate) { base::HistogramTester histogram_tester; // Main frame.
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index b458481..2a9ae635 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2333,11 +2333,10 @@ sources += [ "input_method/input_method_engine.cc", "input_method/input_method_engine.h", - "views/quit_instruction_bubble.cc", - "views/quit_instruction_bubble.h", - "views/quit_instruction_bubble_base.h", - "views/quit_instruction_bubble_controller.cc", - "views/quit_instruction_bubble_controller.h", + "views/confirm_quit_bubble.cc", + "views/confirm_quit_bubble.h", + "views/confirm_quit_bubble_controller.cc", + "views/confirm_quit_bubble_controller.h", ] } } @@ -2913,6 +2912,8 @@ "views/login_view.h", "views/overlay/close_image_button.cc", "views/overlay/close_image_button.h", + "views/overlay/control_image_button.cc", + "views/overlay/control_image_button.h", "views/overlay/overlay_window_views.cc", "views/overlay/overlay_window_views.h", "views/page_info/chosen_object_view.cc",
diff --git a/chrome/browser/ui/ash/accessibility/accessibility_controller_client_unittest.cc b/chrome/browser/ui/ash/accessibility/accessibility_controller_client_unittest.cc index 26a760a..d031b97 100644 --- a/chrome/browser/ui/ash/accessibility/accessibility_controller_client_unittest.cc +++ b/chrome/browser/ui/ash/accessibility/accessibility_controller_client_unittest.cc
@@ -38,10 +38,7 @@ void BrailleDisplayStateChanged(bool connected) override {} void SetFocusHighlightRect(const gfx::Rect& bounds_in_screen) override {} void SetCaretBounds(const gfx::Rect& bounds_in_screen) override {} - void SetAccessibilityPanelAlwaysVisible(bool always_visible) override {} - void SetAccessibilityPanelBounds( - const gfx::Rect& bounds, - ash::mojom::AccessibilityPanelState state) override {} + void SetAccessibilityPanelFullscreen(bool fullscreen) override {} void SetSelectToSpeakState(ash::mojom::SelectToSpeakState state) override {} bool was_client_set() const { return was_client_set_; }
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 3d17b26..af26865 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -691,6 +691,11 @@ ShowPageInfoDialog(browser_->tab_strip_model()->GetActiveWebContents(), bubble_anchor_util::kAppMenuButton); break; +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + case IDC_TOGGLE_CONFIRM_TO_QUIT_OPTION: + ToggleConfirmToQuitOption(browser_); + break; +#endif default: LOG(WARNING) << "Received Unimplemented Command: " << id; @@ -885,6 +890,8 @@ !profile()->IsOffTheRecord()); command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, !guest_session); + command_updater_.UpdateCommandEnabled(IDC_TOGGLE_CONFIRM_TO_QUIT_OPTION, + true); #if defined(OS_CHROMEOS) command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true); #else
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index 231eefca..92b7f16 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -634,6 +634,12 @@ return Profiling::BeingProfiled(); if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) return chrome::IsRequestingTabletSite(browser_); +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + if (command_id == IDC_TOGGLE_CONFIRM_TO_QUIT_OPTION) { + return browser_->profile()->GetPrefs()->GetBoolean( + prefs::kConfirmToQuitEnabled); + } +#endif return false; } @@ -801,6 +807,16 @@ if (browser_defaults::kShowExitMenuItem) { AddSeparator(ui::NORMAL_SEPARATOR); +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + if (base::FeatureList::IsEnabled(features::kWarnBeforeQuitting)) { + AddCheckItem(IDC_TOGGLE_CONFIRM_TO_QUIT_OPTION, + l10n_util::GetStringFUTF16( + IDS_CONFIRM_TO_QUIT_OPTION, + ui::Accelerator(ui::VKEY_Q, + ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN) + .GetShortcutText())); + } +#endif AddItemWithStringId(IDC_EXIT, IDS_EXIT); } uma_action_recorded_ = false;
diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc index 1bb9442..e0d08c7a 100644 --- a/chrome/browser/ui/views/accelerator_table.cc +++ b/chrome/browser/ui/views/accelerator_table.cc
@@ -151,6 +151,7 @@ {ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, IDC_FOCUS_SEARCH}, {ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_PLATFORM_ACCELERATOR, IDC_SHOW_AVATAR_MENU}, + {ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_EXIT}, #endif // !OS_CHROMEOS #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_MACOSX)
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc index 1782078..b7594fe 100644 --- a/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc +++ b/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc
@@ -33,7 +33,7 @@ // TODO(jackhou): Make this behavior the same as other platforms, i.e. calling // Maximize() does not also show the window. if (!tree_host_->IsVisible()) - DesktopNativeWidgetAura::Show(); + DesktopNativeWidgetAura::Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); DesktopNativeWidgetAura::Maximize(); } @@ -43,6 +43,6 @@ // TODO(jackhou): Make this behavior the same as other platforms, i.e. calling // Minimize() does not also show the window. if (!tree_host_->IsVisible()) - DesktopNativeWidgetAura::Show(); + DesktopNativeWidgetAura::Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); DesktopNativeWidgetAura::Minimize(); }
diff --git a/chrome/browser/ui/views/quit_instruction_bubble.cc b/chrome/browser/ui/views/confirm_quit_bubble.cc similarity index 78% rename from chrome/browser/ui/views/quit_instruction_bubble.cc rename to chrome/browser/ui/views/confirm_quit_bubble.cc index 7753304..b01be11f 100644 --- a/chrome/browser/ui/views/quit_instruction_bubble.cc +++ b/chrome/browser/ui/views/confirm_quit_bubble.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/views/quit_instruction_bubble.h" +#include "chrome/browser/ui/views/confirm_quit_bubble.h" #include <utility> @@ -29,23 +29,22 @@ } // namespace -QuitInstructionBubble::QuitInstructionBubble() +ConfirmQuitBubble::ConfirmQuitBubble() : animation_(std::make_unique<gfx::SlideAnimation>(this)) { animation_->SetSlideDuration(kSlideDuration.InMilliseconds()); } -QuitInstructionBubble::~QuitInstructionBubble() {} +ConfirmQuitBubble::~ConfirmQuitBubble() {} -void QuitInstructionBubble::Show() { +void ConfirmQuitBubble::Show() { animation_->Show(); } -void QuitInstructionBubble::Hide() { +void ConfirmQuitBubble::Hide() { animation_->Hide(); } -void QuitInstructionBubble::AnimationProgressed( - const gfx::Animation* animation) { +void ConfirmQuitBubble::AnimationProgressed(const gfx::Animation* animation) { float opacity = static_cast<float>(animation->CurrentValueBetween(0.0, 1.0)); if (opacity == 0) { popup_.reset(); @@ -69,10 +68,10 @@ popup_->SetContentsView(view); view->UpdateContent(l10n_util::GetStringFUTF16( - IDS_QUIT_ACCELERATOR_TUTORIAL, - l10n_util::GetStringUTF16(IDS_APP_ALT_KEY), - ui::Accelerator(ui::VKEY_F, 0).GetShortcutText(), - ui::Accelerator(ui::VKEY_X, 0).GetShortcutText())); + IDS_CONFIRM_TO_QUIT_DESCRIPTION, + l10n_util::GetStringUTF16(IDS_APP_CTRL_KEY), + l10n_util::GetStringUTF16(IDS_APP_SHIFT_KEY), + ui::Accelerator(ui::VKEY_Q, 0).GetShortcutText())); popup_->CenterWindow(view->GetPreferredSize()); @@ -82,6 +81,6 @@ } } -void QuitInstructionBubble::AnimationEnded(const gfx::Animation* animation) { +void ConfirmQuitBubble::AnimationEnded(const gfx::Animation* animation) { AnimationProgressed(animation); }
diff --git a/chrome/browser/ui/views/quit_instruction_bubble.h b/chrome/browser/ui/views/confirm_quit_bubble.h similarity index 61% rename from chrome/browser/ui/views/quit_instruction_bubble.h rename to chrome/browser/ui/views/confirm_quit_bubble.h index 60fd412..b4de3d0 100644 --- a/chrome/browser/ui/views/quit_instruction_bubble.h +++ b/chrome/browser/ui/views/confirm_quit_bubble.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_H_ -#define CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_H_ +#ifndef CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_H_ +#define CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_H_ #include <memory> #include "base/macros.h" -#include "chrome/browser/ui/views/quit_instruction_bubble_base.h" +#include "chrome/browser/ui/views/confirm_quit_bubble_base.h" #include "ui/gfx/animation/animation_delegate.h" namespace gfx { @@ -20,13 +20,13 @@ class Widget; } // namespace views -// Manages showing and hiding a notification bubble that gives instructions for -// how to quit using keyboard shortcuts. -class QuitInstructionBubble : public QuitInstructionBubbleBase, - public gfx::AnimationDelegate { +// Manages showing and hiding a notification bubble that gives instructions to +// continue holding the quit accelerator to quit. +class ConfirmQuitBubble : public ConfirmQuitBubbleBase, + public gfx::AnimationDelegate { public: - QuitInstructionBubble(); - ~QuitInstructionBubble() override; + ConfirmQuitBubble(); + ~ConfirmQuitBubble() override; void Show() override; void Hide() override; @@ -41,7 +41,7 @@ std::unique_ptr<views::Widget> popup_; - DISALLOW_COPY_AND_ASSIGN(QuitInstructionBubble); + DISALLOW_COPY_AND_ASSIGN(ConfirmQuitBubble); }; -#endif // CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_H_ +#endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_H_
diff --git a/chrome/browser/ui/views/confirm_quit_bubble_base.h b/chrome/browser/ui/views/confirm_quit_bubble_base.h new file mode 100644 index 0000000..8bd73c2 --- /dev/null +++ b/chrome/browser/ui/views/confirm_quit_bubble_base.h
@@ -0,0 +1,19 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_BASE_H_ +#define CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_BASE_H_ + +// Base class of ConfirmQuitBubble necessary for unit testing +// ConfirmQuitBubbleController. +class ConfirmQuitBubbleBase { + public: + ConfirmQuitBubbleBase() {} + virtual ~ConfirmQuitBubbleBase() {} + + virtual void Show() = 0; + virtual void Hide() = 0; +}; + +#endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_BASE_H_
diff --git a/chrome/browser/ui/views/confirm_quit_bubble_controller.cc b/chrome/browser/ui/views/confirm_quit_bubble_controller.cc new file mode 100644 index 0000000..5fcf01f --- /dev/null +++ b/chrome/browser/ui/views/confirm_quit_bubble_controller.cc
@@ -0,0 +1,211 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/confirm_quit_bubble_controller.h" + +#include <utility> + +#include "base/feature_list.h" +#include "base/memory/singleton.h" +#include "chrome/browser/chrome_notification_types.h" +#include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/confirm_quit.h" +#include "chrome/browser/ui/views/confirm_quit_bubble.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/common/chrome_features.h" +#include "chrome/common/pref_names.h" +#include "content/public/browser/notification_service.h" +#include "ui/base/accelerators/accelerator.h" +#include "ui/events/keycodes/keyboard_codes.h" +#include "ui/gfx/animation/animation.h" +#include "ui/gfx/animation/slide_animation.h" + +namespace { + +constexpr ui::KeyboardCode kAcceleratorKeyCode = ui::VKEY_Q; +constexpr int kAcceleratorModifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN; + +} // namespace + +// static +ConfirmQuitBubbleController* ConfirmQuitBubbleController::GetInstance() { + return base::Singleton<ConfirmQuitBubbleController>::get(); +} + +ConfirmQuitBubbleController::ConfirmQuitBubbleController() + : ConfirmQuitBubbleController(std::make_unique<ConfirmQuitBubble>(), + std::make_unique<base::OneShotTimer>(), + std::make_unique<gfx::SlideAnimation>(this)) { +} + +ConfirmQuitBubbleController::ConfirmQuitBubbleController( + std::unique_ptr<ConfirmQuitBubbleBase> bubble, + std::unique_ptr<base::OneShotTimer> hide_timer, + std::unique_ptr<gfx::SlideAnimation> animation) + : view_(std::move(bubble)), + state_(State::kWaiting), + hide_timer_(std::move(hide_timer)), + browser_hide_animation_(std::move(animation)) { + browser_hide_animation_->SetSlideDuration( + confirm_quit::kWindowFadeOutDuration.InMilliseconds()); + BrowserList::AddObserver(this); + registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, + content::NotificationService::AllSources()); +} + +ConfirmQuitBubbleController::~ConfirmQuitBubbleController() { + BrowserList::RemoveObserver(this); +} + +void ConfirmQuitBubbleController::OnKeyEvent(ui::KeyEvent* event) { + const ui::Accelerator accelerator(*event); + if (state_ == State::kQuitting) + return; + if (accelerator.key_code() == kAcceleratorKeyCode && + accelerator.modifiers() == kAcceleratorModifiers && + accelerator.key_state() == ui::Accelerator::KeyState::PRESSED && + !accelerator.IsRepeat()) { + if (state_ == State::kWaiting) { + Browser* browser = BrowserList::GetInstance()->GetLastActive(); + PrefService* prefs = browser ? browser->profile()->GetPrefs() : nullptr; + if (!IsFeatureEnabled() || + (prefs && !prefs->GetBoolean(prefs::kConfirmToQuitEnabled))) { + confirm_quit::RecordHistogram(confirm_quit::kNoConfirm); + Quit(); + event->SetHandled(); + return; + } + if (browser) { + browser_ = browser; + pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>(); + pref_change_registrar_->Init(prefs); + pref_change_registrar_->Add( + prefs::kConfirmToQuitEnabled, + base::BindRepeating( + &ConfirmQuitBubbleController::OnConfirmToQuitPrefChanged, + base::Unretained(this))); + } + state_ = State::kPressed; + view_->Show(); + hide_timer_->Start(FROM_HERE, confirm_quit::kShowDuration, this, + &ConfirmQuitBubbleController::OnTimerElapsed); + event->SetHandled(); + } else if (state_ == State::kReleased) { + // The accelerator was pressed while the bubble was showing. Consider + // this a confirmation to quit. + second_press_start_time_ = accelerator.time_stamp(); + ConfirmQuit(); + event->SetHandled(); + } + } else if (accelerator.key_code() == kAcceleratorKeyCode && + accelerator.key_state() == ui::Accelerator::KeyState::RELEASED) { + if (state_ == State::kPressed) { + state_ = State::kReleased; + event->SetHandled(); + } else if (state_ == State::kConfirmed) { + if (!second_press_start_time_.is_null()) { + if (accelerator.time_stamp() - second_press_start_time_ < + confirm_quit::kDoubleTapTimeDelta) { + confirm_quit::RecordHistogram(confirm_quit::kDoubleTap); + } else { + confirm_quit::RecordHistogram(confirm_quit::kTapHold); + } + } + Quit(); + event->SetHandled(); + } + } +} + +void ConfirmQuitBubbleController::OnBrowserRemoved(Browser* browser) { + // A browser is definitely no longer active if it is removed. + OnBrowserNoLongerActive(browser); +} + +void ConfirmQuitBubbleController::OnBrowserNoLongerActive(Browser* browser) { + if (browser == browser_) + Reset(); +} + +void ConfirmQuitBubbleController::DoQuit() { + chrome::Exit(); +} + +bool ConfirmQuitBubbleController::IsFeatureEnabled() { + return base::FeatureList::IsEnabled(features::kWarnBeforeQuitting); +} + +void ConfirmQuitBubbleController::AnimationProgressed( + const gfx::Animation* animation) { + float opacity = static_cast<float>(animation->CurrentValueBetween(1.0, 0.0)); + for (Browser* browser : *BrowserList::GetInstance()) { + BrowserView::GetBrowserViewForBrowser(browser)->GetWidget()->SetOpacity( + opacity); + } +} + +void ConfirmQuitBubbleController::AnimationEnded( + const gfx::Animation* animation) { + AnimationProgressed(animation); +} + +void ConfirmQuitBubbleController::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { + DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); + // The browser process is about to exit. Clean up |pref_change_registrar_| + // now, otherwise it will outlive PrefService which will result in a crash + // when it tries to remove itself as an observer of the PrefService in its + // destructor. Also explicitly set the state to quitting so we don't try to + // show any more UI etc. + pref_change_registrar_.reset(); + view_->Hide(); + state_ = State::kQuitting; +} + +void ConfirmQuitBubbleController::OnTimerElapsed() { + if (state_ == State::kPressed) { + // The accelerator was held down the entire time the bubble was showing. + confirm_quit::RecordHistogram(confirm_quit::kHoldDuration); + ConfirmQuit(); + } else if (state_ == State::kReleased) { + Reset(); + } +} + +void ConfirmQuitBubbleController::OnConfirmToQuitPrefChanged() { + if (browser_ && !browser_->profile()->GetPrefs()->GetBoolean( + prefs::kConfirmToQuitEnabled)) { + Reset(); + } +} + +void ConfirmQuitBubbleController::Reset() { + DCHECK_NE(state_, State::kQuitting); + if (state_ == State::kWaiting) + return; + state_ = State::kWaiting; + second_press_start_time_ = base::TimeTicks(); + browser_ = nullptr; + pref_change_registrar_.reset(); + view_->Hide(); + hide_timer_->Stop(); + browser_hide_animation_->Hide(); +} + +void ConfirmQuitBubbleController::ConfirmQuit() { + DCHECK(state_ == State::kPressed || state_ == State::kReleased); + state_ = State::kConfirmed; + hide_timer_->Stop(); + browser_hide_animation_->Show(); +} + +void ConfirmQuitBubbleController::Quit() { + DCHECK(state_ == State::kWaiting || state_ == State::kConfirmed); + state_ = State::kQuitting; + browser_ = nullptr; + DoQuit(); +}
diff --git a/chrome/browser/ui/views/confirm_quit_bubble_controller.h b/chrome/browser/ui/views/confirm_quit_bubble_controller.h new file mode 100644 index 0000000..cc4285f --- /dev/null +++ b/chrome/browser/ui/views/confirm_quit_bubble_controller.h
@@ -0,0 +1,135 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_CONTROLLER_H_ +#define CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_CONTROLLER_H_ + +#include <memory> + +#include "base/macros.h" +#include "base/timer/timer.h" +#include "chrome/browser/ui/browser_list_observer.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" +#include "ui/events/event_handler.h" +#include "ui/gfx/animation/animation_delegate.h" + +class ConfirmQuitBubbleBase; +class PrefChangeRegistrar; + +namespace base { +template <typename T> +struct DefaultSingletonTraits; +} + +namespace gfx { +class SlideAnimation; +} + +// Manages showing and hiding the confirm-to-quit bubble. Requests Chrome to be +// closed if the quit accelerator is held down or pressed twice in succession. +// The singleton instance of this class is added as a PreTargetHandler for each +// browser window. +class ConfirmQuitBubbleController : public gfx::AnimationDelegate, + public BrowserListObserver, + public content::NotificationObserver, + public ui::EventHandler { + public: + static ConfirmQuitBubbleController* GetInstance(); + + ~ConfirmQuitBubbleController() override; + + // ui::EventHandler: + void OnKeyEvent(ui::KeyEvent* event) override; + + protected: + // |animation| is used to fade out all browser windows. + ConfirmQuitBubbleController(std::unique_ptr<ConfirmQuitBubbleBase> bubble, + std::unique_ptr<base::OneShotTimer> hide_timer, + std::unique_ptr<gfx::SlideAnimation> animation); + + // BrowserListObserver: + void OnBrowserRemoved(Browser* browser) override; + void OnBrowserNoLongerActive(Browser* browser) override; + + // Runs the quit action now. Virtual so tests can override the quit action. + virtual void DoQuit(); + + // Returns true if the confirm-to-quit feature is enabled. Virtual so tests + // can override the setting. + virtual bool IsFeatureEnabled(); + + private: + friend struct base::DefaultSingletonTraits<ConfirmQuitBubbleController>; + + enum class State { + // The accelerator has not been pressed. + kWaiting, + + // The accelerator was pressed, but not yet released. + kPressed, + + // The accelerator was pressed and released before the timer expired. + kReleased, + + // The accelerator was either held down for the entire duration of the + // timer, or was pressed a second time. Either way, the accelerator is + // currently held. + kConfirmed, + + // The accelerator was released and Chrome is now quitting. + kQuitting, + }; + + ConfirmQuitBubbleController(); + + // gfx::AnimationDelegate: + void AnimationProgressed(const gfx::Animation* animation) override; + void AnimationEnded(const gfx::Animation* animation) override; + + // content::NotificationObserver: + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override; + + void OnTimerElapsed(); + + // Called when the user changes their preference for the confirm-to-quit + // setting. + void OnConfirmToQuitPrefChanged(); + + // Resets back to the waiting state. Hides any UI and resets timers that may + // be active. + void Reset(); + + // Transitions to the confirmed state. Quit() will be run later when the user + // releases the accelerator. + void ConfirmQuit(); + + // Updates state and calls DoQuit(). + void Quit(); + + std::unique_ptr<ConfirmQuitBubbleBase> const view_; + + State state_; + + // Used only to distinguish between a double-press and a tap-and-hold when + // recording metrics. + base::TimeTicks second_press_start_time_; + + // The last active browser when the accelerator was pressed. + Browser* browser_ = nullptr; + + std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; + + std::unique_ptr<base::OneShotTimer> hide_timer_; + + std::unique_ptr<gfx::SlideAnimation> const browser_hide_animation_; + + content::NotificationRegistrar registrar_; + + DISALLOW_COPY_AND_ASSIGN(ConfirmQuitBubbleController); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_QUIT_BUBBLE_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/confirm_quit_bubble_controller_unittest.cc b/chrome/browser/ui/views/confirm_quit_bubble_controller_unittest.cc new file mode 100644 index 0000000..674c779 --- /dev/null +++ b/chrome/browser/ui/views/confirm_quit_bubble_controller_unittest.cc
@@ -0,0 +1,212 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/confirm_quit_bubble_controller.h" + +#include <memory> +#include <utility> + +#include "base/bind.h" +#include "base/macros.h" +#include "base/timer/mock_timer.h" +#include "chrome/browser/ui/views/confirm_quit_bubble.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/accelerators/accelerator.h" +#include "ui/events/event.h" +#include "ui/events/keycodes/keyboard_codes.h" +#include "ui/gfx/animation/slide_animation.h" + +class TestConfirmQuitBubble : public ConfirmQuitBubbleBase { + public: + TestConfirmQuitBubble() {} + ~TestConfirmQuitBubble() override {} + + void Show() override {} + void Hide() override {} + + private: + DISALLOW_COPY_AND_ASSIGN(TestConfirmQuitBubble); +}; + +class TestConfirmQuitBubbleController : public ConfirmQuitBubbleController { + public: + TestConfirmQuitBubbleController( + std::unique_ptr<ConfirmQuitBubbleBase> bubble, + std::unique_ptr<base::OneShotTimer> hide_timer, + std::unique_ptr<gfx::SlideAnimation> animation) + : ConfirmQuitBubbleController(std::move(bubble), + std::move(hide_timer), + std::move(animation)) {} + + void DeactivateBrowser() { OnBrowserNoLongerActive(nullptr); } + + bool quit_called() const { return quit_called_; } + + private: + void DoQuit() override { quit_called_ = true; } + + bool IsFeatureEnabled() override { return true; } + + bool quit_called_ = false; + + DISALLOW_COPY_AND_ASSIGN(TestConfirmQuitBubbleController); +}; + +class TestSlideAnimation : public gfx::SlideAnimation { + public: + TestSlideAnimation() : gfx::SlideAnimation(nullptr) {} + ~TestSlideAnimation() override {} + + void Reset() override {} + void Reset(double value) override {} + void Show() override {} + void Hide() override {} + void SetSlideDuration(int duration) override {} + + private: + DISALLOW_COPY_AND_ASSIGN(TestSlideAnimation); +}; + +class ConfirmQuitBubbleControllerTest : public testing::Test { + protected: + void SetUp() override { + std::unique_ptr<TestConfirmQuitBubble> bubble = + std::make_unique<TestConfirmQuitBubble>(); + auto timer = std::make_unique<base::MockOneShotTimer>(); + bubble_ = bubble.get(); + timer_ = timer.get(); + controller_.reset(new TestConfirmQuitBubbleController( + std::move(bubble), std::move(timer), + std::make_unique<TestSlideAnimation>())); + } + + void TearDown() override { controller_.reset(); } + + void SendKeyEvent(ui::KeyEvent* event) { controller_->OnKeyEvent(event); } + + void SendAccelerator(bool quit, bool press, bool repeat) { + ui::KeyboardCode key = quit ? ui::VKEY_Q : ui::VKEY_P; + int modifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN; + if (repeat) + modifiers |= ui::EF_IS_REPEAT; + ui::EventType type = press ? ui::ET_KEY_PRESSED : ui::ET_KEY_RELEASED; + ui::KeyEvent event(type, key, modifiers); + SendKeyEvent(&event); + } + + void PressQuitAccelerator() { SendAccelerator(true, true, false); } + + void ReleaseQuitAccelerator() { SendAccelerator(true, false, false); } + + void RepeatQuitAccelerator() { SendAccelerator(true, true, true); } + + void PressOtherAccelerator() { SendAccelerator(false, true, false); } + + void ReleaseOtherAccelerator() { SendAccelerator(false, false, false); } + + std::unique_ptr<TestConfirmQuitBubbleController> controller_; + + // Owned by |controller_|. + TestConfirmQuitBubble* bubble_; + + // Owned by |controller_|. + base::MockOneShotTimer* timer_; + + bool quit_called_ = false; +}; + +// Pressing and holding the shortcut should quit. +TEST_F(ConfirmQuitBubbleControllerTest, PressAndHold) { + PressQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + timer_->Fire(); + EXPECT_FALSE(controller_->quit_called()); + ReleaseQuitAccelerator(); + EXPECT_TRUE(controller_->quit_called()); +} + +// Pressing the shortcut twice should quit. +TEST_F(ConfirmQuitBubbleControllerTest, DoublePress) { + PressQuitAccelerator(); + ReleaseQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + PressQuitAccelerator(); + EXPECT_FALSE(timer_->IsRunning()); + EXPECT_FALSE(controller_->quit_called()); + ReleaseQuitAccelerator(); + EXPECT_TRUE(controller_->quit_called()); +} + +// Pressing the shortcut once should not quit. +TEST_F(ConfirmQuitBubbleControllerTest, SinglePress) { + PressQuitAccelerator(); + ReleaseQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + timer_->Fire(); + EXPECT_FALSE(controller_->quit_called()); +} + +// Repeated presses should not be counted. +TEST_F(ConfirmQuitBubbleControllerTest, RepeatedPresses) { + PressQuitAccelerator(); + RepeatQuitAccelerator(); + ReleaseQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + timer_->Fire(); + EXPECT_FALSE(controller_->quit_called()); +} + +// Other keys shouldn't matter. +TEST_F(ConfirmQuitBubbleControllerTest, OtherKeyPress) { + PressQuitAccelerator(); + ReleaseQuitAccelerator(); + PressOtherAccelerator(); + ReleaseOtherAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + PressQuitAccelerator(); + EXPECT_FALSE(timer_->IsRunning()); + EXPECT_FALSE(controller_->quit_called()); + ReleaseQuitAccelerator(); + EXPECT_TRUE(controller_->quit_called()); +} + +// The controller state should be reset when the browser loses focus. +TEST_F(ConfirmQuitBubbleControllerTest, BrowserLosesFocus) { + // Press but don't release the accelerator. + PressQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + controller_->DeactivateBrowser(); + EXPECT_FALSE(timer_->IsRunning()); + EXPECT_FALSE(controller_->quit_called()); + ReleaseQuitAccelerator(); + + // Press and release the accelerator. + PressQuitAccelerator(); + ReleaseQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + controller_->DeactivateBrowser(); + EXPECT_FALSE(timer_->IsRunning()); + EXPECT_FALSE(controller_->quit_called()); + + // Press and hold the accelerator. + PressQuitAccelerator(); + EXPECT_TRUE(timer_->IsRunning()); + timer_->Fire(); + EXPECT_FALSE(timer_->IsRunning()); + controller_->DeactivateBrowser(); + ReleaseQuitAccelerator(); + EXPECT_FALSE(controller_->quit_called()); +} + +// The controller should not consume keyup events on the 'Q' key +// (https://crbug.com/856868). +TEST_F(ConfirmQuitBubbleControllerTest, ControllerDoesNotHandleQKeyUp) { + ui::KeyEvent press_event(ui::ET_KEY_PRESSED, ui::VKEY_Q, 0); + SendKeyEvent(&press_event); + EXPECT_FALSE(press_event.handled()); + + ui::KeyEvent release_event(ui::ET_KEY_RELEASED, ui::VKEY_Q, 0); + SendKeyEvent(&release_event); + EXPECT_FALSE(release_event.handled()); +}
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 5d1e433..81127e8 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -71,6 +71,7 @@ #include "chrome/browser/ui/views/autofill/save_card_sign_in_promo_bubble_views.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" +#include "chrome/browser/ui/views/confirm_quit_bubble_controller.h" #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" #include "chrome/browser/ui/views/download/download_shelf_view.h" #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" @@ -91,7 +92,6 @@ #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" #include "chrome/browser/ui/views/page_action/page_action_icon_container_view.h" #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" -#include "chrome/browser/ui/views/quit_instruction_bubble_controller.h" #include "chrome/browser/ui/views/status_bubble_views.h" #include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h" #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" @@ -1156,7 +1156,7 @@ void BrowserView::DestroyBrowser() { #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) GetWidget()->GetNativeView()->RemovePreTargetHandler( - QuitInstructionBubbleController::GetInstance()); + ConfirmQuitBubbleController::GetInstance()); #endif // After this returns other parts of Chrome are going to be shutdown. Close @@ -2258,7 +2258,7 @@ #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) GetWidget()->GetNativeView()->AddPreTargetHandler( - QuitInstructionBubbleController::GetInstance()); + ConfirmQuitBubbleController::GetInstance()); #endif #if defined(USE_AURA)
diff --git a/chrome/browser/ui/views/overlay/control_image_button.cc b/chrome/browser/ui/views/overlay/control_image_button.cc new file mode 100644 index 0000000..8489922 --- /dev/null +++ b/chrome/browser/ui/views/overlay/control_image_button.cc
@@ -0,0 +1,14 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/overlay/control_image_button.h" + +namespace views { + +ControlImageButton::ControlImageButton(ButtonListener* listener) + : ImageButton(listener), id_() {} + +ControlImageButton::~ControlImageButton() = default; + +} // namespace views
diff --git a/chrome/browser/ui/views/overlay/control_image_button.h b/chrome/browser/ui/views/overlay/control_image_button.h new file mode 100644 index 0000000..dee2eb4 --- /dev/null +++ b/chrome/browser/ui/views/overlay/control_image_button.h
@@ -0,0 +1,33 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_OVERLAY_CONTROL_IMAGE_BUTTON_H_ +#define CHROME_BROWSER_UI_VIEWS_OVERLAY_CONTROL_IMAGE_BUTTON_H_ + +#include "ui/views/controls/button/image_button.h" + +namespace views { + +// An image button with an associated id. +class ControlImageButton : public views::ImageButton { + public: + explicit ControlImageButton(ButtonListener* listener); + + ~ControlImageButton() override; + + void set_id(const std::string& id) { id_ = id; } + + const std::string& id() const { return id_; } + + private: + // The id that is passed back to the browser when interacting with it fires an + // event. + std::string id_; + + DISALLOW_COPY_AND_ASSIGN(ControlImageButton); +}; + +} // namespace views + +#endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_CONTROL_IMAGE_BUTTON_H_
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc index 0b75d8461..8571a74 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
@@ -7,12 +7,15 @@ #include <memory> #include "base/memory/ptr_util.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/views/overlay/close_image_button.h" +#include "chrome/browser/ui/views/overlay/control_image_button.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/picture_in_picture_window_controller.h" #include "content/public/browser/web_contents.h" #include "media/base/video_util.h" +#include "third_party/blink/public/common/picture_in_picture/picture_in_picture_control_info.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" @@ -37,11 +40,11 @@ const int kOverlayBorderThickness = 5; -// |play_pause_controls_view_| scales at 30% the size of the smaller of the -// screen's width and height. -const float kPlayPauseControlRatioToWindow = 0.3; +// |button_size_| scales both its width and height to be 30% the size of the +// smaller of the screen's width and height. +const float kControlRatioToWindow = 0.3; -const int kMinPlayPauseButtonSize = 48; +const int kMinControlButtonSize = 48; // Colors for the control buttons. SkColor kBgColor = SK_ColorWHITE; @@ -74,6 +77,8 @@ // The media controls should take and handle user interaction. OverlayWindowViews* window = static_cast<OverlayWindowViews*>(widget_); if (window->GetCloseControlsBounds().Contains(point) || + window->GetFirstCustomControlsBounds().Contains(point) || + window->GetSecondCustomControlsBounds().Contains(point) || window->GetPlayPauseControlsBounds().Contains(point)) { return window_component; } @@ -129,10 +134,10 @@ OverlayWindowViews::OverlayWindowViews( content::PictureInPictureWindowController* controller) : controller_(controller), - play_pause_button_size_(gfx::Size()), window_background_view_(new views::View()), video_view_(new views::View()), controls_background_view_(new views::View()), + controls_parent_view_(new views::View()), close_controls_view_(new views::CloseImageButton(this)), play_pause_controls_view_(new views::ToggleImageButton(this)) { views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); @@ -228,8 +233,8 @@ play_pause_controls_view_->SetImageAlignment( views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE); play_pause_controls_view_->SetToggled(controller_->IsPlayerActive()); - play_pause_controls_view_->SetBackgroundImageAlignment( - views::ImageButton::ALIGN_LEFT, views::ImageButton::ALIGN_TOP); + play_pause_controls_view_->set_owned_by_client(); + UpdatePlayPauseControlsSize(); // Accessibility. @@ -247,19 +252,21 @@ play_pause_controls_view_->SetToggledTooltipText(pause_button_label); play_pause_controls_view_->SetInstallFocusRingOnFocus(true); + // Add as child views to |controls_parent_view_|. -------------------------- + controls_parent_view_->SetSize(GetBounds().size()); + controls_parent_view_->SetPaintToLayer(ui::LAYER_TEXTURED); + controls_parent_view_->AddChildView(play_pause_controls_view_.get()); + controls_parent_view_->AddChildView(close_controls_view_.get()); + close_controls_view_->set_owned_by_client(); + controls_parent_view_->layer()->SetFillsBoundsOpaquely(false); + controls_parent_view_->set_owned_by_client(); + // Add as child views to this widget. --------------------------------------- GetContentsView()->AddChildView(controls_background_view_.get()); - GetContentsView()->AddChildView(close_controls_view_.get()); - GetContentsView()->AddChildView(play_pause_controls_view_.get()); + GetContentsView()->AddChildView(controls_parent_view_.get()); // Paint to ui::Layers. ----------------------------------------------------- video_view_->SetPaintToLayer(ui::LAYER_TEXTURED); - close_controls_view_->SetPaintToLayer(ui::LAYER_TEXTURED); - play_pause_controls_view_->SetPaintToLayer(ui::LAYER_TEXTURED); - - // Controls should have a transparent background. --------------------------- - close_controls_view_->layer()->SetFillsBoundsOpaquely(false); - play_pause_controls_view_->layer()->SetFillsBoundsOpaquely(false); UpdateControlsVisibility(false); } @@ -293,8 +300,7 @@ void OverlayWindowViews::UpdateControlsVisibility(bool is_visible) { GetControlsBackgroundLayer()->SetVisible(is_visible); - GetCloseControlsLayer()->SetVisible(is_visible); - GetPlayPauseControlsLayer()->SetVisible(is_visible); + GetControlsParentLayer()->SetVisible(is_visible); } void OverlayWindowViews::UpdateControlsBounds() { @@ -303,42 +309,131 @@ close_controls_view_->SetPosition(GetBounds().size()); - play_pause_controls_view_->SetBoundsRect(gfx::Rect( - gfx::Point( - (GetBounds().size().width() - play_pause_button_size_.width()) / 2, - (GetBounds().size().height() - play_pause_button_size_.height()) / 2), - play_pause_button_size_)); + controls_parent_view_->SetBoundsRect( + gfx::Rect(gfx::Point(0, 0), GetBounds().size())); + + UpdateControlsPositions(); +} + +void OverlayWindowViews::UpdateButtonSize() { + const gfx::Size window_size = GetBounds().size(); + int scaled_button_dimension = + window_size.width() < window_size.height() + ? window_size.width() * kControlRatioToWindow + : window_size.height() * kControlRatioToWindow; + + int new_button_dimension = + std::max(kMinControlButtonSize, scaled_button_dimension); + + button_size_.SetSize(new_button_dimension, new_button_dimension); +} + +void OverlayWindowViews::UpdateCustomControlsSize( + views::ControlImageButton* control) { + if (!control) + return; + UpdateButtonSize(); + control->SetSize(button_size_); + // TODO(sawtelle): Download the images and add them to the controls. + // https://crbug.com/864271. + if (control == first_custom_controls_view_.get()) { + first_custom_controls_view_->SetImage( + views::Button::STATE_NORMAL, + gfx::CreateVectorIcon(kPlayArrowIcon, button_size_.width() / 2, + kControlIconColor)); + } + if (control == second_custom_controls_view_.get()) { + second_custom_controls_view_->SetImage( + views::Button::STATE_NORMAL, + gfx::CreateVectorIcon(kPauseIcon, button_size_.width() / 2, + kControlIconColor)); + } + const gfx::ImageSkia control_background = gfx::CreateVectorIcon( + kPictureInPictureControlBackgroundIcon, button_size_.width(), kBgColor); + control->SetBackgroundImage(kBgColor, &control_background, + &control_background); } void OverlayWindowViews::UpdatePlayPauseControlsSize() { - const gfx::Size window_size = GetBounds().size(); - - int scaled_button_dimension = - window_size.width() < window_size.height() - ? window_size.width() * kPlayPauseControlRatioToWindow - : window_size.height() * kPlayPauseControlRatioToWindow; - - int new_play_pause_button_dimension = - std::max(kMinPlayPauseButtonSize, scaled_button_dimension); - - play_pause_button_size_.SetSize(new_play_pause_button_dimension, - new_play_pause_button_dimension); - play_pause_controls_view_->SetSize(play_pause_button_size_); + UpdateButtonSize(); + play_pause_controls_view_->SetSize(button_size_); play_pause_controls_view_->SetImage( views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(kPlayArrowIcon, play_pause_button_size_.width() / 2, + gfx::CreateVectorIcon(kPlayArrowIcon, button_size_.width() / 2, kControlIconColor)); gfx::ImageSkia pause_icon = gfx::CreateVectorIcon( - kPauseIcon, play_pause_button_size_.width() / 2, kControlIconColor); + kPauseIcon, button_size_.width() / 2, kControlIconColor); play_pause_controls_view_->SetToggledImage(views::Button::STATE_NORMAL, &pause_icon); - const gfx::ImageSkia play_pause_background = - gfx::CreateVectorIcon(kPictureInPictureControlBackgroundIcon, - play_pause_button_size_.width(), kBgColor); + const gfx::ImageSkia play_pause_background = gfx::CreateVectorIcon( + kPictureInPictureControlBackgroundIcon, button_size_.width(), kBgColor); play_pause_controls_view_->SetBackgroundImage( kBgColor, &play_pause_background, &play_pause_background); } +void OverlayWindowViews::SetUpCustomControl( + std::unique_ptr<views::ControlImageButton>& control, + const blink::PictureInPictureControlInfo& web_control, + ControlPosition position) { + if (!control) { + control = std::make_unique<views::ControlImageButton>(this); + controls_parent_view_->AddChildView(control.get()); + control->set_owned_by_client(); + control->SetImageAlignment(views::ImageButton::ALIGN_CENTER, + views::ImageButton::ALIGN_MIDDLE); + } + + // Sizing/positioning. + UpdateCustomControlsSize(control.get()); + control->set_id(web_control.id); + UpdateControlsBounds(); + + // Accessibility. + base::string16 custom_button_label = base::UTF8ToUTF16(web_control.label); + control->SetAccessibleName(custom_button_label); + control->SetTooltipText(custom_button_label); + control->SetInstallFocusRingOnFocus(true); + control->SetFocusForPlatform(); +} + +bool OverlayWindowViews::OnlyOneCustomControlAdded() { + return first_custom_controls_view_ && !second_custom_controls_view_; +} + +gfx::Rect OverlayWindowViews::CalculateControlsBounds(int x, + const gfx::Size& size) { + return gfx::Rect( + gfx::Point(x, (GetBounds().size().height() - size.height()) / 2), size); +} + +void OverlayWindowViews::UpdateControlsPositions() { + int mid_window_x = GetBounds().size().width() / 2; + if (OnlyOneCustomControlAdded()) { + // Draw |first_custom_controls_view_| to the left of + // |play_pause_controls_view_| and offset both so they are centered on the + // screen. + play_pause_controls_view_->SetBoundsRect( + CalculateControlsBounds(mid_window_x, button_size_)); + first_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( + mid_window_x - button_size_.width(), button_size_)); + return; + } + + play_pause_controls_view_->SetBoundsRect(CalculateControlsBounds( + mid_window_x - button_size_.width() / 2, button_size_)); + + if (first_custom_controls_view_ && second_custom_controls_view_) { + // Draw |first_custom_controls_view_| to the left and + // |second_custom_controls_view_| to the right of + // |play_pause_controls_view_|. + first_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( + mid_window_x - button_size_.width() / 2 - button_size_.width(), + button_size_)); + second_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( + mid_window_x + button_size_.width() / 2, button_size_)); + } +} + bool OverlayWindowViews::IsActive() const { return views::Widget::IsActive(); } @@ -392,26 +487,36 @@ void OverlayWindowViews::SetPlaybackState(PlaybackState playback_state) { // TODO(apacible): have machine state for controls visibility. - bool play_pause_layer_visible = GetPlayPauseControlsLayer()->visible(); + bool controls_parent_layer_visible = GetControlsParentLayer()->visible(); switch (playback_state) { case kPlaying: play_pause_controls_view_->SetToggled(true); - play_pause_controls_view_->SetVisible(true); + controls_parent_view_->SetVisible(true); video_view_->SetVisible(true); break; case kPaused: play_pause_controls_view_->SetToggled(false); - play_pause_controls_view_->SetVisible(true); + controls_parent_view_->SetVisible(true); video_view_->SetVisible(true); break; case kNoVideo: - play_pause_controls_view_->SetVisible(false); + controls_parent_view_->SetVisible(false); video_view_->SetVisible(false); break; } - GetPlayPauseControlsLayer()->SetVisible(play_pause_layer_visible); + GetControlsParentLayer()->SetVisible(controls_parent_layer_visible); +} + +void OverlayWindowViews::SetPictureInPictureCustomControls( + const std::vector<blink::PictureInPictureControlInfo>& controls) { + if (controls.size() > 0) + SetUpCustomControl(first_custom_controls_view_, controls[0], + ControlPosition::kLeft); + if (controls.size() > 1) + SetUpCustomControl(second_custom_controls_view_, controls[1], + ControlPosition::kRight); } ui::Layer* OverlayWindowViews::GetWindowBackgroundLayer() { @@ -426,12 +531,8 @@ return controls_background_view_->layer(); } -ui::Layer* OverlayWindowViews::GetCloseControlsLayer() { - return close_controls_view_->layer(); -} - -ui::Layer* OverlayWindowViews::GetPlayPauseControlsLayer() { - return play_pause_controls_view_->layer(); +ui::Layer* OverlayWindowViews::GetControlsParentLayer() { + return controls_parent_view_->layer(); } gfx::Rect OverlayWindowViews::GetVideoBounds() { @@ -446,6 +547,18 @@ return play_pause_controls_view_->GetMirroredBounds(); } +gfx::Rect OverlayWindowViews::GetFirstCustomControlsBounds() { + if (!first_custom_controls_view_) + return gfx::Rect(); + return first_custom_controls_view_->GetMirroredBounds(); +} + +gfx::Rect OverlayWindowViews::GetSecondCustomControlsBounds() { + if (!second_custom_controls_view_) + return gfx::Rect(); + return second_custom_controls_view_->GetMirroredBounds(); +} + gfx::Size OverlayWindowViews::GetMinimumSize() const { return min_size_; } @@ -516,6 +629,12 @@ if (sender == play_pause_controls_view_.get()) TogglePlayPause(); + + if (sender == first_custom_controls_view_.get()) + controller_->ClickCustomControl(first_custom_controls_view_->id()); + + if (sender == second_custom_controls_view_.get()) + controller_->ClickCustomControl(second_custom_controls_view_->id()); } void OverlayWindowViews::OnNativeFocus() { @@ -549,6 +668,8 @@ void OverlayWindowViews::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { // Update the view layers to scale to |new_size|. + UpdateCustomControlsSize(first_custom_controls_view_.get()); + UpdateCustomControlsSize(second_custom_controls_view_.get()); UpdatePlayPauseControlsSize(); UpdateLayerBoundsWithLetterboxing(new_size); @@ -567,12 +688,6 @@ play_pause_controls_view_->SetToggled(is_active); } -void OverlayWindowViews::SetPictureInPictureCustomControls( - const std::vector<blink::PictureInPictureControlInfo>& controls) { - // TODO(sawtelle): Add these controls to the window. https://crbug.com/863967. - NOTIMPLEMENTED(); -} - void OverlayWindowViews::ClickCustomControl(const std::string& control_id) { controller_->ClickCustomControl(control_id); } @@ -581,3 +696,7 @@ OverlayWindowViews::play_pause_controls_view_for_testing() const { return play_pause_controls_view_.get(); } + +views::View* OverlayWindowViews::controls_parent_view_for_testing() const { + return controls_parent_view_.get(); +}
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.h b/chrome/browser/ui/views/overlay/overlay_window_views.h index 3a7f4f6b..edc46259 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.h +++ b/chrome/browser/ui/views/overlay/overlay_window_views.h
@@ -12,6 +12,7 @@ #include "ui/views/widget/widget.h" namespace views { +class ControlImageButton; class CloseImageButton; class ToggleImageButton; } // namespace views @@ -37,11 +38,11 @@ gfx::Rect GetBounds() const override; void UpdateVideoSize(const gfx::Size& natural_size) override; void SetPlaybackState(PlaybackState playback_state) override; + void SetPictureInPictureCustomControls( + const std::vector<blink::PictureInPictureControlInfo>& controls) override; ui::Layer* GetWindowBackgroundLayer() override; ui::Layer* GetVideoLayer() override; gfx::Rect GetVideoBounds() override; - void SetPictureInPictureCustomControls( - const std::vector<blink::PictureInPictureControlInfo>& controls) override; // views::Widget: gfx::Size GetMinimumSize() const override; @@ -63,17 +64,18 @@ // Gets the bounds of the controls. gfx::Rect GetCloseControlsBounds(); gfx::Rect GetPlayPauseControlsBounds(); + gfx::Rect GetFirstCustomControlsBounds(); + gfx::Rect GetSecondCustomControlsBounds(); // Send the message that a custom control on |this| has been clicked. void ClickCustomControl(const std::string& control_id); views::ToggleImageButton* play_pause_controls_view_for_testing() const; + views::View* controls_parent_view_for_testing() const; private: - // Gets the internal |ui::Layer| of the controls. - ui::Layer* GetControlsBackgroundLayer(); - ui::Layer* GetCloseControlsLayer(); - ui::Layer* GetPlayPauseControlsLayer(); + // Possible positions for the custom controls added to the window. + enum class ControlPosition { kLeft, kRight }; // Determine the intended bounds of |this|. This should be called when there // is reason for the bounds to change, such as switching primary displays or @@ -94,10 +96,31 @@ // Updates the bounds of the controls. void UpdateControlsBounds(); - // Update the size of |play_pause_controls_view_| as the size of the window - // changes. + // Update the size the controls views use as the size of the window changes. + void UpdateButtonSize(); + + // Update the size of each controls view as the size of the window changes. + void UpdateCustomControlsSize(views::ControlImageButton*); void UpdatePlayPauseControlsSize(); + void SetUpCustomControl(std::unique_ptr<views::ControlImageButton>&, + const blink::PictureInPictureControlInfo&, + ControlPosition); + + // Returns whether there is exactly one custom control on the window. + bool OnlyOneCustomControlAdded(); + + // Calculate and set the bounds of the controls. + gfx::Rect CalculateControlsBounds(int x, const gfx::Size& size); + void UpdateControlsPositions(); + + // Sets the bounds of the custom controls. + void SetFirstCustomControlsBounds(); + void SetSecondCustomControlsBounds(); + + ui::Layer* GetControlsBackgroundLayer(); + ui::Layer* GetControlsParentLayer(); + // Toggles the play/pause control through the |controller_| and updates the // |play_pause_controls_view_| toggled state to reflect the current playing // state. @@ -127,8 +150,8 @@ gfx::Size min_size_; gfx::Size max_size_; - // Current size of |play_pause_controls_view_|. - gfx::Size play_pause_button_size_; + // Current sizes of the control views on the Picture-in-Picture window. + gfx::Size button_size_; // Current bounds of the Picture-in-Picture window. gfx::Rect window_bounds_; @@ -143,9 +166,15 @@ // Views to be shown. std::unique_ptr<views::View> window_background_view_; std::unique_ptr<views::View> video_view_; + // |controls_background_view_| will dim the screen when the mouse hovers over. + // |controls_parent_view_| will hold all controls and manage them except for + // |close_controls_view_| std::unique_ptr<views::View> controls_background_view_; + std::unique_ptr<views::View> controls_parent_view_; std::unique_ptr<views::CloseImageButton> close_controls_view_; std::unique_ptr<views::ToggleImageButton> play_pause_controls_view_; + std::unique_ptr<views::ControlImageButton> first_custom_controls_view_; + std::unique_ptr<views::ControlImageButton> second_custom_controls_view_; DISALLOW_COPY_AND_ASSIGN(OverlayWindowViews); };
diff --git a/chrome/browser/ui/views/quit_instruction_bubble_base.h b/chrome/browser/ui/views/quit_instruction_bubble_base.h deleted file mode 100644 index 4b80276..0000000 --- a/chrome/browser/ui/views/quit_instruction_bubble_base.h +++ /dev/null
@@ -1,19 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_BASE_H_ -#define CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_BASE_H_ - -// Base class of QuitInstructionBubble necessary for unit testing -// QuitInstructionBubbleController. -class QuitInstructionBubbleBase { - public: - QuitInstructionBubbleBase() {} - virtual ~QuitInstructionBubbleBase() {} - - virtual void Show() = 0; - virtual void Hide() = 0; -}; - -#endif // CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_BASE_H_
diff --git a/chrome/browser/ui/views/quit_instruction_bubble_controller.cc b/chrome/browser/ui/views/quit_instruction_bubble_controller.cc deleted file mode 100644 index ec5681e..0000000 --- a/chrome/browser/ui/views/quit_instruction_bubble_controller.cc +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/quit_instruction_bubble_controller.h" - -#include <utility> - -#include "base/memory/singleton.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/quit_instruction_bubble.h" -#include "ui/base/accelerators/accelerator.h" -#include "ui/events/keycodes/keyboard_codes.h" - -namespace { - -constexpr ui::KeyboardCode kAcceleratorKeyCode = ui::VKEY_Q; -constexpr int kAcceleratorModifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN; - -constexpr base::TimeDelta kShowDuration = - base::TimeDelta::FromMilliseconds(3000); - -} // namespace - -// static -QuitInstructionBubbleController* -QuitInstructionBubbleController::GetInstance() { - return base::Singleton<QuitInstructionBubbleController>::get(); -} - -QuitInstructionBubbleController::QuitInstructionBubbleController() - : QuitInstructionBubbleController(std::make_unique<QuitInstructionBubble>(), - std::make_unique<base::OneShotTimer>()) {} - -QuitInstructionBubbleController::QuitInstructionBubbleController( - std::unique_ptr<QuitInstructionBubbleBase> bubble, - std::unique_ptr<base::OneShotTimer> hide_timer) - : view_(std::move(bubble)), hide_timer_(std::move(hide_timer)) {} - -QuitInstructionBubbleController::~QuitInstructionBubbleController() {} - -void QuitInstructionBubbleController::OnKeyEvent(ui::KeyEvent* event) { - const ui::Accelerator accelerator(*event); - if (accelerator.key_code() == kAcceleratorKeyCode && - accelerator.modifiers() == kAcceleratorModifiers) { - event->SetHandled(); - if (accelerator.key_state() == ui::Accelerator::KeyState::PRESSED) { - view_->Show(); - hide_timer_->Start(FROM_HERE, kShowDuration, this, - &QuitInstructionBubbleController::OnTimerElapsed); - } - } -} - -void QuitInstructionBubbleController::OnTimerElapsed() { - view_->Hide(); -}
diff --git a/chrome/browser/ui/views/quit_instruction_bubble_controller.h b/chrome/browser/ui/views/quit_instruction_bubble_controller.h deleted file mode 100644 index 737c2a34..0000000 --- a/chrome/browser/ui/views/quit_instruction_bubble_controller.h +++ /dev/null
@@ -1,52 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_CONTROLLER_H_ -#define CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_CONTROLLER_H_ - -#include <memory> - -#include "base/macros.h" -#include "base/timer/timer.h" -#include "ui/events/event_handler.h" - -class QuitInstructionBubbleBase; - -namespace base { -template <typename T> -struct DefaultSingletonTraits; -} - -// Manages showing and hiding the quit instruction bubble. The singleton -// instance of this class is added as a PreTargetHandler for each browser -// window. -class QuitInstructionBubbleController : public ui::EventHandler { - public: - static QuitInstructionBubbleController* GetInstance(); - - ~QuitInstructionBubbleController() override; - - // ui::EventHandler: - void OnKeyEvent(ui::KeyEvent* event) override; - - protected: - QuitInstructionBubbleController( - std::unique_ptr<QuitInstructionBubbleBase> bubble, - std::unique_ptr<base::OneShotTimer> hide_timer); - - private: - friend struct base::DefaultSingletonTraits<QuitInstructionBubbleController>; - - QuitInstructionBubbleController(); - - void OnTimerElapsed(); - - std::unique_ptr<QuitInstructionBubbleBase> const view_; - - std::unique_ptr<base::OneShotTimer> hide_timer_; - - DISALLOW_COPY_AND_ASSIGN(QuitInstructionBubbleController); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_QUIT_INSTRUCTION_BUBBLE_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/quit_instruction_bubble_controller_unittest.cc b/chrome/browser/ui/views/quit_instruction_bubble_controller_unittest.cc deleted file mode 100644 index 4a27424..0000000 --- a/chrome/browser/ui/views/quit_instruction_bubble_controller_unittest.cc +++ /dev/null
@@ -1,144 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/quit_instruction_bubble_controller.h" - -#include <memory> -#include <utility> - -#include "base/bind.h" -#include "base/macros.h" -#include "base/timer/mock_timer.h" -#include "chrome/browser/ui/views/quit_instruction_bubble.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/accelerators/accelerator.h" -#include "ui/events/event.h" -#include "ui/events/keycodes/keyboard_codes.h" -#include "ui/gfx/animation/slide_animation.h" - -class TestQuitInstructionBubble : public QuitInstructionBubbleBase { - public: - TestQuitInstructionBubble() {} - ~TestQuitInstructionBubble() override {} - - void Show() override {} - void Hide() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestQuitInstructionBubble); -}; - -class TestQuitInstructionBubbleController - : public QuitInstructionBubbleController { - public: - TestQuitInstructionBubbleController( - std::unique_ptr<QuitInstructionBubbleBase> bubble, - std::unique_ptr<base::OneShotTimer> hide_timer, - std::unique_ptr<gfx::SlideAnimation> animation) - : QuitInstructionBubbleController(std::move(bubble), - std::move(hide_timer)) {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestQuitInstructionBubbleController); -}; - -class TestSlideAnimation : public gfx::SlideAnimation { - public: - TestSlideAnimation() : gfx::SlideAnimation(nullptr) {} - ~TestSlideAnimation() override {} - - void Reset() override {} - void Reset(double value) override {} - void Show() override {} - void Hide() override {} - void SetSlideDuration(int duration) override {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestSlideAnimation); -}; - -class QuitInstructionBubbleControllerTest : public testing::Test { - protected: - void SetUp() override { - std::unique_ptr<TestQuitInstructionBubble> bubble = - std::make_unique<TestQuitInstructionBubble>(); - auto timer = std::make_unique<base::MockOneShotTimer>(); - bubble_ = bubble.get(); - timer_ = timer.get(); - controller_.reset(new TestQuitInstructionBubbleController( - std::move(bubble), std::move(timer), - std::make_unique<TestSlideAnimation>())); - } - - void TearDown() override { controller_.reset(); } - - void SendKeyEvent(ui::KeyEvent* event) { controller_->OnKeyEvent(event); } - - void SendAccelerator(bool quit, bool press, bool repeat) { - ui::KeyboardCode key = quit ? ui::VKEY_Q : ui::VKEY_P; - int modifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN; - if (repeat) - modifiers |= ui::EF_IS_REPEAT; - ui::EventType type = press ? ui::ET_KEY_PRESSED : ui::ET_KEY_RELEASED; - ui::KeyEvent event(type, key, modifiers); - SendKeyEvent(&event); - } - - void PressQuitAccelerator() { SendAccelerator(true, true, false); } - - void ReleaseQuitAccelerator() { SendAccelerator(true, false, false); } - - void RepeatQuitAccelerator() { SendAccelerator(true, true, true); } - - void PressOtherAccelerator() { SendAccelerator(false, true, false); } - - void ReleaseOtherAccelerator() { SendAccelerator(false, false, false); } - - std::unique_ptr<TestQuitInstructionBubbleController> controller_; - - // Owned by |controller_|. - TestQuitInstructionBubble* bubble_; - - // Owned by |controller_|. - base::MockOneShotTimer* timer_; -}; - -// Pressing the shortcut should show the bubble. -TEST_F(QuitInstructionBubbleControllerTest, PressAndHold) { - PressQuitAccelerator(); - EXPECT_TRUE(timer_->IsRunning()); - ReleaseQuitAccelerator(); - EXPECT_TRUE(timer_->IsRunning()); -} - -// Repeated presses should keep showing the bubble. -TEST_F(QuitInstructionBubbleControllerTest, RepeatedPresses) { - PressQuitAccelerator(); - RepeatQuitAccelerator(); - ReleaseQuitAccelerator(); - EXPECT_TRUE(timer_->IsRunning()); -} - -// Other keys shouldn't matter. -TEST_F(QuitInstructionBubbleControllerTest, OtherKeyPress) { - PressQuitAccelerator(); - ReleaseQuitAccelerator(); - PressOtherAccelerator(); - ReleaseOtherAccelerator(); - EXPECT_TRUE(timer_->IsRunning()); - PressQuitAccelerator(); - EXPECT_TRUE(timer_->IsRunning()); -} - -// The controller should not consume keyup events on the 'Q' key -// (https://crbug.com/856868). -TEST_F(QuitInstructionBubbleControllerTest, ControllerDoesNotHandleQKeyUp) { - ui::KeyEvent press_event(ui::ET_KEY_PRESSED, ui::VKEY_Q, 0); - SendKeyEvent(&press_event); - EXPECT_FALSE(press_event.handled()); - - ui::KeyEvent release_event(ui::ET_KEY_RELEASED, ui::VKEY_Q, 0); - SendKeyEvent(&release_event); - EXPECT_FALSE(release_event.handled()); -}
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc index 28c1d8d..9cac45c 100644 --- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -415,12 +415,17 @@ // purpose of installing a TPM firmware update. tpm_firmware_update::GetAvailableUpdateModes( base::BindOnce([](const std::set<tpm_firmware_update::Mode>& modes) { - if (modes.count(tpm_firmware_update::Mode::kPowerwash) > 0) { + using tpm_firmware_update::Mode; + for (Mode mode : {Mode::kPowerwash, Mode::kCleanup}) { + if (modes.count(mode) == 0) + continue; + // Force the TPM firmware update option to be enabled. g_browser_process->local_state()->SetInteger( prefs::kFactoryResetTPMFirmwareUpdateMode, - static_cast<int>(tpm_firmware_update::Mode::kPowerwash)); + static_cast<int>(mode)); LaunchResetScreen(); + return; } }), base::TimeDelta());
diff --git a/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc b/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc index fa15065..5d5acfd 100644 --- a/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc +++ b/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
@@ -30,7 +30,8 @@ using chromeos::tpm_firmware_update::Mode; // Decide which update mode to use. - for (Mode mode : {Mode::kPreserveDeviceState, Mode::kPowerwash}) { + for (Mode mode : + {Mode::kPreserveDeviceState, Mode::kPowerwash, Mode::kCleanup}) { if (available_modes.count(mode) == 0) { continue; }
diff --git a/chrome/chrome_cleaner/ipc/sandbox_unittest.cc b/chrome/chrome_cleaner/ipc/sandbox_unittest.cc index 0a7dd58..4c3eca9 100644 --- a/chrome/chrome_cleaner/ipc/sandbox_unittest.cc +++ b/chrome/chrome_cleaner/ipc/sandbox_unittest.cc
@@ -162,7 +162,8 @@ } // namespace -TEST_F(SandboxTest, SpawnSandboxTarget) { +// Flaky; see http://crbug.com/874387 +TEST_F(SandboxTest, DISABLED_SpawnSandboxTarget) { if (base::win::GetVersion() < base::win::VERSION_WIN8) { // TODO(b/871924): This test is currently failing on win7. Fix and enable. return;
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 6d355943..88000b40 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -369,6 +369,8 @@ "extensions/sync_helper.h", "extensions/webstore_install_result.cc", "extensions/webstore_install_result.h", + "initialize_extensions_client.cc", + "initialize_extensions_client.h", ] public_deps += [ "//chrome/common/extensions:mojo_bindings",
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 91314bc3..fa4bff8 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -369,6 +369,11 @@ "AcknowledgeNtpOverrideOnDeactivate", base::FEATURE_DISABLED_BY_DEFAULT}; #endif +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +const base::Feature kWarnBeforeQuitting{"WarnBeforeQuitting", + base::FEATURE_DISABLED_BY_DEFAULT}; +#endif + // The material redesign of the Incognito NTP. const base::Feature kMaterialDesignIncognitoNTP{ "MaterialDesignIncognitoNTP",
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 30f64cc0..0d98206e 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -202,6 +202,10 @@ extern const base::Feature kAcknowledgeNtpOverrideOnDeactivate; #endif +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +extern const base::Feature kWarnBeforeQuitting; +#endif + extern const base::Feature kMaterialDesignIncognitoNTP; extern const base::Feature kModalPermissionPrompts;
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 49b56bd..829f1dc 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc
@@ -73,6 +73,8 @@ "/run/imageloader/PepperFlashPlayer/libpepflashplayer.so"); const base::FilePath::CharType kChromeOSTPMFirmwareUpdateLocation[] = FILE_PATH_LITERAL("/run/tpm_firmware_update_location"); +const base::FilePath::CharType kChromeOSTPMFirmwareUpdateSRKVulnerableROCA[] = + FILE_PATH_LITERAL("/run/tpm_firmware_update_srk_vulnerable_roca"); #endif // defined(OS_CHROMEOS) static base::LazyInstance<base::FilePath>::DestructorAtExit @@ -585,6 +587,10 @@ cur = base::FilePath(kChromeOSTPMFirmwareUpdateLocation); create_dir = false; break; + case chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA: + cur = base::FilePath(kChromeOSTPMFirmwareUpdateSRKVulnerableROCA); + create_dir = false; + break; #endif // defined(OS_CHROMEOS) default:
diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index c9c3a3f..5556c9d5 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h
@@ -136,9 +136,13 @@ DIR_CHILD_USERS_DEFAULT_APPS, // Directory where installer places .crx // files to be installed when child user // session starts. - FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION, // File containing the location - // of the updated TPM firmware - // binary in the file system. + + // File containing the location of the updated TPM firmware binary in the file + // system. + FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION, + + // Flag file indicating SRK ROCA vulnerability status. + FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_SRK_VULNERABLE_ROCA, #endif // defined(OS_CHROMEOS) PATH_END };
diff --git a/chrome/common/extensions/chrome_extensions_client.cc b/chrome/common/extensions/chrome_extensions_client.cc index 3fe09247..43b5553 100644 --- a/chrome/common/extensions/chrome_extensions_client.cc +++ b/chrome/common/extensions/chrome_extensions_client.cc
@@ -96,9 +96,6 @@ } // namespace -static base::LazyInstance<ChromeExtensionsClient>::Leaky g_client = - LAZY_INSTANCE_INITIALIZER; - ChromeExtensionsClient::ChromeExtensionsClient() {} ChromeExtensionsClient::~ChromeExtensionsClient() { @@ -345,9 +342,4 @@ return ::GetUserAgent(); } -// static -ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { - return g_client.Pointer(); -} - } // namespace extensions
diff --git a/chrome/common/extensions/chrome_extensions_client.h b/chrome/common/extensions/chrome_extensions_client.h index 2e36464..68924fb 100644 --- a/chrome/common/extensions/chrome_extensions_client.h +++ b/chrome/common/extensions/chrome_extensions_client.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/compiler_specific.h" -#include "base/lazy_instance.h" #include "base/macros.h" #include "chrome/common/extensions/permissions/chrome_api_permissions.h" #include "chrome/common/extensions/permissions/chrome_permission_message_provider.h" @@ -57,9 +56,6 @@ bool ExtensionAPIEnabledInExtensionServiceWorkers() const override; std::string GetUserAgent() const override; - // Get the LazyInstance for ChromeExtensionsClient. - static ChromeExtensionsClient* GetInstance(); - private: const ChromeAPIPermissions chrome_api_permissions_; const ExtensionsAPIPermissions extensions_api_permissions_; @@ -74,8 +70,6 @@ GURL webstore_base_url_; GURL webstore_update_url_; - friend struct base::LazyInstanceTraitsBase<ChromeExtensionsClient>; - DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); };
diff --git a/chrome/common/initialize_extensions_client.cc b/chrome/common/initialize_extensions_client.cc new file mode 100644 index 0000000..316fe80 --- /dev/null +++ b/chrome/common/initialize_extensions_client.cc
@@ -0,0 +1,28 @@ +// Copyright 2018 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/common/initialize_extensions_client.h" + +#include "base/no_destructor.h" +#include "chrome/common/extensions/chrome_extensions_client.h" +#include "extensions/common/extensions_client.h" + +void EnsureExtensionsClientInitialized() { + static bool initialized = false; + + static base::NoDestructor<extensions::ChromeExtensionsClient> + extensions_client; + + if (!initialized) { + initialized = true; + extensions::ExtensionsClient::Set(extensions_client.get()); + } + + // ExtensionsClient::Set() will early-out if the client was already set, so + // this allows us to check that this was the only site setting it. + DCHECK_EQ(extensions_client.get(), extensions::ExtensionsClient::Get()) + << "ExtensionsClient should only be initialized through " + << "EnsureExtensionsClientInitialized() when using " + << "ChromeExtensionsClient."; +}
diff --git a/chrome/common/initialize_extensions_client.h b/chrome/common/initialize_extensions_client.h new file mode 100644 index 0000000..188ea65 --- /dev/null +++ b/chrome/common/initialize_extensions_client.h
@@ -0,0 +1,18 @@ +// Copyright 2018 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_COMMON_INITIALIZE_EXTENSIONS_CLIENT_H_ +#define CHROME_COMMON_INITIALIZE_EXTENSIONS_CLIENT_H_ + +#include "extensions/buildflags/buildflags.h" + +#if !BUILDFLAG(ENABLE_EXTENSIONS) +#error "Extensions must be enabled" +#endif + +// Initializes the single instance of the ExtensionsClient. Safe to call +// multiple times. +void EnsureExtensionsClientInitialized(); + +#endif // CHROME_COMMON_INITIALIZE_EXTENSIONS_CLIENT_H_
diff --git a/chrome/installer/setup/archive_patch_helper.cc b/chrome/installer/setup/archive_patch_helper.cc index 0051644..4d4f86e 100644 --- a/chrome/installer/setup/archive_patch_helper.cc +++ b/chrome/installer/setup/archive_patch_helper.cc
@@ -63,11 +63,15 @@ } bool ArchivePatchHelper::ApplyPatch() { + // TODO(ckitagawa): Swap ordering back to Zucchini first once we ship + // Zucchini based patches by default. + if (CourgetteEnsemblePatch() || BinaryPatch()) + return true; #if BUILDFLAG(ZUCCHINI) if (ZucchiniEnsemblePatch()) return true; #endif // BUILDFLAG(ZUCCHINI) - return CourgetteEnsemblePatch() || BinaryPatch(); + return false; } bool ArchivePatchHelper::CourgetteEnsemblePatch() { @@ -110,6 +114,9 @@ << target_.value() << " using Zucchini. err=" << static_cast<uint32_t>(result); + // Ensure a partial output is not left behind. + base::DeleteFile(target_, false); + return false; }
diff --git a/chrome/installer/setup/buildflags.gni b/chrome/installer/setup/buildflags.gni index 28a0ebb..9e7998e 100644 --- a/chrome/installer/setup/buildflags.gni +++ b/chrome/installer/setup/buildflags.gni
@@ -5,5 +5,5 @@ declare_args() { # Specify if the Zucchini patcher features should be included in setup.exe. # See //components/zucchini for more information. - use_zucchini = false + use_zucchini = true }
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 1435cbf..892be5e 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -157,7 +157,7 @@ #endif #if BUILDFLAG(ENABLE_EXTENSIONS) -#include "chrome/common/extensions/chrome_extensions_client.h" +#include "chrome/common/initialize_extensions_client.h" #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" #include "extensions/common/constants.h" #include "extensions/common/extension_urls.h" @@ -353,8 +353,7 @@ : main_entry_time_(base::TimeTicks::Now()), main_thread_profiler_(ThreadProfiler::CreateAndStartOnMainThread()) { #if BUILDFLAG(ENABLE_EXTENSIONS) - extensions::ExtensionsClient::Set( - extensions::ChromeExtensionsClient::GetInstance()); + EnsureExtensionsClientInitialized(); extensions::ExtensionsRendererClient::Set( ChromeExtensionsRendererClient::GetInstance()); #endif
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 573b651..fa813c6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -3329,7 +3329,7 @@ if (is_win || (is_linux && !is_chromeos)) { sources += - [ "../browser/ui/views/quit_instruction_bubble_controller_unittest.cc" ] + [ "../browser/ui/views/confirm_quit_bubble_controller_unittest.cc" ] } if (enable_native_notifications) {
diff --git a/chrome/test/base/chrome_unit_test_suite.cc b/chrome/test/base/chrome_unit_test_suite.cc index ea3546d..c5a714e 100644 --- a/chrome/test/base/chrome_unit_test_suite.cc +++ b/chrome/test/base/chrome_unit_test_suite.cc
@@ -35,8 +35,9 @@ #endif #if BUILDFLAG(ENABLE_EXTENSIONS) -#include "chrome/common/extensions/chrome_extensions_client.h" +#include "chrome/common/initialize_extensions_client.h" #include "extensions/common/extension_paths.h" +#include "extensions/common/extensions_client.h" #endif namespace { @@ -50,11 +51,6 @@ void OnTestStart(const testing::TestInfo& test_info) override { content_client_.reset(new ChromeContentClient); content::SetContentClient(content_client_.get()); -#if BUILDFLAG(ENABLE_EXTENSIONS) - extensions::ExtensionsClient::Get()->InitializeWebStoreUrls( - base::CommandLine::ForCurrentProcess()); - -#endif browser_content_client_.reset(new ChromeContentBrowserClient()); content::SetBrowserClientForTesting(browser_content_client_.get()); @@ -135,8 +131,7 @@ #if BUILDFLAG(ENABLE_EXTENSIONS) extensions::RegisterPathProvider(); - extensions::ExtensionsClient::Set( - extensions::ChromeExtensionsClient::GetInstance()); + EnsureExtensionsClientInitialized(); #endif content::WebUIControllerFactory::RegisterFactory(
diff --git a/chrome/test/data/media/picture-in-picture/icon.png b/chrome/test/data/media/picture-in-picture/icon.png new file mode 100644 index 0000000..f8c474b --- /dev/null +++ b/chrome/test/data/media/picture-in-picture/icon.png Binary files differ
diff --git a/chrome/test/data/media/picture-in-picture/window-size.html b/chrome/test/data/media/picture-in-picture/window-size.html index 2f7a116..6063287 100644 --- a/chrome/test/data/media/picture-in-picture/window-size.html +++ b/chrome/test/data/media/picture-in-picture/window-size.html
@@ -60,6 +60,27 @@ }); } + function setControls(ids) { + try{ + var controls = []; + Array.from(ids).forEach(id => { + controls.push({ + id: id, + label: "label_" + id, + icons: [{ + src: "icon.png", + sizes: "144x144", + type: "image/png", + }], + }); + }); + video.setPictureInPictureControls(controls); + return true; + } catch(error) { + return false; + } + } + function secondPictureInPicture() { secondVideo.requestPictureInPicture(); }
diff --git a/chrome/test/data/webui/md_history/md_history_browsertest.js b/chrome/test/data/webui/md_history/md_history_browsertest.js index ab8cc3b..362b09e 100644 --- a/chrome/test/data/webui/md_history/md_history_browsertest.js +++ b/chrome/test/data/webui/md_history/md_history_browsertest.js
@@ -98,7 +98,7 @@ // Times out on debug builders because the History page can take several seconds // to load in a Debug build. See https://crbug.com/669227. -GEN('#if !defined(NDEBUG)'); +GEN('#if !defined(NDEBUG) || defined(OS_MACOSX) || defined(OS_CHROMEOS)'); GEN('#define MAYBE_All DISABLED_All'); GEN('#else'); GEN('#define MAYBE_All All');
diff --git a/chrome/test/data/workers/fetch_from_nested_worker.js b/chrome/test/data/workers/fetch_from_nested_worker.js new file mode 100644 index 0000000..f6d9ccbf --- /dev/null +++ b/chrome/test/data/workers/fetch_from_nested_worker.js
@@ -0,0 +1,7 @@ +// Copyright 2018 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. + +const worker = new Worker('fetch_from_worker.js'); +worker.onmessage = e => self.postMessage(e.data); +self.onmessage = e => worker.postMessage(e.data);
diff --git a/chrome/test/data/workers/fetch_from_worker.html b/chrome/test/data/workers/fetch_from_worker.html index 661d2d1..befe1afe 100644 --- a/chrome/test/data/workers/fetch_from_worker.html +++ b/chrome/test/data/workers/fetch_from_worker.html
@@ -1,5 +1,6 @@ <script> -const worker = new Worker('fetch_from_worker.js'); +const params = new URLSearchParams(location.search); +const worker = new Worker(params.get('script')); worker.onmessage = e => { document.body.innerText += e.data; document.title = 'DONE';
diff --git a/chromecast/renderer/extensions/automation_internal_custom_bindings.cc b/chromecast/renderer/extensions/automation_internal_custom_bindings.cc index 9920aa8..b866799 100644 --- a/chromecast/renderer/extensions/automation_internal_custom_bindings.cc +++ b/chromecast/renderer/extensions/automation_internal_custom_bindings.cc
@@ -145,7 +145,10 @@ if (args.Length() != 1 || !args[0]->IsNumber()) ThrowInvalidArgumentsException(automation_bindings_); - int tree_id = args[0]->Int32Value(); + int tree_id = + args[0] + ->Int32Value(automation_bindings_->context()->v8_context()) + .FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = automation_bindings_->GetAutomationAXTreeWrapperFromTreeID(tree_id); if (!tree_wrapper) @@ -190,8 +193,10 @@ if (args.Length() < 2 || !args[0]->IsNumber() || !args[1]->IsNumber()) ThrowInvalidArgumentsException(automation_bindings_); - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); + v8::Local<v8::Context> context = + automation_bindings_->context()->v8_context(); + int tree_id = args[0]->Int32Value(context).FromMaybe(0); + int node_id = args[1]->Int32Value(context).FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = automation_bindings_->GetAutomationAXTreeWrapperFromTreeID(tree_id); @@ -242,8 +247,10 @@ ThrowInvalidArgumentsException(automation_bindings_); } - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); + v8::Local<v8::Context> context = + automation_bindings_->context()->v8_context(); + int tree_id = args[0]->Int32Value(context).FromMaybe(0); + int node_id = args[1]->Int32Value(context).FromMaybe(0); std::string attribute = *v8::String::Utf8Value(isolate, args[2]); AutomationAXTreeWrapper* tree_wrapper = @@ -296,10 +303,12 @@ ThrowInvalidArgumentsException(automation_bindings_); } - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); - int start = args[2]->Int32Value(); - int end = args[3]->Int32Value(); + v8::Local<v8::Context> context = + automation_bindings_->context()->v8_context(); + int tree_id = args[0]->Int32Value(context).FromMaybe(0); + int node_id = args[1]->Int32Value(context).FromMaybe(0); + int start = args[2]->Int32Value(context).FromMaybe(0); + int end = args[3]->Int32Value(context).FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = automation_bindings_->GetAutomationAXTreeWrapperFromTreeID(tree_id); @@ -1028,7 +1037,7 @@ return; } - int tree_id = args[0]->Int32Value(); + int tree_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); auto iter = tree_id_to_tree_wrapper_map_.find(tree_id); if (iter == tree_id_to_tree_wrapper_map_.end()) return; @@ -1046,7 +1055,7 @@ } TreeChangeObserver observer; - observer.id = args[0]->Int32Value(); + observer.id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); std::string filter_str = *v8::String::Utf8Value(args.GetIsolate(), args[1]); observer.filter = api::automation::ParseTreeChangeObserverFilter(filter_str); @@ -1063,7 +1072,7 @@ return; } - int observer_id = args[0]->Int32Value(); + int observer_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); for (auto iter = tree_change_observers_.begin(); iter != tree_change_observers_.end(); ++iter) { @@ -1131,7 +1140,7 @@ return; } - int tree_id = args[0]->Int32Value(); + int tree_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = GetAutomationAXTreeWrapperFromTreeID(tree_id); if (!tree_wrapper) @@ -1154,8 +1163,8 @@ if (args.Length() < 2 || !args[0]->IsNumber() || !args[1]->IsNumber()) ThrowInvalidArgumentsException(this); - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); + int tree_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); + int node_id = args[1]->Int32Value(context()->v8_context()).FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = GetAutomationAXTreeWrapperFromTreeID(tree_id); @@ -1178,8 +1187,8 @@ if (args.Length() < 2 || !args[0]->IsNumber() || !args[1]->IsNumber()) ThrowInvalidArgumentsException(this); - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); + int tree_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); + int node_id = args[1]->Int32Value(context()->v8_context()).FromMaybe(0); AutomationAXTreeWrapper* tree_wrapper = GetAutomationAXTreeWrapperFromTreeID(tree_id); @@ -1317,8 +1326,8 @@ return; } - int tree_id = args[0]->Int32Value(); - int node_id = args[1]->Int32Value(); + int tree_id = args[0]->Int32Value(context()->v8_context()).FromMaybe(0); + int node_id = args[1]->Int32Value(context()->v8_context()).FromMaybe(0); const auto iter = tree_id_to_tree_wrapper_map_.find(tree_id); if (iter == tree_id_to_tree_wrapper_map_.end()) @@ -1329,7 +1338,7 @@ if (!node) return; - int index = args[2]->Int32Value(); + int index = args[2]->Int32Value(context()->v8_context()).FromMaybe(0); if (index < 0 || index >= node->child_count()) return;
diff --git a/components/cast_channel/cast_socket_unittest.cc b/components/cast_channel/cast_socket_unittest.cc index a67424d..4a6c47a6 100644 --- a/components/cast_channel/cast_socket_unittest.cc +++ b/components/cast_channel/cast_socket_unittest.cc
@@ -22,6 +22,7 @@ #include "base/sys_byteorder.h" #include "base/threading/thread_task_runner_handle.h" #include "base/timer/mock_timer.h" +#include "build/build_config.h" #include "components/cast_channel/cast_auth_util.h" #include "components/cast_channel/cast_framer.h" #include "components/cast_channel/cast_message_util.h" @@ -977,9 +978,16 @@ base::Unretained(&handler_))); } +// https://crbug.com/874491, flaky on Win +#if defined(OS_WIN) +#define MAYBE_TestConnectEndToEndWithRealSSL \ + DISABLED_TestConnectEndToEndWithRealSSL +#else +#define MAYBE_TestConnectEndToEndWithRealSSL TestConnectEndToEndWithRealSSL +#endif // Tests connecting through an actual non-mocked CastTransport object and // non-mocked SSLClientSocket, testing the components in integration. -TEST_F(SslCastSocketTest, TestConnectEndToEndWithRealSSL) { +TEST_F(SslCastSocketTest, MAYBE_TestConnectEndToEndWithRealSSL) { CreateSockets(); ConnectSockets();
diff --git a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java index 1367a2d..0e1880f 100644 --- a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java +++ b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java
@@ -94,7 +94,8 @@ + mInitialContentLength + " bytes"); } if (mConnected) { - throw new IllegalStateException("Cannot write after being connected."); + throw new IllegalStateException("Use setFixedLengthStreamingMode() or " + + "setChunkedStreamingMode() for writing after connect"); } if (mInitialContentLength != -1) { // If mInitialContentLength is known, the buffer should not grow.
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java index 8ca050e1..04678ac1 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java
@@ -92,7 +92,9 @@ out.write(TestUtil.UPLOAD_DATA); fail(); } catch (IllegalStateException e) { - assertEquals("Cannot write after being connected.", e.getMessage()); + assertEquals("Use setFixedLengthStreamingMode() or " + + "setChunkedStreamingMode() for writing after connect", + e.getMessage()); } }
diff --git a/components/drive/chromeos/team_drive_list_loader.cc b/components/drive/chromeos/team_drive_list_loader.cc index ca18aee..66a988e 100644 --- a/components/drive/chromeos/team_drive_list_loader.cc +++ b/components/drive/chromeos/team_drive_list_loader.cc
@@ -257,20 +257,18 @@ std::transform(remote_resources.begin(), remote_resources.end(), std::back_inserter(team_drive_updates.all_team_drives), [](const ResourceEntry& entry) -> TeamDrive { - return { - entry.resource_id(), entry.base_name(), - drive::util::GetDriveTeamDrivesRootPath().AppendASCII( - entry.base_name())}; + return {entry.resource_id(), entry.base_name(), + drive::util::GetDriveTeamDrivesRootPath().Append( + util::NormalizeFileName(entry.base_name()))}; }); // Create a copy of the added team drives list to notify observers. std::transform(added_team_drives.begin(), added_team_drives.end(), std::back_inserter(team_drive_updates.added_team_drives), [](const ResourceEntry& entry) -> TeamDrive { - return { - entry.resource_id(), entry.base_name(), - drive::util::GetDriveTeamDrivesRootPath().AppendASCII( - entry.base_name())}; + return {entry.resource_id(), entry.base_name(), + drive::util::GetDriveTeamDrivesRootPath().Append( + util::NormalizeFileName(entry.base_name()))}; }); // Create a copy of the removed team drives list to notify observers.
diff --git a/components/drive/service/drive_api_service.cc b/components/drive/service/drive_api_service.cc index ae7ff1cd..9f45b7a 100644 --- a/components/drive/service/drive_api_service.cc +++ b/components/drive/service/drive_api_service.cc
@@ -504,6 +504,7 @@ std::make_unique<TeamDriveListRequest>(sender_.get(), url_generator_, callback); request->set_page_token(page_token); + request->set_max_results(kMaxNumTeamDriveResourcePerRequest); request->set_fields(kTeamDrivesListFields); return sender_->StartRequestWithAuthRetry(std::move(request)); }
diff --git a/components/drive/team_drive_list_loader_unittest.cc b/components/drive/team_drive_list_loader_unittest.cc index ac454ff..185c911 100644 --- a/components/drive/team_drive_list_loader_unittest.cc +++ b/components/drive/team_drive_list_loader_unittest.cc
@@ -186,6 +186,51 @@ util::GetDriveTeamDrivesRootPath().AppendASCII(kTeamDriveName1)); } +TEST_F(TeamDriveListLoaderTest, NotmalizedTeamDriveName) { + constexpr char kTeamDriveId1[] = "the1stTeamDriveId"; + constexpr char kTeamDriveName1[] = "A / Strange / Team / Drive / Name"; + constexpr char kTeamDriveNormalized1[] = "A _ Strange _ Team _ Drive _ Name"; + drive_service_->AddTeamDrive(kTeamDriveId1, kTeamDriveName1); + + FileError error = FILE_ERROR_FAILED; + team_drive_list_loader_->CheckForUpdates( + google_apis::test_util::CreateCopyResultCallback(&error)); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(FILE_ERROR_OK, error); + EXPECT_EQ(1, drive_service_->team_drive_list_load_count()); + + EXPECT_EQ(1UL, team_drive_list_observer_->team_drives_list().size()); + EXPECT_EQ(1UL, team_drive_list_observer_->added_team_drives().size()); + EXPECT_TRUE(team_drive_list_observer_->removed_team_drives().empty()); + + ResourceEntryVector entries; + EXPECT_EQ(FILE_ERROR_OK, metadata_->ReadDirectoryByPath( + util::GetDriveTeamDrivesRootPath(), &entries)); + EXPECT_EQ(1UL, entries.size()); + + ResourceEntry entry; + EXPECT_EQ( + FILE_ERROR_OK, + metadata_->GetResourceEntryByPath( + util::GetDriveTeamDrivesRootPath().Append(kTeamDriveNormalized1), + &entry)); + + { + const base::FilePath& team_drive_path = + team_drive_list_observer_->team_drives_list().front().team_drive_path(); + EXPECT_EQ(team_drive_path, + util::GetDriveTeamDrivesRootPath().Append(kTeamDriveNormalized1)); + } + { + const base::FilePath& team_drive_path = + team_drive_list_observer_->added_team_drives() + .front() + .team_drive_path(); + EXPECT_EQ(team_drive_path, + util::GetDriveTeamDrivesRootPath().Append(kTeamDriveNormalized1)); + } +} + // Tests if there are multiple team drives on the server, we will add them all // to local metadata. TEST_F(TeamDriveListLoaderTest, MultipleTeamDrive) {
diff --git a/components/mirroring/service/fake_network_service.h b/components/mirroring/service/fake_network_service.h index 3612147..4fdceb2 100644 --- a/components/mirroring/service/fake_network_service.h +++ b/components/mirroring/service/fake_network_service.h
@@ -31,6 +31,10 @@ network::mojom::UDPSocketOptionsPtr options, BindCallback callback) override {} void SetBroadcast(bool broadcast, SetBroadcastCallback callback) override {} + void SetSendBufferSize(int32_t send_buffer_size, + SetSendBufferSizeCallback callback) override {} + void SetReceiveBufferSize(int32_t receive_buffer_size, + SetReceiveBufferSizeCallback callback) override {} void JoinGroup(const net::IPAddress& group_address, JoinGroupCallback callback) override {} void LeaveGroup(const net::IPAddress& group_address,
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-25.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-25.png new file mode 100644 index 0000000..63b88b8b --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-25.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-26.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-26.png new file mode 100644 index 0000000..cf22d8f6 --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-26.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr.Pixel_XL-27.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-27.png similarity index 100% rename from components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr.Pixel_XL-27.png rename to components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_alert.Pixel_XL-27.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-25.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-25.png new file mode 100644 index 0000000..5a0fc65 --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-25.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-26.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-26.png new file mode 100644 index 0000000..deafaa7a --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_confirm.Pixel_XL-26.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-25.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-25.png new file mode 100644 index 0000000..52416317 --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-25.png Binary files differ
diff --git a/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-26.png b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-26.png new file mode 100644 index 0000000..b6afc6b2 --- /dev/null +++ b/components/test/data/js_dialogs/render_tests/VrBrowserJavaScriptModalDialogTest.js_modal_view_vr_prompt.Pixel_XL-26.png Binary files differ
diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h index d2a3a3b..9ea4b9f 100644 --- a/components/upload_list/upload_list.h +++ b/components/upload_list/upload_list.h
@@ -64,7 +64,6 @@ base::string16 file_size; }; - // Creates a new upload list with the given callback delegate. UploadList(); // Starts loading the upload list. OnUploadListAvailable will be called when
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 891bdb1..f5dc926 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2177,14 +2177,10 @@ "android/tracing_controller_android.h", "android/web_contents_observer_proxy.cc", "android/web_contents_observer_proxy.h", - "font_unique_name_lookup/font_table_matcher.cc", - "font_unique_name_lookup/font_table_matcher.h", "font_unique_name_lookup/font_unique_name_lookup.cc", "font_unique_name_lookup/font_unique_name_lookup.h", "font_unique_name_lookup/font_unique_name_lookup_service.cc", "font_unique_name_lookup/font_unique_name_lookup_service.h", - "font_unique_name_lookup/icu_fold_case_util.cc", - "font_unique_name_lookup/icu_fold_case_util.h", "frame_host/render_frame_host_android.cc", "frame_host/render_frame_host_android.h", "media/capture/screen_capture_device_android.cc", @@ -2232,12 +2228,12 @@ deps += [ ":reflection_jni_headers", "//build/config/freetype", - "//content/browser/font_unique_name_lookup:font_unique_name_table_proto", "//content/public/android:jni", "//device/gamepad/public/mojom", "//media", "//media/capture/content/android", "//media/capture/video/android", + "//third_party/blink/public/common:font_unique_name_table_proto", "//third_party/icu", "//ui/accessibility:ax_assistant", "//ui/accessibility/mojom",
diff --git a/content/browser/accessibility/line_layout_browsertest.cc b/content/browser/accessibility/line_layout_browsertest.cc index b740d9a..e6d0bd4 100644 --- a/content/browser/accessibility/line_layout_browsertest.cc +++ b/content/browser/accessibility/line_layout_browsertest.cc
@@ -58,8 +58,10 @@ } }; +// http://crbug.com/868830 - the patch that enabled this test to pass +// caused a performance regression. IN_PROC_BROWSER_TEST_F(AccessibilityLineLayoutBrowserTest, - WholeBlockIsUpdated) { + DISABLED_WholeBlockIsUpdated) { ASSERT_TRUE(embedded_test_server()->Start()); AccessibilityNotificationWaiter waiter(shell()->web_contents(),
diff --git a/content/browser/background_fetch/background_fetch_context.cc b/content/browser/background_fetch/background_fetch_context.cc index 83bf25e..21dbc5e5 100644 --- a/content/browser/background_fetch/background_fetch_context.cc +++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -364,9 +364,10 @@ case BackgroundFetchReasonToAbort::ABORTED_BY_DEVELOPER: case BackgroundFetchReasonToAbort::CANCELLED_FROM_UI: CleanupRegistration(registration_id, {}, - mojom::BackgroundFetchState::FAILED); - event_dispatcher_.DispatchBackgroundFetchAbortEvent(registration_id, - base::DoNothing()); + blink::mojom::BackgroundFetchState::FAILURE); + event_dispatcher_.DispatchBackgroundFetchAbortEvent( + registration_id, blink::mojom::BackgroundFetchState::FAILURE, + base::DoNothing()); return; case BackgroundFetchReasonToAbort::TOTAL_DOWNLOAD_SIZE_EXCEEDED: case BackgroundFetchReasonToAbort::SERVICE_WORKER_UNAVAILABLE: @@ -393,7 +394,7 @@ if (error != blink::mojom::BackgroundFetchError::NONE) { CleanupRegistration(registration_id, {} /* fetches */, - mojom::BackgroundFetchState::FAILED, + blink::mojom::BackgroundFetchState::FAILURE, true /* preserve_info_to_dispatch_click_event */); return; } @@ -403,7 +404,8 @@ // `backgroundfetchfail` event will be invoked instead. if (background_fetch_succeeded) { event_dispatcher_.DispatchBackgroundFetchSuccessEvent( - registration_id, std::move(settled_fetches), + registration_id, blink::mojom::BackgroundFetchState::SUCCESS, + std::move(settled_fetches), base::BindOnce( &BackgroundFetchContext::CleanupRegistration, weak_factory_.GetWeakPtr(), registration_id, @@ -411,18 +413,20 @@ // |blob_data_handles| to the callback to keep them alive // until the waitUntil event is resolved. std::move(blob_data_handles), - mojom::BackgroundFetchState::SUCCEEDED, + blink::mojom::BackgroundFetchState::SUCCESS, true /* preserve_info_to_dispatch_click_event */)); } else { event_dispatcher_.DispatchBackgroundFetchFailEvent( - registration_id, std::move(settled_fetches), + registration_id, blink::mojom::BackgroundFetchState::FAILURE, + std::move(settled_fetches), base::BindOnce( &BackgroundFetchContext::CleanupRegistration, weak_factory_.GetWeakPtr(), registration_id, // The blob uuid is sent as part of |settled_fetches|. Bind // |blob_data_handles| to the callback to keep them alive // until the waitUntil event is resolved. - std::move(blob_data_handles), mojom::BackgroundFetchState::FAILED, + std::move(blob_data_handles), + blink::mojom::BackgroundFetchState::FAILURE, true /* preserve_info_to_dispatch_click_event */)); } } @@ -430,7 +434,7 @@ void BackgroundFetchContext::CleanupRegistration( const BackgroundFetchRegistrationId& registration_id, const std::vector<std::unique_ptr<storage::BlobDataHandle>>& blob_handles, - mojom::BackgroundFetchState background_fetch_state, + blink::mojom::BackgroundFetchState background_fetch_state, bool preserve_info_to_dispatch_click_event) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -441,7 +445,8 @@ // the information we want to persist after the controller is gone, in // completed_fetches_. if (preserve_info_to_dispatch_click_event) { - completed_fetches_[registration_id.unique_id()] = registration_id; + completed_fetches_[registration_id.unique_id()] = {registration_id, + background_fetch_state}; } job_controllers_.erase(registration_id.unique_id()); @@ -464,7 +469,8 @@ if (iter != completed_fetches_.end()) { // The fetch has succeeded or failed. (not aborted/cancelled). event_dispatcher_.DispatchBackgroundFetchClickEvent( - iter->second /* registration_id */, base::DoNothing()); + iter->second.first /* registration_id */, + iter->second.second /* state */, base::DoNothing()); completed_fetches_.erase(iter); return; } @@ -473,8 +479,11 @@ auto controllers_iter = job_controllers_.find(unique_id); if (controllers_iter == job_controllers_.end()) return; + // TODO(crbug.com/873630): Implement a background fetch state manager to + // keep track of states, and stop hard-coding it here. event_dispatcher_.DispatchBackgroundFetchClickEvent( - controllers_iter->second->registration_id(), base::DoNothing()); + controllers_iter->second->registration_id(), + blink::mojom::BackgroundFetchState::PENDING, base::DoNothing()); } void BackgroundFetchContext::LastObserverGarbageCollected(
diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h index 23e9d532..d3483a0 100644 --- a/content/browser/background_fetch/background_fetch_context.h +++ b/content/browser/background_fetch/background_fetch_context.h
@@ -219,7 +219,7 @@ const BackgroundFetchRegistrationId& registration_id, const std::vector<std::unique_ptr<storage::BlobDataHandle>>& blob_data_handles, - mojom::BackgroundFetchState background_fetch_state, + blink::mojom::BackgroundFetchState background_fetch_state, bool preserve_info_to_dispatch_click_event = false); // Called when the last JavaScript BackgroundFetchRegistration object has been @@ -254,12 +254,14 @@ std::map<std::string, std::unique_ptr<BackgroundFetchJobController>> job_controllers_; - // Map from |unique_id|s to |registration_id|s. An entry in here means the - // fetch has completed. This information is needed after the fetch has - // completed to dispatch the backgroundfetchclick event. + // Map from |unique_id|s to {|registration_id|s, BackgroundFetchState}. + // An entry in here means the fetch has completed. This information is needed + // after the fetch has completed to dispatch the backgroundfetchclick event. // TODO(crbug.com/857122): Clean this up when the UI is no longer showing. - std::map<std::string, BackgroundFetchRegistrationId> completed_fetches_; - + std::map<std::string, + std::pair<BackgroundFetchRegistrationId, + blink::mojom::BackgroundFetchState>> + completed_fetches_; // Map from BackgroundFetchRegistrationIds to FetchCallbacks for active // fetches. Must be destroyed before |data_manager_| and // |registration_notifier_|. Since FetchCallback is a OnceCallback, please
diff --git a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc index 8ff1c510..c52f6b5 100644 --- a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc +++ b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
@@ -22,9 +22,11 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback) { last_developer_id_ = developer_id; last_unique_id_ = unique_id; + last_state_ = state; if (fail_abort_event_) { std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::REJECTED, @@ -41,9 +43,11 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback) { last_developer_id_ = developer_id; last_unique_id_ = unique_id; + last_state_ = state; if (fail_click_event_) { std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::REJECTED, @@ -60,10 +64,12 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback) { last_developer_id_ = developer_id; last_unique_id_ = unique_id; + last_state_ = state; last_fetches_ = fetches; if (fail_fetch_fail_event_) { @@ -81,11 +87,13 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback) { last_developer_id_ = developer_id; last_unique_id_ = unique_id; + last_state_ = state; last_fetches_ = fetches; if (fail_fetched_event_) {
diff --git a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h index f799a145..5fcb21d 100644 --- a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h +++ b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h
@@ -17,10 +17,6 @@ struct BackgroundFetchSettledFetch; -namespace mojom { -enum class BackgroundFetchState; -} - // Extension of the EmbeddedWorkerTestHelper that enables instrumentation of the // events related to the Background Fetch API. Storage for these tests will // always be kept in memory, as data persistence is tested elsewhere. @@ -56,7 +52,7 @@ const base::Optional<std::string>& last_unique_id() const { return last_unique_id_; } - const base::Optional<mojom::BackgroundFetchState>& last_state() const { + const base::Optional<blink::mojom::BackgroundFetchState>& last_state() const { return last_state_; } const base::Optional<std::vector<BackgroundFetchSettledFetch>> last_fetches() @@ -69,22 +65,26 @@ void OnBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback) override; void OnBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback) override; void OnBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback) override; void OnBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback) override; @@ -102,7 +102,7 @@ base::Optional<std::string> last_developer_id_; base::Optional<std::string> last_unique_id_; - base::Optional<mojom::BackgroundFetchState> last_state_; + base::Optional<blink::mojom::BackgroundFetchState> last_state_; base::Optional<std::vector<BackgroundFetchSettledFetch>> last_fetches_; DISALLOW_COPY_AND_ASSIGN(BackgroundFetchEmbeddedWorkerTestHelper);
diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher.cc b/content/browser/background_fetch/background_fetch_event_dispatcher.cc index a17344a..e584c319 100644 --- a/content/browser/background_fetch/background_fetch_event_dispatcher.cc +++ b/content/browser/background_fetch/background_fetch_event_dispatcher.cc
@@ -75,6 +75,7 @@ void BackgroundFetchEventDispatcher::DispatchBackgroundFetchAbortEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, base::OnceClosure finished_closure) { DCHECK_CURRENTLY_ON(BrowserThread::IO); LoadServiceWorkerRegistrationForDispatch( @@ -82,22 +83,24 @@ std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchAbortEvent, - registration_id.developer_id(), registration_id.unique_id())); + registration_id.developer_id(), registration_id.unique_id(), state)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->endpoint()->DispatchBackgroundFetchAbortEvent( - developer_id, unique_id, + developer_id, unique_id, state, service_worker_version->CreateSimpleEventCallback(request_id)); } void BackgroundFetchEventDispatcher::DispatchBackgroundFetchClickEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, base::OnceClosure finished_closure) { DCHECK_CURRENTLY_ON(BrowserThread::IO); LoadServiceWorkerRegistrationForDispatch( @@ -105,21 +108,23 @@ std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchClickEvent, - registration_id)); + registration_id, state)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchClickEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->endpoint()->DispatchBackgroundFetchClickEvent( - registration_id.developer_id(), registration_id.unique_id(), + registration_id.developer_id(), registration_id.unique_id(), state, service_worker_version->CreateSimpleEventCallback(request_id)); } void BackgroundFetchEventDispatcher::DispatchBackgroundFetchFailEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, base::OnceClosure finished_closure) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -128,24 +133,26 @@ std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchFailEvent, - registration_id.developer_id(), registration_id.unique_id(), + registration_id.developer_id(), registration_id.unique_id(), state, fetches)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->endpoint()->DispatchBackgroundFetchFailEvent( - developer_id, unique_id, fetches, + developer_id, unique_id, state, fetches, service_worker_version->CreateSimpleEventCallback(request_id)); } void BackgroundFetchEventDispatcher::DispatchBackgroundFetchSuccessEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, base::OnceClosure finished_closure) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -156,18 +163,19 @@ base::Bind(&BackgroundFetchEventDispatcher:: DoDispatchBackgroundFetchSuccessEvent, registration_id.developer_id(), registration_id.unique_id(), - fetches)); + state, fetches)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->endpoint()->DispatchBackgroundFetchSuccessEvent( - developer_id, unique_id, fetches, + developer_id, unique_id, state, fetches, service_worker_version->CreateSimpleEventCallback(request_id)); }
diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher.h b/content/browser/background_fetch/background_fetch_event_dispatcher.h index dc864e7..5fa5af8 100644 --- a/content/browser/background_fetch/background_fetch_event_dispatcher.h +++ b/content/browser/background_fetch/background_fetch_event_dispatcher.h
@@ -45,12 +45,14 @@ // background fetch was aborted by the user or another external event. void DispatchBackgroundFetchAbortEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, base::OnceClosure finished_closure); // Dispatches the `backgroundfetchclick` event, which indicates that the user // interface displayed for an active background fetch was activated. void DispatchBackgroundFetchClickEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, base::OnceClosure finished_closure); // Dispatches the `backgroundfetchfail` event, which indicates that a @@ -58,6 +60,7 @@ // response pairs are included. void DispatchBackgroundFetchFailEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, base::OnceClosure finished_closure); @@ -66,6 +69,7 @@ // included. void DispatchBackgroundFetchSuccessEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, base::OnceClosure finished_closure); @@ -115,21 +119,25 @@ static void DoDispatchBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id); static void DoDispatchBackgroundFetchClickEvent( const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchState state, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id); static void DoDispatchBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id); static void DoDispatchBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, scoped_refptr<ServiceWorkerVersion> service_worker_version, int request_id);
diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc b/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc index 11ea633..3c34c478 100644 --- a/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc +++ b/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc
@@ -16,6 +16,7 @@ #include "content/browser/background_fetch/background_fetch_test_base.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom.h" namespace content { namespace { @@ -44,8 +45,9 @@ kExampleUniqueId); base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchAbortEvent(invalid_registration_id, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchAbortEvent( + invalid_registration_id, blink::mojom::BackgroundFetchState::FAILURE, + run_loop.QuitClosure()); run_loop.Run(); @@ -71,8 +73,9 @@ { base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchAbortEvent(registration_id, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchAbortEvent( + registration_id, blink::mojom::BackgroundFetchState::FAILURE, + run_loop.QuitClosure()); run_loop.Run(); } @@ -96,8 +99,9 @@ { base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchAbortEvent(second_registration_id, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchAbortEvent( + second_registration_id, blink::mojom::BackgroundFetchState::FAILURE, + run_loop.QuitClosure()); run_loop.Run(); } @@ -131,8 +135,9 @@ { base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchClickEvent(registration_id, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchClickEvent( + registration_id, blink::mojom::BackgroundFetchState::PENDING, + run_loop.QuitClosure()); run_loop.Run(); } @@ -140,7 +145,9 @@ ASSERT_TRUE(embedded_worker_test_helper()->last_developer_id().has_value()); EXPECT_EQ(kExampleDeveloperId, embedded_worker_test_helper()->last_developer_id().value()); - + ASSERT_TRUE(embedded_worker_test_helper()->last_state().has_value()); + EXPECT_EQ(blink::mojom::BackgroundFetchState::PENDING, + embedded_worker_test_helper()->last_state()); histogram_tester_.ExpectUniqueSample( "BackgroundFetch.EventDispatchResult.ClickEvent", @@ -154,8 +161,9 @@ { base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchClickEvent(second_registration_id, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchClickEvent( + second_registration_id, blink::mojom::BackgroundFetchState::FAILURE, + run_loop.QuitClosure()); run_loop.Run(); } @@ -163,6 +171,9 @@ ASSERT_TRUE(embedded_worker_test_helper()->last_developer_id().has_value()); EXPECT_EQ(kExampleDeveloperId2, embedded_worker_test_helper()->last_developer_id().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_state().has_value()); + EXPECT_EQ(blink::mojom::BackgroundFetchState::FAILURE, + embedded_worker_test_helper()->last_state()); histogram_tester_.ExpectBucketCount( "BackgroundFetch.EventDispatchResult.ClickEvent", @@ -189,8 +200,9 @@ { base::RunLoop run_loop; - event_dispatcher_.DispatchBackgroundFetchFailEvent(registration_id, fetches, - run_loop.QuitClosure()); + event_dispatcher_.DispatchBackgroundFetchFailEvent( + registration_id, blink::mojom::BackgroundFetchState::FAILURE, fetches, + run_loop.QuitClosure()); run_loop.Run(); } @@ -218,7 +230,8 @@ { base::RunLoop run_loop; event_dispatcher_.DispatchBackgroundFetchFailEvent( - second_registration_id, fetches, run_loop.QuitClosure()); + second_registration_id, blink::mojom::BackgroundFetchState::FAILURE, + fetches, run_loop.QuitClosure()); run_loop.Run(); } @@ -257,7 +270,8 @@ { base::RunLoop run_loop; event_dispatcher_.DispatchBackgroundFetchSuccessEvent( - registration_id, fetches, run_loop.QuitClosure()); + registration_id, blink::mojom::BackgroundFetchState::SUCCESS, fetches, + run_loop.QuitClosure()); run_loop.Run(); } @@ -289,7 +303,8 @@ { base::RunLoop run_loop; event_dispatcher_.DispatchBackgroundFetchSuccessEvent( - second_registration_id, fetches, run_loop.QuitClosure()); + second_registration_id, blink::mojom::BackgroundFetchState::SUCCESS, + fetches, run_loop.QuitClosure()); run_loop.Run(); }
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index b41adf0b..b199dab 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc
@@ -529,7 +529,8 @@ break; case PROCESS_TYPE_GPU: - memory_size = 64 << 10; // 64 KiB + // This needs to be larger for the display-compositor in the gpu process. + memory_size = 256 << 10; // 256 KiB metrics_name = "GpuMetrics"; break;
diff --git a/content/browser/font_unique_name_lookup/BUILD.gn b/content/browser/font_unique_name_lookup/BUILD.gn deleted file mode 100644 index d74bae9..0000000 --- a/content/browser/font_unique_name_lookup/BUILD.gn +++ /dev/null
@@ -1,14 +0,0 @@ -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/freetype/freetype.gni") -import("//third_party/protobuf/proto_library.gni") - -assert(is_android) - -proto_library("font_unique_name_table_proto") { - sources = [ - "font_unique_name_table.proto", - ] -}
diff --git a/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc b/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc index c4c028b..5199a96 100644 --- a/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc +++ b/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc
@@ -12,8 +12,8 @@ #include "base/no_destructor.h" #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" -#include "content/browser/font_unique_name_lookup/font_unique_name_table.pb.h" -#include "content/browser/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.pb.h" +#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" #include <set> #include <vector> @@ -134,7 +134,7 @@ } bool FontUniqueNameLookup::UpdateTableIfNeeded() { - FontUniqueNameTable font_table; + blink::FontUniqueNameTable font_table; bool update_needed = !proto_storage_.IsValid() || !proto_storage_.mapping.size() || !font_table.ParseFromArray(proto_storage_.mapping.memory(), @@ -148,7 +148,7 @@ bool FontUniqueNameLookup::UpdateTable() { std::vector<std::string> font_files_to_index = GetFontFilePaths(); - FontUniqueNameTable font_table; + blink::FontUniqueNameTable font_table; font_table.set_stored_for_android_build_fp(GetAndroidBuildFingerprint()); for (const auto& font_file : font_files_to_index) { int32_t number_of_faces = NumberOfFacesInFontFile(font_file); @@ -195,7 +195,7 @@ return false; } - FontUniqueNameTable font_table; + blink::FontUniqueNameTable font_table; if (!font_table.ParseFromArray(proto_storage_.mapping.memory(), proto_storage_.mapping.size())) { proto_storage_ = base::MappedReadOnlyRegion(); @@ -230,7 +230,7 @@ } bool FontUniqueNameLookup::IndexFile( - FontUniqueNameTable_FontUniqueNameEntry* font_entry, + blink::FontUniqueNameTable_FontUniqueNameEntry* font_entry, const std::string& font_file_path, uint32_t ttc_index) { ScopedFtFace face(ft_library_, font_file_path.c_str(), ttc_index); @@ -296,10 +296,10 @@ switch (sfnt_name.name_id) { case TT_NAME_ID_PS_NAME: - font_entry->set_postscript_name(IcuFoldCase(sfnt_name_string)); + font_entry->set_postscript_name(blink::IcuFoldCase(sfnt_name_string)); break; case TT_NAME_ID_FULL_NAME: - font_entry->set_full_name(IcuFoldCase(sfnt_name_string)); + font_entry->set_full_name(blink::IcuFoldCase(sfnt_name_string)); break; default: break;
diff --git a/content/browser/font_unique_name_lookup/font_unique_name_lookup.h b/content/browser/font_unique_name_lookup/font_unique_name_lookup.h index eb5983c2c..5cf38306 100644 --- a/content/browser/font_unique_name_lookup/font_unique_name_lookup.h +++ b/content/browser/font_unique_name_lookup/font_unique_name_lookup.h
@@ -16,9 +16,11 @@ #include <string> -namespace content { - +namespace blink { class FontUniqueNameTable_FontUniqueNameEntry; +} + +namespace content { // Scans a set of font files for the full font name and postscript name // information in the name table and builds a Protobuf lookup structure from @@ -103,9 +105,10 @@ // Scan the font file at |font_file_path| and given |ttc_index| and extract // full font name and postscript name from the font and store it into the // font_index_entry protobuf object. - bool IndexFile(FontUniqueNameTable_FontUniqueNameEntry* font_index_entry, - const std::string& font_file_path, - uint32_t ttc_index); + bool IndexFile( + blink::FontUniqueNameTable_FontUniqueNameEntry* font_index_entry, + const std::string& font_file_path, + uint32_t ttc_index); // For a TrueType font collection, determine how many font faces are // available in a file. int32_t NumberOfFacesInFontFile(const std::string& font_filename) const;
diff --git a/content/browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc b/content/browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc index c24f9f68..bc13d1e 100644 --- a/content/browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc +++ b/content/browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc
@@ -11,8 +11,8 @@ #include "base/files/scoped_temp_dir.h" #include "base/stl_util.h" #include "base/strings/string_util.h" -#include "content/browser/font_unique_name_lookup/font_table_matcher.h" #include "content/browser/font_unique_name_lookup/font_unique_name_lookup.h" +#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h" #include <functional> #include <memory> @@ -89,11 +89,11 @@ ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); base::ReadOnlySharedMemoryMapping mapping = font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map(); - FontTableMatcher matcher(mapping); + blink::FontTableMatcher matcher(mapping); ASSERT_GT(matcher.AvailableFonts(), 0u); ASSERT_TRUE(font_unique_name_lookup_->PersistToFile()); ASSERT_TRUE(font_unique_name_lookup_->LoadFromFile()); - FontTableMatcher matcher_after_load( + blink::FontTableMatcher matcher_after_load( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_GT(matcher_after_load.AvailableFonts(), 0u); } @@ -107,7 +107,7 @@ ASSERT_TRUE(font_unique_name_lookup_->IsValid()); base::ReadOnlySharedMemoryMapping mapping = font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map(); - FontTableMatcher matcher(mapping); + blink::FontTableMatcher matcher(mapping); ASSERT_GT(matcher.AvailableFonts(), 0u); ASSERT_TRUE(font_unique_name_lookup_->PersistToFile()); ASSERT_TRUE(font_unique_name_lookup_->LoadFromFile()); @@ -124,7 +124,7 @@ TEST_F(FontUniqueNameLookupTest, TestMatchPostScriptName) { ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher( + blink::FontTableMatcher matcher( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_GT(matcher.AvailableFonts(), 0u); auto match_result = matcher.MatchName(kRobotoCondensedBoldItalicNames[1]); @@ -145,7 +145,7 @@ return; } ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher( + blink::FontTableMatcher matcher( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); std::vector<std::string> ttc_postscript_names = { "NotoSansCJKjp-Regular", "NotoSansCJKkr-Regular", @@ -167,7 +167,7 @@ TEST_F(FontUniqueNameLookupTest, TestMatchFullFontName) { ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher( + blink::FontTableMatcher matcher( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); auto match_result = matcher.MatchName(kRobotoCondensedBoldItalicNames[0]); ASSERT_TRUE(match_result); @@ -286,7 +286,7 @@ TEST_F(FaultInjectingFontUniqueNameLookupTest, TestZeroedTableContents) { font_file_corruptor_.ZeroAfterTableIndex(); ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher_after_update( + blink::FontTableMatcher matcher_after_update( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_EQ(matcher_after_update.AvailableFonts(), 0u); } @@ -294,7 +294,7 @@ TEST_F(FaultInjectingFontUniqueNameLookupTest, TestZeroedTableIndex) { font_file_corruptor_.ZeroOutTableRecords(); ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher_after_update( + blink::FontTableMatcher matcher_after_update( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_EQ(matcher_after_update.AvailableFonts(), 0u); } @@ -316,7 +316,7 @@ TEST_F(FontUniqueNameLookupUpdateTest, CompareSets) { ASSERT_TRUE(font_unique_name_lookup_->UpdateTable()); - FontTableMatcher matcher_initial( + blink::FontTableMatcher matcher_initial( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_GT(matcher_initial.AvailableFonts(), 0u); font_unique_name_lookup_->SetFontFilePathsForTesting( @@ -325,7 +325,7 @@ // to in the test's SetUp method to trigger re-indexing. font_unique_name_lookup_->SetAndroidBuildFingerprintForTesting("B"); font_unique_name_lookup_->UpdateTableIfNeeded(); - FontTableMatcher matcher_second_half( + blink::FontTableMatcher matcher_second_half( font_unique_name_lookup_->GetUniqueNameTableAsSharedMemoryRegion().Map()); ASSERT_GT(matcher_initial.AvailableFonts(), 0u); ASSERT_TRUE(matcher_initial.FontListIsDisjointFrom(matcher_second_half));
diff --git a/content/browser/font_unique_name_lookup/icu_fold_case_util.h b/content/browser/font_unique_name_lookup/icu_fold_case_util.h deleted file mode 100644 index bc8cf60..0000000 --- a/content/browser/font_unique_name_lookup/icu_fold_case_util.h +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2018 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_BROWSER_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL_H_ -#define CONTENT_BROWSER_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL_H_ - -#include "content/common/content_export.h" -#include "third_party/icu/source/common/unicode/unistr.h" - -namespace content { - -// Executes ICU's UnicodeString locale-independent foldCase method on -// |name_request| and returns a case folded string suitable for case-insensitive -// bitwise comparison. Used by FontTableMatcher and FontUniqueNameLookup for -// storing and comparing case folded font names. -std::string CONTENT_EXPORT IcuFoldCase(const std::string& name_request); - -} // namespace content - -#endif // CONTENT_BROWSER_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 406302b..b20dcd6 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1527,22 +1527,22 @@ const GURL& dest_url) { BrowserContext* browser_context = delegate_->GetControllerForRenderManager().GetBrowserContext(); - // Don't compare effective URLs for all subframe navigations, since we don't - // want to create OOPIFs based on that mechanism (e.g., for hosted apps). For - // main frames, don't compare effective URLs when transitioning from app to - // non-app URLs if there exists another app WebContents that might script - // this one. These navigations should stay in the app process to not break - // scripting when a hosted app opens a same-site popup. See - // https://crbug.com/718516 and https://crbug.com/828720. + + // Ask embedder whether effective URLs should be used when determining if + // |dest_url| should end up in |candidate|'s SiteInstance. + // This is used to keep same-site scripting working for hosted apps. + bool should_compare_effective_urls = + GetContentClient() + ->browser() + ->ShouldCompareEffectiveURLsForSiteInstanceSelection( + browser_context, candidate->GetSiteInstance(), + frame_tree_node_->IsMainFrame(), + candidate->GetSiteInstance()->original_url(), dest_url); + bool src_has_effective_url = SiteInstanceImpl::HasEffectiveURL( browser_context, candidate->GetSiteInstance()->original_url()); bool dest_has_effective_url = SiteInstanceImpl::HasEffectiveURL(browser_context, dest_url); - bool should_compare_effective_urls = true; - if (!frame_tree_node_->IsMainFrame() || - (src_has_effective_url && !dest_has_effective_url && - candidate->GetSiteInstance()->GetRelatedActiveContentsCount() > 1u)) - should_compare_effective_urls = false; // If the process type is incorrect, reject the candidate even if |dest_url| // is same-site. (The URL may have been installed as an app since
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index e6e0973..a7524d5 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -655,6 +655,14 @@ std::move(interface_pipe)); } +void GpuProcessHost::TerminateGpuProcess(const std::string& message) { + // At the moment, this path is only used by Ozone/Wayland. Once others start + // to use this, start to distinguish the origin of termination. By default, + // it's unknown. + termination_origin_ = GpuTerminationOrigin::kOzoneWaylandProxy; + process_->TerminateOnBadMessageReceived(message); +} + // static GpuProcessHost* GpuProcessHost::FromID(int host_id) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -792,6 +800,9 @@ info.exit_code); break; case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: + UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationOrigin", + termination_origin_, + GpuTerminationOrigin::kMax); message = "You killed the GPU process! Why?"; break; #if defined(OS_CHROMEOS) @@ -827,24 +838,31 @@ // possible to ensure the latter always has a valid device. crbug.com/608839 // When running with mus, the OzonePlatform may not have been created yet. So // defer the callback until OzonePlatform instance is created. - if (features::IsOzoneDrmMojo()) { + bool using_mojo = true; +#if defined(OS_CHROMEOS) + using_mojo = features::IsOzoneDrmMojo(); +#endif + if (using_mojo) { // TODO(rjkroege): Remove the legacy IPC code paths when no longer // necessary. https://crbug.com/806092 auto interface_binder = base::BindRepeating(&GpuProcessHost::BindInterface, weak_ptr_factory_.GetWeakPtr()); + auto terminate_cb = base::BindOnce(&GpuProcessHost::TerminateGpuProcess, + weak_ptr_factory_.GetWeakPtr()); auto io_callback = base::BindOnce( [](const base::RepeatingCallback<void(const std::string&, mojo::ScopedMessagePipeHandle)>& interface_binder, + base::OnceCallback<void(const std::string&)> terminate_cb, ui::OzonePlatform* platform) { DCHECK_CURRENTLY_ON(BrowserThread::IO); platform->GetGpuPlatformSupportHost()->OnGpuServiceLaunched( BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - interface_binder); + interface_binder, std::move(terminate_cb)); }, - interface_binder); + interface_binder, std::move(terminate_cb)); OzoneRegisterStartupCallbackHelper(std::move(io_callback)); } else {
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index 7187e92b..324152f 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h
@@ -123,6 +123,7 @@ void BindInterface(const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe); + void TerminateGpuProcess(const std::string& message); // Get the GPU process host for the GPU process with the given ID. Returns // null if the process no longer exists. @@ -187,6 +188,12 @@ enum GpuInitializationStatus { UNKNOWN, SUCCESS, FAILURE }; + enum class GpuTerminationOrigin { + kUnknownOrigin = 0, + kOzoneWaylandProxy = 1, + kMax = 2, + }; + static bool ValidateHost(GpuProcessHost* host); // Increments |crash_count| by one. Before incrementing |crash_count|, for @@ -294,6 +301,9 @@ GpuInitializationStatus status_; + GpuTerminationOrigin termination_origin_ = + GpuTerminationOrigin::kUnknownOrigin; + // Time Init started. Used to log total GPU process startup time to UMA. base::TimeTicks init_start_time_;
diff --git a/content/browser/renderer_host/input/fling_controller_unittest.cc b/content/browser/renderer_host/input/fling_controller_unittest.cc index 4c0a68fd..ac71b51 100644 --- a/content/browser/renderer_host/input/fling_controller_unittest.cc +++ b/content/browser/renderer_host/input/fling_controller_unittest.cc
@@ -6,6 +6,7 @@ #include "base/run_loop.h" #include "base/test/scoped_task_environment.h" +#include "build/build_config.h" #include "content/browser/renderer_host/input/gesture_event_queue.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/events/base_event_utils.h" @@ -455,7 +456,13 @@ EXPECT_GT(last_sent_gesture_.data.scroll_update.delta_x, 0.f); } -TEST_F(FlingControllerTest, ControllerBoostsTouchpadFling) { +#if defined(OS_LINUX) +#define MAYBE_ControllerBoostsTouchpadFling \ + DISABLED_ControllerBoostsTouchpadFling +#else +#define MAYBE_ControllerBoostsTouchpadFling ControllerBoostsTouchpadFling +#endif +TEST_F(FlingControllerTest, MAYBE_ControllerBoostsTouchpadFling) { base::TimeTicks progress_time = base::TimeTicks::Now(); SimulateFlingStart(blink::kWebGestureDeviceTouchpad, gfx::Vector2dF(1000, 0)); EXPECT_TRUE(FlingInProgress());
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index cb015802a..cca3123 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
@@ -188,7 +188,8 @@ class MockMoveGestureTarget : public MockSyntheticGestureTarget { public: - MockMoveGestureTarget() : total_abs_move_distance_length_(0) {} + MockMoveGestureTarget() + : total_abs_move_distance_length_(0), precise_scrolling_deltas_(false) {} ~MockMoveGestureTarget() override {} gfx::Vector2dF start_to_end_distance() const { @@ -197,10 +198,12 @@ float total_abs_move_distance_length() const { return total_abs_move_distance_length_; } + bool precise_scrolling_deltas() const { return precise_scrolling_deltas_; } protected: gfx::Vector2dF start_to_end_distance_; float total_abs_move_distance_length_; + bool precise_scrolling_deltas_; }; class MockScrollMouseTarget : public MockMoveGestureTarget { @@ -215,6 +218,7 @@ gfx::Vector2dF delta(mouse_wheel_event.delta_x, mouse_wheel_event.delta_y); start_to_end_distance_ += delta; total_abs_move_distance_length_ += delta.Length(); + precise_scrolling_deltas_ = mouse_wheel_event.has_precise_scrolling_deltas; } }; @@ -1186,6 +1190,28 @@ scroll_target->start_to_end_distance().x()); } +TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMousePreciseScroll) { + CreateControllerAndTarget<MockScrollMouseTarget>(); + + SyntheticSmoothMoveGestureParams params; + params.input_type = SyntheticSmoothMoveGestureParams::MOUSE_WHEEL_INPUT; + params.start_point.SetPoint(39, 86); + params.distances.push_back(gfx::Vector2d(0, -132)); + params.precise_scrolling_deltas = true; + + std::unique_ptr<SyntheticSmoothMoveGesture> gesture( + new SyntheticSmoothMoveGesture(params)); + QueueSyntheticGesture(std::move(gesture)); + FlushInputUntilComplete(); + + MockMoveGestureTarget* scroll_target = + static_cast<MockMoveGestureTarget*>(target_); + EXPECT_EQ(1, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(params.precise_scrolling_deltas, + scroll_target->precise_scrolling_deltas()); +} + void CheckIsWithinRangeMulti(float scroll_distance, int target_distance, SyntheticGestureTarget* target) {
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc index c9b4679..9361b7b2 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
@@ -81,9 +81,12 @@ return; } base::TimeTicks timestamp = web_wheel.TimeStamp(); + int modifiers = web_wheel.has_precise_scrolling_deltas + ? ui::EF_PRECISION_SCROLLING_DELTA + : ui::EF_NONE; ui::MouseWheelEvent wheel_event( gfx::Vector2d(web_wheel.delta_x, web_wheel.delta_y), gfx::Point(), - gfx::Point(), timestamp, ui::EF_NONE, ui::EF_NONE); + gfx::Point(), timestamp, modifiers, ui::EF_NONE); gfx::PointF location(web_wheel.PositionInWidget().x * device_scale_factor_, web_wheel.PositionInWidget().y * device_scale_factor_); wheel_event.set_location_f(location);
diff --git a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc index ea2c5eca..4be6796 100644 --- a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc
@@ -30,7 +30,8 @@ SyntheticSmoothMoveGestureParams::SyntheticSmoothMoveGestureParams() : speed_in_pixels_s(kDefaultSpeedInPixelsPerSec), prevent_fling(true), - add_slop(true) {} + add_slop(true), + precise_scrolling_deltas(false) {} SyntheticSmoothMoveGestureParams::SyntheticSmoothMoveGestureParams( const SyntheticSmoothMoveGestureParams& other) = default; @@ -258,8 +259,8 @@ const blink::WebMouseWheelEvent::Phase phase, const base::TimeTicks& timestamp) const { blink::WebMouseWheelEvent mouse_wheel_event = - SyntheticWebMouseWheelEventBuilder::Build(0, 0, delta.x(), delta.y(), 0, - false); + SyntheticWebMouseWheelEventBuilder::Build( + 0, 0, delta.x(), delta.y(), 0, params_.precise_scrolling_deltas); mouse_wheel_event.SetPositionInWidget( current_move_segment_start_position_.x(),
diff --git a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.h b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.h index 353336c..7230f246 100644 --- a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.h +++ b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.h
@@ -36,6 +36,7 @@ int speed_in_pixels_s; bool prevent_fling; bool add_slop; + bool precise_scrolling_deltas; }; // This class is used as helper class for simulation of scroll and drag.
diff --git a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc index de52659..8e319fdd 100644 --- a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc
@@ -48,6 +48,7 @@ move_params.prevent_fling = params_.prevent_fling; move_params.input_type = GetInputSourceType(gesture_type); move_params.add_slop = true; + move_params.precise_scrolling_deltas = params_.precise_scrolling_deltas; move_gesture_.reset(new SyntheticSmoothMoveGesture(move_params)); return true; }
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc index cfbe281..f432bee 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.cc +++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -215,43 +215,47 @@ void DispatchBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchAbortEventCallback callback) override { if (!helper_) return; - helper_->OnBackgroundFetchAbortEventStub(developer_id, unique_id, + helper_->OnBackgroundFetchAbortEventStub(developer_id, unique_id, state, std::move(callback)); } void DispatchBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchClickEventCallback callback) override { if (!helper_) return; - helper_->OnBackgroundFetchClickEventStub(developer_id, unique_id, + helper_->OnBackgroundFetchClickEventStub(developer_id, unique_id, state, std::move(callback)); } void DispatchBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchFailEventCallback callback) override { if (!helper_) return; - helper_->OnBackgroundFetchFailEventStub(developer_id, unique_id, fetches, - std::move(callback)); + helper_->OnBackgroundFetchFailEventStub(developer_id, unique_id, state, + fetches, std::move(callback)); } void DispatchBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchSuccessEventCallback callback) override { if (!helper_) return; - helper_->OnBackgroundFetchSuccessEventStub(developer_id, unique_id, fetches, - std::move(callback)); + helper_->OnBackgroundFetchSuccessEventStub(developer_id, unique_id, state, + fetches, std::move(callback)); } void DispatchCookieChangeEvent( @@ -597,6 +601,7 @@ void EmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback) { std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, base::Time::Now()); @@ -605,6 +610,7 @@ void EmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback) { std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, base::Time::Now()); @@ -613,6 +619,7 @@ void EmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback) { std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, @@ -622,6 +629,7 @@ void EmbeddedWorkerTestHelper::OnBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback) { @@ -874,47 +882,51 @@ void EmbeddedWorkerTestHelper::OnBackgroundFetchAbortEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&EmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent, - AsWeakPtr(), developer_id, unique_id, + AsWeakPtr(), developer_id, unique_id, state, std::move(callback))); } void EmbeddedWorkerTestHelper::OnBackgroundFetchClickEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&EmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent, - AsWeakPtr(), developer_id, unique_id, + AsWeakPtr(), developer_id, unique_id, state, std::move(callback))); } void EmbeddedWorkerTestHelper::OnBackgroundFetchFailEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&EmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent, - AsWeakPtr(), developer_id, unique_id, fetches, + AsWeakPtr(), developer_id, unique_id, state, fetches, std::move(callback))); } void EmbeddedWorkerTestHelper::OnBackgroundFetchSuccessEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&EmbeddedWorkerTestHelper::OnBackgroundFetchSuccessEvent, - AsWeakPtr(), developer_id, unique_id, fetches, + AsWeakPtr(), developer_id, unique_id, state, fetches, std::move(callback))); }
diff --git a/content/browser/service_worker/embedded_worker_test_helper.h b/content/browser/service_worker/embedded_worker_test_helper.h index dd40218..e632de9 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.h +++ b/content/browser/service_worker/embedded_worker_test_helper.h
@@ -169,19 +169,23 @@ virtual void OnBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback); virtual void OnBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback); virtual void OnBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback); virtual void OnBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback); @@ -269,19 +273,23 @@ void OnBackgroundFetchAbortEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchAbortEventCallback callback); void OnBackgroundFetchClickEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, mojom::ServiceWorker::DispatchBackgroundFetchClickEventCallback callback); void OnBackgroundFetchFailEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchFailEventCallback callback); void OnBackgroundFetchSuccessEventStub( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, mojom::ServiceWorker::DispatchBackgroundFetchSuccessEventCallback callback);
diff --git a/content/browser/shared_worker/mock_shared_worker.cc b/content/browser/shared_worker/mock_shared_worker.cc index 9b197d5..b23879f 100644 --- a/content/browser/shared_worker/mock_shared_worker.cc +++ b/content/browser/shared_worker/mock_shared_worker.cc
@@ -99,6 +99,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info,
diff --git a/content/browser/shared_worker/mock_shared_worker.h b/content/browser/shared_worker/mock_shared_worker.h index b871481..954fbad 100644 --- a/content/browser/shared_worker/mock_shared_worker.h +++ b/content/browser/shared_worker/mock_shared_worker.h
@@ -68,6 +68,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info,
diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc index 192a0af..993b59f 100644 --- a/content/browser/shared_worker/shared_worker_host.cc +++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -23,6 +23,7 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_client.h" +#include "content/public/common/renderer_preference_watcher.mojom.h" #include "services/network/public/cpp/features.h" #include "third_party/blink/public/common/message_port/message_port_channel.h" #include "third_party/blink/public/platform/web_feature.mojom.h" @@ -147,6 +148,14 @@ RenderProcessHost::FromID(process_id_)->GetBrowserContext(), &renderer_preferences); + // Create a RendererPreferenceWatcher to observe updates in the preferences. + mojom::RendererPreferenceWatcherPtr watcher_ptr; + mojom::RendererPreferenceWatcherRequest preference_watcher_request = + mojo::MakeRequest(&watcher_ptr); + GetContentClient()->browser()->RegisterRendererPreferenceWatcherForWorkers( + RenderProcessHost::FromID(process_id_)->GetBrowserContext(), + std::move(watcher_ptr)); + // Set up content settings interface. blink::mojom::WorkerContentSettingsProxyPtr content_settings; content_settings_ = std::make_unique<SharedWorkerContentSettingsProxyImpl>( @@ -182,8 +191,8 @@ factory_ = std::move(factory); factory_->CreateSharedWorker( std::move(info), pause_on_start, devtools_worker_token, - renderer_preferences, std::move(content_settings), - std::move(service_worker_provider_info), + renderer_preferences, std::move(preference_watcher_request), + std::move(content_settings), std::move(service_worker_provider_info), appcache_handle_ ? appcache_handle_->appcache_host_id() : kAppCacheNoHostId, std::move(script_loader_factory), std::move(factory_bundle),
diff --git a/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc b/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc index 61f69f2b..65b3ade 100644 --- a/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc +++ b/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc
@@ -240,20 +240,15 @@ base::ThreadRestrictions::SetIOAllowed(prev_io_allowed); } -#if defined(OS_ANDROID) || defined(OS_LINUX) +// Same test as CallWithAudioDebugRecordings, but does two parallel calls. +// TODO(crbug.com/874378): Fix an re-enable test. +// List of issues filed before this test was disabled for all platforms: // Renderer crashes under Android ASAN: https://crbug.com/408496. // Renderer crashes under Android: https://crbug.com/820934. // Failures on Android M. https://crbug.com/535728. // Flaky on Linux: https://crbug.com/871182 -#define MAYBE_TwoCallsWithAudioDebugRecordings \ - DISABLED_TwoCallsWithAudioDebugRecordings -#else -#define MAYBE_TwoCallsWithAudioDebugRecordings TwoCallsWithAudioDebugRecordings -#endif - -// Same test as CallWithAudioDebugRecordings, but does two parallel calls. IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest, - MAYBE_TwoCallsWithAudioDebugRecordings) { + DISABLED_TwoCallsWithAudioDebugRecordings) { if (!HasAudioOutputDevices()) { LOG(INFO) << "Missing output devices: skipping test..."; return;
diff --git a/content/common/input/synthetic_smooth_scroll_gesture_params.cc b/content/common/input/synthetic_smooth_scroll_gesture_params.cc index 8e1c974..3a1c22ed 100644 --- a/content/common/input/synthetic_smooth_scroll_gesture_params.cc +++ b/content/common/input/synthetic_smooth_scroll_gesture_params.cc
@@ -14,15 +14,18 @@ } // namespace SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams() - : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {} + : prevent_fling(true), + speed_in_pixels_s(kDefaultSpeedInPixelsS), + precise_scrolling_deltas(false) {} SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams( - const SyntheticSmoothScrollGestureParams& other) + const SyntheticSmoothScrollGestureParams& other) : SyntheticGestureParams(other), anchor(other.anchor), distances(other.distances), prevent_fling(other.prevent_fling), - speed_in_pixels_s(other.speed_in_pixels_s) {} + speed_in_pixels_s(other.speed_in_pixels_s), + precise_scrolling_deltas(other.precise_scrolling_deltas) {} SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {}
diff --git a/content/common/input/synthetic_smooth_scroll_gesture_params.h b/content/common/input/synthetic_smooth_scroll_gesture_params.h index d9e8591..caba7f0 100644 --- a/content/common/input/synthetic_smooth_scroll_gesture_params.h +++ b/content/common/input/synthetic_smooth_scroll_gesture_params.h
@@ -28,6 +28,7 @@ std::vector<gfx::Vector2dF> distances; // Positive X/Y to scroll left/up. bool prevent_fling; // Defaults to true. float speed_in_pixels_s; + bool precise_scrolling_deltas; static const SyntheticSmoothScrollGestureParams* Cast( const SyntheticGestureParams* gesture_params);
diff --git a/content/common/service_worker/service_worker.mojom b/content/common/service_worker/service_worker.mojom index 1992086..0ad5428f 100644 --- a/content/common/service_worker/service_worker.mojom +++ b/content/common/service_worker/service_worker.mojom
@@ -7,6 +7,7 @@ import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/time.mojom"; import "services/network/public/mojom/cookie_manager.mojom"; +import "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom"; import "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom"; import "third_party/blink/public/platform/modules/notifications/notification.mojom"; import "third_party/blink/public/platform/modules/payments/payment_app.mojom"; @@ -28,12 +29,6 @@ blink.mojom.FetchAPIResponse? response; }; -enum BackgroundFetchState { - PENDING, - SUCCEEDED, - FAILED -}; - struct ExtendableMessageEvent { blink.mojom.TransferableMessage message; url.mojom.Origin source_origin; @@ -98,21 +93,25 @@ // promise has settled. |developer_id| and |unique_id| are documented in // content::BackgroundFetchRegistrationId. DispatchBackgroundFetchAbortEvent(string developer_id, - string unique_id) + string unique_id, + blink.mojom.BackgroundFetchState state) => (blink.mojom.ServiceWorkerEventStatus status, mojo_base.mojom.Time dispatch_event_time); DispatchBackgroundFetchClickEvent(string developer_id, - string unique_id) + string unique_id, + blink.mojom.BackgroundFetchState state) => (blink.mojom.ServiceWorkerEventStatus status, mojo_base.mojom.Time dispatch_event_time); DispatchBackgroundFetchFailEvent(string developer_id, string unique_id, + blink.mojom.BackgroundFetchState state, array<BackgroundFetchSettledFetch> fetches) => (blink.mojom.ServiceWorkerEventStatus status, mojo_base.mojom.Time dispatch_event_time); DispatchBackgroundFetchSuccessEvent( string developer_id, string unique_id, + blink.mojom.BackgroundFetchState state, array<BackgroundFetchSettledFetch> fetches) => (blink.mojom.ServiceWorkerEventStatus status, mojo_base.mojom.Time dispatch_event_time);
diff --git a/content/common/shared_worker/shared_worker_factory.mojom b/content/common/shared_worker/shared_worker_factory.mojom index f19b42c..3287a07 100644 --- a/content/common/shared_worker/shared_worker_factory.mojom +++ b/content/common/shared_worker/shared_worker_factory.mojom
@@ -9,6 +9,7 @@ import "content/common/shared_worker/shared_worker_host.mojom"; import "content/common/shared_worker/shared_worker_info.mojom"; import "content/common/url_loader_factory_bundle.mojom"; +import "content/public/common/renderer_preference_watcher.mojom"; import "content/public/common/renderer_preferences.mojom"; import "mojo/public/mojom/base/unguessable_token.mojom"; import "services/network/public/mojom/url_loader_factory.mojom"; @@ -33,6 +34,7 @@ bool pause_on_start, mojo_base.mojom.UnguessableToken devtools_worker_token, RendererPreferences renderer_preferences, + RendererPreferenceWatcher& preference_watcher_request, blink.mojom.WorkerContentSettingsProxy content_settings, // S13nServiceWorker:
diff --git a/content/public/app/mojo/content_gpu_manifest.json b/content/public/app/mojo/content_gpu_manifest.json index 1335cff..f56ca6cc 100644 --- a/content/public/app/mojo/content_gpu_manifest.json +++ b/content/public/app/mojo/content_gpu_manifest.json
@@ -14,6 +14,7 @@ "service_manager.mojom.ServiceFactory", "ui.ozone.mojom.DeviceCursor", "ui.ozone.mojom.DrmDevice", + "ui.ozone.mojom.WaylandConnectionClient", "viz.mojom.CompositingModeReporter", "viz.mojom.VizMain" ],
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 74ec52c..341a3d9 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -81,6 +81,15 @@ return url; } +bool ContentBrowserClient::ShouldCompareEffectiveURLsForSiteInstanceSelection( + BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url) { + return true; +} + bool ContentBrowserClient::ShouldUseMobileFlingCurve() const { return false; }
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 297c236..02b8478 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -257,6 +257,16 @@ virtual GURL GetEffectiveURL(BrowserContext* browser_context, const GURL& url); + // Returns true if effective URLs should be compared when choosing a + // SiteInstance for a navigation to |destination_url|. + // |is_main_frame| is true if the navigation will take place in a main frame. + virtual bool ShouldCompareEffectiveURLsForSiteInstanceSelection( + BrowserContext* browser_context, + content::SiteInstance* candidate_site_instance, + bool is_main_frame, + const GURL& candidate_url, + const GURL& destination_url); + // Returns whether gesture fling events should use the mobile-behavior gesture // curve for scrolling. virtual bool ShouldUseMobileFlingCurve() const;
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc index 4e60b90..f38f0b2 100644 --- a/content/public/test/test_utils.cc +++ b/content/public/test/test_utils.cc
@@ -319,33 +319,26 @@ WindowedNotificationObserver::WindowedNotificationObserver( int notification_type, const NotificationSource& source) - : seen_(false), - running_(false), - source_(NotificationService::AllSources()) { + : source_(NotificationService::AllSources()) { AddNotificationType(notification_type, source); } WindowedNotificationObserver::WindowedNotificationObserver( int notification_type, const ConditionTestCallback& callback) - : seen_(false), - running_(false), - callback_(callback), - source_(NotificationService::AllSources()) { + : callback_(callback), source_(NotificationService::AllSources()) { AddNotificationType(notification_type, source_); } WindowedNotificationObserver::WindowedNotificationObserver( int notification_type, const ConditionTestCallbackWithoutSourceAndDetails& callback) - : seen_(false), - running_(false), - callback_(base::Bind(&IgnoreSourceAndDetails, callback)), + : callback_(base::Bind(&IgnoreSourceAndDetails, callback)), source_(NotificationService::AllSources()) { registrar_.Add(this, notification_type, source_); } -WindowedNotificationObserver::~WindowedNotificationObserver() {} +WindowedNotificationObserver::~WindowedNotificationObserver() = default; void WindowedNotificationObserver::AddNotificationType( int notification_type, @@ -354,30 +347,21 @@ } void WindowedNotificationObserver::Wait() { - if (seen_) - return; - - running_ = true; - message_loop_runner_ = new MessageLoopRunner; - message_loop_runner_->Run(); + if (!seen_) + run_loop_.Run(); EXPECT_TRUE(seen_); } -void WindowedNotificationObserver::Observe( - int type, - const NotificationSource& source, - const NotificationDetails& details) { +void WindowedNotificationObserver::Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) { source_ = source; details_ = details; if (!callback_.is_null() && !callback_.Run(source, details)) return; seen_ = true; - if (!running_) - return; - - message_loop_runner_->Quit(); - running_ = false; + run_loop_.Quit(); } InProcessUtilityThreadHelper::InProcessUtilityThreadHelper()
diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h index 46666670..514926a 100644 --- a/content/public/test/test_utils.h +++ b/content/public/test/test_utils.h
@@ -251,15 +251,14 @@ const NotificationDetails& details) override; private: - bool seen_; - bool running_; + bool seen_ = false; NotificationRegistrar registrar_; ConditionTestCallback callback_; NotificationSource source_; NotificationDetails details_; - scoped_refptr<MessageLoopRunner> message_loop_runner_; + base::RunLoop run_loop_; DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserver); };
diff --git a/content/renderer/accessibility/render_accessibility_impl.cc b/content/renderer/accessibility/render_accessibility_impl.cc index 52103050..05fbd8d 100644 --- a/content/renderer/accessibility/render_accessibility_impl.cc +++ b/content/renderer/accessibility/render_accessibility_impl.cc
@@ -450,17 +450,6 @@ bundle.events.push_back(event); - // Whenever there's a change to an inline node, it's important to - // invalidate the whole surrounding block so that we have the full - // information about the line layout. - auto block = obj; - while (!block.IsDetached() && (block.ComputedStyleDisplay() != "block" || - block.AccessibilityIsIgnored())) { - block = block.ParentObject(); - } - if (!block.IsDetached() && !block.Equals(obj)) - serializer_.InvalidateSubtree(block); - // Whenever there's a change within a table, invalidate the // whole table so that row and cell indexes are recomputed. ax::mojom::Role role = AXRoleFromBlink(obj.Role());
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc index b325e6a..da80a4c 100644 --- a/content/renderer/gpu/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -287,7 +287,8 @@ float speed_in_pixels_s, bool prevent_fling, float start_x, - float start_y) { + float start_y, + bool precise_scrolling_deltas) { gfx::Rect rect = context->render_view_impl()->GetWidget()->ViewRect(); rect -= rect.OffsetFromOrigin(); if (!rect.Contains(start_x, start_y)) { @@ -324,6 +325,7 @@ gesture_params.speed_in_pixels_s = speed_in_pixels_s; gesture_params.prevent_fling = prevent_fling; + gesture_params.precise_scrolling_deltas = precise_scrolling_deltas; gesture_params.anchor.SetPoint(start_x, start_y); @@ -641,21 +643,25 @@ int gesture_source_type = SyntheticGestureParams::DEFAULT_INPUT; std::string direction = "down"; float speed_in_pixels_s = 800; + bool precise_scrolling_deltas = true; if (!GetOptionalArg(args, &pixels_to_scroll) || - !GetOptionalArg(args, &callback) || - !GetOptionalArg(args, &start_x) || + !GetOptionalArg(args, &callback) || !GetOptionalArg(args, &start_x) || !GetOptionalArg(args, &start_y) || !GetOptionalArg(args, &gesture_source_type) || !GetOptionalArg(args, &direction) || - !GetOptionalArg(args, &speed_in_pixels_s)) { + !GetOptionalArg(args, &speed_in_pixels_s) || + !GetOptionalArg(args, &precise_scrolling_deltas)) { return false; } + DCHECK(gesture_source_type != SyntheticGestureParams::TOUCH_INPUT || + precise_scrolling_deltas); EnsureRemoteInterface(); return BeginSmoothScroll(&context, args, input_injector_, pixels_to_scroll, callback, gesture_source_type, direction, - speed_in_pixels_s, true, start_x, start_y); + speed_in_pixels_s, true, start_x, start_y, + precise_scrolling_deltas); } bool GpuBenchmarking::SmoothDrag(gin::Arguments* args) { @@ -714,7 +720,7 @@ return BeginSmoothScroll( &context, args, input_injector_, -pixels_to_scroll, callback, 1, // TOUCH_INPUT - direction, speed_in_pixels_s, false, start_x, start_y); + direction, speed_in_pixels_s, false, start_x, start_y, true); } bool GpuBenchmarking::ScrollBounce(gin::Arguments* args) {
diff --git a/content/renderer/loader/web_worker_fetch_context_impl.cc b/content/renderer/loader/web_worker_fetch_context_impl.cc index 7d488e8..f0b4633 100644 --- a/content/renderer/loader/web_worker_fetch_context_impl.cc +++ b/content/renderer/loader/web_worker_fetch_context_impl.cc
@@ -148,6 +148,7 @@ WebWorkerFetchContextImpl::WebWorkerFetchContextImpl( RendererPreferences renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, mojom::ServiceWorkerWorkerClientRequest service_worker_client_request, mojom::ServiceWorkerWorkerClientRegistryPtrInfo service_worker_worker_client_registry_info, @@ -169,6 +170,8 @@ fallback_factory_info_(std::move(fallback_factory_info)), thread_safe_sender_(thread_safe_sender), renderer_preferences_(std::move(renderer_preferences)), + preference_watcher_binding_(this), + preference_watcher_request_(std::move(preference_watcher_request)), throttle_provider_(std::move(throttle_provider)), websocket_handshake_throttle_provider_( std::move(websocket_handshake_throttle_provider)), @@ -201,8 +204,10 @@ mojo::MakeRequest(&host_ptr_info)); } + mojom::RendererPreferenceWatcherPtr preference_watcher; auto new_context = std::make_unique<WebWorkerFetchContextImpl>( - renderer_preferences_, std::move(service_worker_client_request), + renderer_preferences_, mojo::MakeRequest(&preference_watcher), + std::move(service_worker_client_request), std::move(service_worker_worker_client_registry_ptr_info), std::move(host_ptr_info), loader_factory_->Clone(), fallback_factory_->Clone(), @@ -218,12 +223,16 @@ new_context->ancestor_frame_id_ = ancestor_frame_id_; new_context->frame_request_blocker_ = frame_request_blocker_; new_context->appcache_host_id_ = appcache_host_id_; + + child_preference_watchers_.AddPtr(std::move(preference_watcher)); + return new_context; } void WebWorkerFetchContextImpl::InitializeOnWorkerThread() { DCHECK(!resource_dispatcher_); DCHECK(!binding_.is_bound()); + DCHECK(!preference_watcher_binding_.is_bound()); resource_dispatcher_ = std::make_unique<ResourceDispatcher>(); resource_dispatcher_->set_terminate_sync_load_event( terminate_sync_load_event_); @@ -238,6 +247,9 @@ service_worker_worker_client_registry_.Bind( std::move(service_worker_worker_client_registry_info_)); + if (preference_watcher_request_.is_pending()) + preference_watcher_binding_.Bind(std::move(preference_watcher_request_)); + if (blink::ServiceWorkerUtils::IsServicificationEnabled()) { service_worker_container_host_.Bind( std::move(service_worker_container_host_info_)); @@ -447,4 +459,13 @@ std::move(service_worker_url_loader_factory)); } +void WebWorkerFetchContextImpl::NotifyUpdate( + const RendererPreferences& new_prefs) { + renderer_preferences_ = new_prefs; + child_preference_watchers_.ForAllPtrs( + [&new_prefs](mojom::RendererPreferenceWatcher* watcher) { + watcher->NotifyUpdate(new_prefs); + }); +} + } // namespace content
diff --git a/content/renderer/loader/web_worker_fetch_context_impl.h b/content/renderer/loader/web_worker_fetch_context_impl.h index a8a2f70..bf4b3e08 100644 --- a/content/renderer/loader/web_worker_fetch_context_impl.h +++ b/content/renderer/loader/web_worker_fetch_context_impl.h
@@ -11,9 +11,11 @@ #include "base/synchronization/waitable_event.h" #include "content/common/service_worker/service_worker_provider.mojom.h" #include "content/common/service_worker/service_worker_types.h" +#include "content/public/common/renderer_preference_watcher.mojom.h" #include "content/public/common/renderer_preferences.h" #include "ipc/ipc_message.h" #include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/interface_ptr_set.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/service_manager/public/cpp/connector.h" @@ -41,7 +43,8 @@ // service workers, ServiceWorkerFetchContextImpl class is used instead. class CONTENT_EXPORT WebWorkerFetchContextImpl : public blink::WebWorkerFetchContext, - public mojom::ServiceWorkerWorkerClient { + public mojom::ServiceWorkerWorkerClient, + public mojom::RendererPreferenceWatcher { public: // |service_worker_client_request| is bound to |this| to receive // OnControllerChanged() notifications. @@ -63,6 +66,7 @@ // chrome-extension://). WebWorkerFetchContextImpl( RendererPreferences renderer_preferences, + mojom::RendererPreferenceWatcherRequest watcher_request, mojom::ServiceWorkerWorkerClientRequest service_worker_client_request, mojom::ServiceWorkerWorkerClientRegistryPtrInfo service_worker_worker_client_registry_info, @@ -139,6 +143,9 @@ // controlled by a service worker. void ResetServiceWorkerURLLoaderFactory(); + // Implements mojom::RendererPreferenceWatcher. + void NotifyUpdate(const RendererPreferences& new_prefs) override; + mojo::Binding<mojom::ServiceWorkerWorkerClient> binding_; mojom::ServiceWorkerWorkerClientRegistryPtr service_worker_worker_client_registry_; @@ -207,10 +214,17 @@ GURL origin_url_; int appcache_host_id_ = blink::WebApplicationCacheHost::kAppCacheNoHostId; - // TODO(crbug.com/862854): Propagate preference changes from the browser - // process. RendererPreferences renderer_preferences_; + // |watcher_binding_| and |child_preference_watchers_| are for keeping track + // of updates in the renderer preferences. + mojo::Binding<mojom::RendererPreferenceWatcher> preference_watcher_binding_; + // Kept while staring up the worker thread. Valid until + // InitializeOnWorkerThread(). + mojom::RendererPreferenceWatcherRequest preference_watcher_request_; + mojo::InterfacePtrSet<mojom::RendererPreferenceWatcher> + child_preference_watchers_; + // This is owned by ThreadedMessagingProxyBase on the main thread. base::WaitableEvent* terminate_sync_load_event_ = nullptr;
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index eadaa4f..1526238 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -3583,8 +3583,13 @@ container_host_ptr_info = provider_context->CloneContainerHostPtrInfo(); } + mojom::RendererPreferenceWatcherPtr watcher; + mojom::RendererPreferenceWatcherRequest watcher_request = + mojo::MakeRequest(&watcher); + render_view()->RegisterRendererPreferenceWatcherForWorker(std::move(watcher)); + auto worker_fetch_context = std::make_unique<WebWorkerFetchContextImpl>( - render_view_->renderer_preferences(), + render_view_->renderer_preferences(), std::move(watcher_request), std::move(service_worker_client_request), std::move(service_worker_worker_client_registry_ptr_info), std::move(container_host_ptr_info), GetLoaderFactoryBundle()->Clone(),
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index ea95a6b..1c57ec55 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -1682,6 +1682,11 @@ history_navigation_virtual_time_pauser_.UnpauseVirtualTime(); } +void RenderViewImpl::RegisterRendererPreferenceWatcherForWorker( + mojom::RendererPreferenceWatcherPtr watcher) { + renderer_preference_watchers_.AddPtr(std::move(watcher)); +} + int RenderViewImpl::HistoryBackListCount() { return history_list_offset_ < 0 ? 0 : history_list_offset_; } @@ -1879,6 +1884,11 @@ renderer_preferences_ = renderer_prefs; + renderer_preference_watchers_.ForAllPtrs( + [&renderer_prefs](mojom::RendererPreferenceWatcher* watcher) { + watcher->NotifyUpdate(renderer_prefs); + }); + UpdateFontRenderingFromRendererPrefs(); UpdateThemePrefs(); blink::SetCaretBlinkInterval(renderer_prefs.caret_blink_interval);
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 89932a7..582c391f 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h
@@ -33,6 +33,7 @@ #include "content/public/common/drop_data.h" #include "content/public/common/page_zoom.h" #include "content/public/common/referrer.h" +#include "content/public/common/renderer_preference_watcher.mojom.h" #include "content/public/common/renderer_preferences.h" #include "content/public/common/web_preferences.h" #include "content/public/renderer/render_view.h" @@ -41,6 +42,7 @@ #include "content/renderer/render_widget_owner_delegate.h" #include "content/renderer/stats_collection_observer.h" #include "ipc/ipc_platform_file.h" +#include "mojo/public/cpp/bindings/interface_ptr_set.h" #include "third_party/blink/public/platform/web_input_event.h" #include "third_party/blink/public/platform/web_scoped_virtual_time_pauser.h" #include "third_party/blink/public/platform/web_security_origin.h" @@ -208,6 +210,10 @@ void DidCommitProvisionalHistoryLoad(); + // Registers a watcher to observe changes in the RendererPreferences. + void RegisterRendererPreferenceWatcherForWorker( + mojom::RendererPreferenceWatcherPtr watcher); + // IPC::Listener implementation (via RenderWidget inheritance). bool OnMessageReceived(const IPC::Message& msg) override; @@ -543,6 +549,10 @@ WebPreferences webkit_preferences_; RendererPreferences renderer_preferences_; + // These are observing changes in |renderer_preferences_|. This is used for + // keeping WorkerFetchContext in sync. + mojo::InterfacePtrSet<mojom::RendererPreferenceWatcher> + renderer_preference_watchers_; // Whether content state (such as form state, scroll position and page // contents) should be sent to the browser immediately. This is normally
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index deaf83b..1c90681 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -1585,6 +1585,7 @@ void ServiceWorkerContextClient::DispatchBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchAbortEventCallback callback) { int request_id = context_->timeout_timer->StartEvent( CreateAbortCallback(&context_->background_fetch_abort_event_callbacks)); @@ -1599,12 +1600,13 @@ proxy_->DispatchBackgroundFetchAbortEvent( request_id, blink::WebString::FromUTF8(developer_id), - blink::WebString::FromUTF8(unique_id)); + blink::WebString::FromUTF8(unique_id), state); } void ServiceWorkerContextClient::DispatchBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchClickEventCallback callback) { int request_id = context_->timeout_timer->StartEvent( CreateAbortCallback(&context_->background_fetch_click_event_callbacks)); @@ -1619,12 +1621,13 @@ proxy_->DispatchBackgroundFetchClickEvent( request_id, blink::WebString::FromUTF8(developer_id), - blink::WebString::FromUTF8(unique_id)); + blink::WebString::FromUTF8(unique_id), state); } void ServiceWorkerContextClient::DispatchBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchFailEventCallback callback) { int request_id = context_->timeout_timer->StartEvent( @@ -1648,12 +1651,13 @@ proxy_->DispatchBackgroundFetchFailEvent( request_id, blink::WebString::FromUTF8(developer_id), - blink::WebString::FromUTF8(unique_id), web_fetches); + blink::WebString::FromUTF8(unique_id), state, web_fetches); } void ServiceWorkerContextClient::DispatchBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchSuccessEventCallback callback) { int request_id = context_->timeout_timer->StartEvent( @@ -1677,7 +1681,7 @@ proxy_->DispatchBackgroundFetchSuccessEvent( request_id, blink::WebString::FromUTF8(developer_id), - blink::WebString::FromUTF8(unique_id), web_fetches); + blink::WebString::FromUTF8(unique_id), state, web_fetches); } void ServiceWorkerContextClient::InitializeGlobalScope(
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index 0ede4b77..4d1688d9 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -32,6 +32,7 @@ #include "third_party/blink/public/mojom/service_worker/service_worker_client.mojom.h" #include "third_party/blink/public/mojom/service_worker/service_worker_event_status.mojom.h" #include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h" +#include "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom.h" #include "third_party/blink/public/platform/modules/payments/payment_app.mojom.h" #include "third_party/blink/public/platform/modules/service_worker/web_service_worker_error.h" #include "third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h" @@ -285,19 +286,23 @@ void DispatchBackgroundFetchAbortEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchAbortEventCallback callback) override; void DispatchBackgroundFetchClickEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, DispatchBackgroundFetchClickEventCallback callback) override; void DispatchBackgroundFetchFailEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchFailEventCallback callback) override; void DispatchBackgroundFetchSuccessEvent( const std::string& developer_id, const std::string& unique_id, + blink::mojom::BackgroundFetchState state, const std::vector<BackgroundFetchSettledFetch>& fetches, DispatchBackgroundFetchSuccessEventCallback callback) override; void DispatchExtendableMessageEvent(
diff --git a/content/renderer/service_worker/service_worker_context_client_unittest.cc b/content/renderer/service_worker/service_worker_context_client_unittest.cc index 6c76515..70663bb 100644 --- a/content/renderer/service_worker/service_worker_context_client_unittest.cc +++ b/content/renderer/service_worker/service_worker_context_client_unittest.cc
@@ -26,6 +26,7 @@ #include "third_party/blink/public/common/message_port/message_port_channel.h" #include "third_party/blink/public/common/service_worker/service_worker_utils.h" #include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h" +#include "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom.h" #include "third_party/blink/public/platform/modules/background_fetch/web_background_fetch_settled_fetch.h" #include "third_party/blink/public/platform/modules/notifications/web_notification_data.h" #include "third_party/blink/public/platform/modules/payments/web_payment_request_event_data.h" @@ -79,19 +80,22 @@ void DispatchBackgroundFetchAbortEvent( int event_id, const blink::WebString& developer_id, - const blink::WebString& unique_id) override { + const blink::WebString& unique_id, + blink::mojom::BackgroundFetchState state) override { NOTREACHED(); } void DispatchBackgroundFetchClickEvent( int event_id, const blink::WebString& developer_id, - const blink::WebString& unique_id) override { + const blink::WebString& unique_id, + blink::mojom::BackgroundFetchState state) override { NOTREACHED(); } void DispatchBackgroundFetchFailEvent( int event_id, const blink::WebString& developer_id, const blink::WebString& unique_id, + blink::mojom::BackgroundFetchState state, const blink::WebVector<blink::WebBackgroundFetchSettledFetch>& fetches) override { NOTREACHED(); @@ -100,6 +104,7 @@ int event_id, const blink::WebString& developer_id, const blink::WebString& unique_id, + blink::mojom::BackgroundFetchState state, const blink::WebVector<blink::WebBackgroundFetchSettledFetch>& fetches) override { NOTREACHED();
diff --git a/content/renderer/service_worker/service_worker_type_converters.cc b/content/renderer/service_worker/service_worker_type_converters.cc index ca15fab..1e0b86ac 100644 --- a/content/renderer/service_worker/service_worker_type_converters.cc +++ b/content/renderer/service_worker/service_worker_type_converters.cc
@@ -126,23 +126,4 @@ return output; } -blink::WebServiceWorkerContextProxy::BackgroundFetchState -TypeConverter<blink::WebServiceWorkerContextProxy::BackgroundFetchState, - content::mojom::BackgroundFetchState>:: - Convert(content::mojom::BackgroundFetchState input) { - switch (input) { - case content::mojom::BackgroundFetchState::PENDING: - return blink::WebServiceWorkerContextProxy::BackgroundFetchState:: - kPending; - case content::mojom::BackgroundFetchState::SUCCEEDED: - return blink::WebServiceWorkerContextProxy::BackgroundFetchState:: - kSucceeded; - case content::mojom::BackgroundFetchState::FAILED: - return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kFailed; - } - - NOTREACHED(); - return blink::WebServiceWorkerContextProxy::BackgroundFetchState::kPending; -} - } // namespace mojo
diff --git a/content/renderer/service_worker/service_worker_type_converters.h b/content/renderer/service_worker/service_worker_type_converters.h index 796c746..7857869 100644 --- a/content/renderer/service_worker/service_worker_type_converters.h +++ b/content/renderer/service_worker/service_worker_type_converters.h
@@ -56,13 +56,6 @@ const payments::mojom::PaymentDetailsModifierPtr& input); }; -template <> -struct TypeConverter<blink::WebServiceWorkerContextProxy::BackgroundFetchState, - content::mojom::BackgroundFetchState> { - static blink::WebServiceWorkerContextProxy::BackgroundFetchState Convert( - content::mojom::BackgroundFetchState input); -}; - } // namespace #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTERS_H_
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc index a20cd1f..34ff87e8 100644 --- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
@@ -198,6 +198,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info, @@ -213,6 +214,7 @@ name_(info->name), url_(info->url), renderer_preferences_(renderer_preferences), + preference_watcher_request_(std::move(preference_watcher_request)), appcache_host_id_(appcache_host_id) { // The ID of the precreated AppCacheHost can be valid only when the // NetworkService is enabled. @@ -392,7 +394,8 @@ loader_factories_->Clone(); auto worker_fetch_context = std::make_unique<WebWorkerFetchContextImpl>( - std::move(renderer_preferences_), std::move(worker_client_request), + std::move(renderer_preferences_), std::move(preference_watcher_request_), + std::move(worker_client_request), std::move(worker_client_registry_ptr_info), std::move(container_host_ptr_info), loader_factories_->Clone(), std::move(fallback_factory),
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.h b/content/renderer/shared_worker/embedded_shared_worker_stub.h index 05eb2e6..85dc8d5d 100644 --- a/content/renderer/shared_worker/embedded_shared_worker_stub.h +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.h
@@ -15,6 +15,7 @@ #include "content/common/shared_worker/shared_worker.mojom.h" #include "content/common/shared_worker/shared_worker_host.mojom.h" #include "content/common/shared_worker/shared_worker_info.mojom.h" +#include "content/public/common/renderer_preference_watcher.mojom.h" #include "content/public/common/renderer_preferences.h" #include "ipc/ipc_listener.h" #include "mojo/public/cpp/bindings/binding.h" @@ -61,6 +62,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info, @@ -110,6 +112,9 @@ bool running_ = false; GURL url_; RendererPreferences renderer_preferences_; + // Set on ctor and passed to the fetch context created when + // CreateWorkerFetchContext() is called. + mojom::RendererPreferenceWatcherRequest preference_watcher_request_; std::unique_ptr<blink::WebSharedWorker> impl_; using PendingChannel =
diff --git a/content/renderer/shared_worker/shared_worker_factory_impl.cc b/content/renderer/shared_worker/shared_worker_factory_impl.cc index 7f6eaa52..a8c429de 100644 --- a/content/renderer/shared_worker/shared_worker_factory_impl.cc +++ b/content/renderer/shared_worker/shared_worker_factory_impl.cc
@@ -25,6 +25,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info, @@ -38,10 +39,11 @@ // Bound to the lifetime of the underlying blink::WebSharedWorker instance. new EmbeddedSharedWorkerStub( std::move(info), pause_on_start, devtools_worker_token, - renderer_preferences, std::move(content_settings), - std::move(service_worker_provider_info), appcache_host_id, - std::move(script_loader_factory_ptr_info), std::move(subresource_loaders), - std::move(host), std::move(request), std::move(interface_provider)); + renderer_preferences, std::move(preference_watcher_request), + std::move(content_settings), std::move(service_worker_provider_info), + appcache_host_id, std::move(script_loader_factory_ptr_info), + std::move(subresource_loaders), std::move(host), std::move(request), + std::move(interface_provider)); } } // namespace content
diff --git a/content/renderer/shared_worker/shared_worker_factory_impl.h b/content/renderer/shared_worker/shared_worker_factory_impl.h index 226ec923..42433c91 100644 --- a/content/renderer/shared_worker/shared_worker_factory_impl.h +++ b/content/renderer/shared_worker/shared_worker_factory_impl.h
@@ -26,6 +26,7 @@ bool pause_on_start, const base::UnguessableToken& devtools_worker_token, const RendererPreferences& renderer_preferences, + mojom::RendererPreferenceWatcherRequest preference_watcher_request, blink::mojom::WorkerContentSettingsProxyPtr content_settings, mojom::ServiceWorkerProviderInfoForSharedWorkerPtr service_worker_provider_info,
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc index b4390b7..fe40306 100644 --- a/content/shell/test_runner/test_runner.cc +++ b/content/shell/test_runner/test_runner.cc
@@ -216,10 +216,6 @@ void QueueLoadingScript(const std::string& script); void QueueNonLoadingScript(const std::string& script); void QueueReload(); - void RemoveOriginAccessWhitelistEntry(const std::string& source_origin, - const std::string& destination_protocol, - const std::string& destination_host, - bool allow_destination_subdomains); void RemoveSpellCheckResolvedCallback(); void RemoveWebPageOverlay(); void ResetTestHelperControllers(); @@ -514,8 +510,6 @@ .SetMethod("queueNonLoadingScript", &TestRunnerBindings::QueueNonLoadingScript) .SetMethod("queueReload", &TestRunnerBindings::QueueReload) - .SetMethod("removeOriginAccessWhitelistEntry", - &TestRunnerBindings::RemoveOriginAccessWhitelistEntry) .SetMethod("removeSpellCheckResolvedCallback", &TestRunnerBindings::RemoveSpellCheckResolvedCallback) .SetMethod("removeWebPageOverlay", @@ -859,18 +853,6 @@ } } -void TestRunnerBindings::RemoveOriginAccessWhitelistEntry( - const std::string& source_origin, - const std::string& destination_protocol, - const std::string& destination_host, - bool allow_destination_subdomains) { - if (runner_) { - runner_->RemoveOriginAccessWhitelistEntry( - source_origin, destination_protocol, destination_host, - allow_destination_subdomains); - } -} - bool TestRunnerBindings::HasCustomPageSizeStyle(int page_index) { if (view_runner_) return view_runner_->HasCustomPageSizeStyle(page_index); @@ -2109,20 +2091,6 @@ WebString::FromUTF8(destination_host), allow_destination_subdomains); } -void TestRunner::RemoveOriginAccessWhitelistEntry( - const std::string& source_origin, - const std::string& destination_protocol, - const std::string& destination_host, - bool allow_destination_subdomains) { - WebURL url((GURL(source_origin))); - if (!url.IsValid()) - return; - - WebSecurityPolicy::RemoveOriginAccessWhitelistEntry( - url, WebString::FromUTF8(destination_protocol), - WebString::FromUTF8(destination_host), allow_destination_subdomains); -} - void TestRunner::SetTextSubpixelPositioning(bool value) { #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) // Since FontConfig doesn't provide a variable to control subpixel
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index a3eb63a..f726754 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -2023,9 +2023,7 @@ "../browser/android/overscroll_controller_android_unittest.cc", "../browser/android/scoped_surface_request_manager_unittest.cc", "../browser/android/url_request_content_job_unittest.cc", - "../browser/font_unique_name_lookup/font_table_matcher_unittest.cc", "../browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc", - "../browser/font_unique_name_lookup/icu_fold_case_util_unittest.cc", "../browser/media/capture/screen_capture_device_android_unittest.cc", "../renderer/java/gin_java_bridge_value_converter_unittest.cc", "../renderer/media/android/stream_texture_wrapper_impl_unittest.cc", @@ -2039,10 +2037,11 @@ deps += [ "//base:base_java_unittest_support", "//build/config/freetype", - "//content/browser/font_unique_name_lookup:font_unique_name_table_proto", "//content/public/android:content_java", "//media/capture/content/android", "//media/capture/content/android:screen_capture_java", + "//third_party/blink/public/common", + "//third_party/blink/public/common:font_unique_name_table_proto", "//ui/android:android", ]
diff --git a/content/test/data/accessibility/event/aria-combo-box-next-expected-win.txt b/content/test/data/accessibility/event/aria-combo-box-next-expected-win.txt index 295ffcf..56032b1b 100644 --- a/content/test/data/accessibility/event/aria-combo-box-next-expected-win.txt +++ b/content/test/data/accessibility/event/aria-combo-box-next-expected-win.txt
@@ -1,6 +1,5 @@ EVENT_OBJECT_FOCUS on <li#option3> role=ROLE_SYSTEM_LISTITEM name="Banana" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE 3 of 3 EVENT_OBJECT_SELECTION on <li#option3> role=ROLE_SYSTEM_LISTITEM name="Banana" SELECTED,FOCUSABLE,SELECTABLE 3 of 3 EVENT_OBJECT_SELECTIONWITHIN on <ul#list> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL -EVENT_OBJECT_STATECHANGE on <li#option2> role=ROLE_SYSTEM_LISTITEM name="Orange" FOCUSED,FOCUSABLE,SELECTABLE 2 of 3 EVENT_OBJECT_STATECHANGE on <li#option3> role=ROLE_SYSTEM_LISTITEM name="Banana" SELECTED,FOCUSABLE,SELECTABLE 3 of 3 IA2_EVENT_ACTIVE_DESCENDANT_CHANGED on <input> role=ROLE_SYSTEM_COMBOBOX EXPANDED,FOCUSABLE,HASPOPUP IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE,IA2_STATE_SUPPORTS_AUTOCOMPLETION \ No newline at end of file
diff --git a/content/test/data/accessibility/event/listbox-next-expected-win.txt b/content/test/data/accessibility/event/listbox-next-expected-win.txt index 6313d39e..79e6ae67 100644 --- a/content/test/data/accessibility/event/listbox-next-expected-win.txt +++ b/content/test/data/accessibility/event/listbox-next-expected-win.txt
@@ -1,6 +1,6 @@ EVENT_OBJECT_FOCUS on <option> role=ROLE_SYSTEM_LISTITEM name="Orange" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE 2 of 3 -EVENT_OBJECT_SELECTION on <option> role=ROLE_SYSTEM_LISTITEM name="Orange" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE 2 of 3 +EVENT_OBJECT_SELECTION on <option> role=ROLE_SYSTEM_LISTITEM name="Orange" SELECTED,FOCUSABLE,SELECTABLE 2 of 3 EVENT_OBJECT_SELECTIONWITHIN on <select> role=ROLE_SYSTEM_LIST FOCUSABLE IA2_STATE_VERTICAL EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Apple" FOCUSABLE,SELECTABLE 1 of 3 -EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Orange" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE 2 of 3 +EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Orange" SELECTED,FOCUSABLE,SELECTABLE 2 of 3 IA2_EVENT_ACTIVE_DESCENDANT_CHANGED on <select> role=ROLE_SYSTEM_LIST FOCUSABLE IA2_STATE_VERTICAL \ No newline at end of file
diff --git a/content/test/data/accessibility/event/menulist-collapse-expected-mac.txt b/content/test/data/accessibility/event/menulist-collapse-expected-mac.txt index 9cd9306..3259a45 100644 --- a/content/test/data/accessibility/event/menulist-collapse-expected-mac.txt +++ b/content/test/data/accessibility/event/menulist-collapse-expected-mac.txt
@@ -1,2 +1 @@ -AXFocusedUIElementChanged on AXPopUpButton AXValueChanged on AXPopUpButton \ No newline at end of file
diff --git a/content/test/data/accessibility/event/menulist-collapse-expected-win.txt b/content/test/data/accessibility/event/menulist-collapse-expected-win.txt index b8b8928..811a31f0 100644 --- a/content/test/data/accessibility/event/menulist-collapse-expected-win.txt +++ b/content/test/data/accessibility/event/menulist-collapse-expected-win.txt
@@ -1,4 +1,2 @@ -EVENT_OBJECT_FOCUS on <select> role=ROLE_SYSTEM_COMBOBOX FOCUSED,COLLAPSED,FOCUSABLE,HASPOPUP -EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Apple" INVISIBLE,FOCUSABLE,SELECTABLE 1 of 3 -EVENT_OBJECT_VALUECHANGE on <select> role=ROLE_SYSTEM_COMBOBOX FOCUSED,COLLAPSED,FOCUSABLE,HASPOPUP -IA2_EVENT_ACTIVE_DESCENDANT_CHANGED on role=ROLE_SYSTEM_LIST INVISIBLE \ No newline at end of file +EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Apple" FOCUSED,INVISIBLE,FOCUSABLE,SELECTABLE 1 of 3 +EVENT_OBJECT_VALUECHANGE on <select> role=ROLE_SYSTEM_COMBOBOX COLLAPSED,FOCUSABLE,HASPOPUP \ No newline at end of file
diff --git a/content/test/data/accessibility/event/menulist-focus-expected-mac.txt b/content/test/data/accessibility/event/menulist-focus-expected-mac.txt index 59dc690..ed71f2f6 100644 --- a/content/test/data/accessibility/event/menulist-focus-expected-mac.txt +++ b/content/test/data/accessibility/event/menulist-focus-expected-mac.txt
@@ -1,2 +1 @@ -AXFocusedUIElementChanged on AXMenuItem AXValue="Apple" -AXMenuItemSelected on AXMenuItem AXValue="Apple" \ No newline at end of file +AXFocusedUIElementChanged on AXPopUpButton AXValue="Apple" \ No newline at end of file
diff --git a/content/test/data/accessibility/event/menulist-focus-expected-win.txt b/content/test/data/accessibility/event/menulist-focus-expected-win.txt index 8cfb14b..094112d 100644 --- a/content/test/data/accessibility/event/menulist-focus-expected-win.txt +++ b/content/test/data/accessibility/event/menulist-focus-expected-win.txt
@@ -1,2 +1 @@ -EVENT_OBJECT_FOCUS on <option> role=ROLE_SYSTEM_LISTITEM name="Apple" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE 1 of 3 -IA2_EVENT_ACTIVE_DESCENDANT_CHANGED on role=ROLE_SYSTEM_LIST INVISIBLE \ No newline at end of file +EVENT_OBJECT_FOCUS on <select> role=ROLE_SYSTEM_COMBOBOX value="Apple" FOCUSED,COLLAPSED,FOCUSABLE,HASPOPUP \ No newline at end of file
diff --git a/content/test/gpu/gpu_tests/maps_integration_test.py b/content/test/gpu/gpu_tests/maps_integration_test.py index f5cc8566..45a40b10 100644 --- a/content/test/gpu/gpu_tests/maps_integration_test.py +++ b/content/test/gpu/gpu_tests/maps_integration_test.py
@@ -71,24 +71,6 @@ json_contents = json.load(f) return json_contents - def _SpinWaitOnRAF(self, iterations, timeout=60): - self.tab.ExecuteJavaScript(""" - window.__spinWaitOnRAFDone = false; - var iterationsLeft = {{ iterations }}; - - function spin() { - iterationsLeft--; - if (iterationsLeft == 0) { - window.__spinWaitOnRAFDone = true; - return; - } - window.requestAnimationFrame(spin); - } - window.requestAnimationFrame(spin); - """, iterations=iterations) - self.tab.WaitForJavaScriptCondition( - 'window.__spinWaitOnRAFDone', timeout=timeout) - def RunActualGpuTest(self, url, *args): tab = self.tab pixel_expectations_file = args[0] @@ -98,10 +80,13 @@ action_runner.EvaluateJavaScript('window.startTest()') action_runner.WaitForJavaScriptCondition('window.testDone', timeout=320) - # TODO(kbr): This should not be necessary, but it's not clear if the test - # is failing on the bots in its absence. Remove once we can verify that - # it's safe to do so. - self._SpinWaitOnRAF(3) + # Wait for the page to process immediate work and load tiles. + action_runner.EvaluateJavaScript(''' + window.testCompleted = false; + requestIdleCallback( + () => window.testCompleted = true, + { timeout : 10000 })''') + action_runner.WaitForJavaScriptCondition('window.testCompleted', timeout=30) if not tab.screenshot_supported: self.fail('Browser does not support screenshot capture')
diff --git a/docs/speed/perf_lab_platforms.md b/docs/speed/perf_lab_platforms.md index 97b6ecb67..68d437b 100644 --- a/docs/speed/perf_lab_platforms.md +++ b/docs/speed/perf_lab_platforms.md
@@ -1,52 +1,29 @@ + +[comment]: # (AUTOGENERATED FILE DO NOT EDIT) +[comment]: # (See //tools/perf/generate_perf_data to make changes) + # Platforms tested in the Performance Lab ## Android - * [Nexus - 5X](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus5X%20Perf) - (Chrome and Webview) - * [Nexus - 5](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus5%20Perf) - * [Nexus - 6](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus6%20Perf) (Chrome and WebView) - * [Nexus - 7](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus7v2%20Perf) - * [Android - One](https://build.chromium.org/p/chromium.perf/builders/Android%20One%20Perf) - * [Android Go](https://ci.chromium.org/buildbot/chromium.perf/android-go-perf/) - -## Mac - - * [Mac - 10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%2010.11%20Perf) - * [Mac - 10.12](https://build.chromium.org/p/chromium.perf/builders/Mac%2010.12%20Perf) - * [Retina - Mac](https://build.chromium.org/p/chromium.perf/builders/Mac%20Retina%20Perf) - * [Macbook Pro - 10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%20Pro%2010.11%20Perf) - * [Macbook Air - 10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%20Air%2010.11%20Perf) - * [Mac Mini - 8GB running - 10.12](https://build.chromium.org/p/chromium.perf/builders/Mac%20Mini%208GB%2010.12%20Perf) - -## Windows - - * [Zenbook](https://build.chromium.org/p/chromium.perf/builders/Win%20Zenbook%20Perf) - * [Win 10 - High - DPI](https://build.chromium.org/p/chromium.perf/builders/Win%2010%20High-DPI%20Perf) - * [Win 10](https://build.chromium.org/p/chromium.perf/builders/Win%2010%20Perf) - * [Win 8](https://build.chromium.org/p/chromium.perf/builders/Win%208%20Perf) - * [Win 7](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Perf) - * [Win 7 - - x64](https://build.chromium.org/p/chromium.perf/builders/Win%207%20x64%20Perf) - * [Win 7 with ATI - GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20ATI%20GPU%20Perf) - * [Win 7 with Intel - GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Intel%20GPU%20Perf) - * [Win 7 with nVidia - GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Nvidia%20GPU%20Perf) + * [android-go-perf](https://ci.chromium.org/buildbot/chromium.perf/android-go-perf/): Android O. + * [Android Nexus5 Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus5%20Perf/): Android KOT49H. + * [android-nexus5x-perf](https://ci.chromium.org/buildbot/chromium.perf/android-nexus5x-perf/): Android MMB29Q. + * [Android Nexus5X WebView Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus5X%20WebView%20Perf/): Android AOSP MOB30K. + * [Android Nexus6 WebView Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus6%20WebView%20Perf/): Android AOSP MOB30K. ## Linux - * [Ubuntu](https://build.chromium.org/p/chromium.perf/builders/Linux%20Perf) + * [linux-perf](https://ci.chromium.org/buildbot/chromium.perf/linux-perf/): Ubuntu-14.04, 8 core, NVIDIA Quadro P400. + +## Mac + + * [mac-10_12_laptop_low_end-perf](https://ci.chromium.org/buildbot/chromium.perf/mac-10_12_laptop_low_end-perf/): MacBook Air, Core i5 1.8 GHz, 8GB RAM, 128GB SSD, HD Graphics. + * [mac-10_13_laptop_high_end-perf](https://ci.chromium.org/buildbot/chromium.perf/mac-10_13_laptop_high_end-perf/): MacBook Pro, Core i7 2.8 GHz, 16GB RAM, 256GB SSD, Radeon 55. + +## Windows + + * [win-10-perf](https://ci.chromium.org/buildbot/chromium.perf/win-10-perf/): Windows Intel HD 630 towers, Core i7-7700 3.6 GHz, 16GB RAM, Intel Kaby Lake HD Graphics 630. + * [Win 7 Nvidia GPU Perf](https://ci.chromium.org/buildbot/chromium.perf/Win%207%20Nvidia%20GPU%20Perf/): N/A. + * [Win 7 Perf](https://ci.chromium.org/buildbot/chromium.perf/Win%207%20Perf/): N/A. +
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 41b56b5..fa223e2 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc
@@ -351,8 +351,13 @@ content::RenderFrameHost* render_frame_host, const GURL& security_origin, content::MediaStreamType type) { - DCHECK_EQ(AppWindow::web_contents(), - content::WebContents::FromRenderFrameHost(render_frame_host)); + DCHECK(AppWindow::web_contents() == + content::WebContents::FromRenderFrameHost(render_frame_host) || + (content::WebContents::FromRenderFrameHost(render_frame_host) + ->GetOuterWebContents() && + AppWindow::web_contents() == + content::WebContents::FromRenderFrameHost(render_frame_host) + ->GetOuterWebContents())); return helper_->CheckMediaAccessPermission(render_frame_host, security_origin, type); }
diff --git a/infra/config/global/luci-logdog-dev.cfg b/infra/config/global/luci-logdog-dev.cfg new file mode 100644 index 0000000..7057d02 --- /dev/null +++ b/infra/config/global/luci-logdog-dev.cfg
@@ -0,0 +1,16 @@ +# Copyright (c) 2015 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. +# +# For the schema of this file and documentation, see ProjectConfig message in +# https://luci-config.appspot.com/schemas/projects:luci-logdog.cfg + +# Auth groups who can read log streams. +reader_auth_groups: "all" +# Auth groups who can register and emit new log streams. +writer_auth_groups: "luci-logdog-chromium-dev-writers" + +# The base Google Storage archival path for this project. +# +# Archived LogDog logs will be written to this bucket/path. +archive_gs_bucket: "chromium-luci-logdog"
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_disclosure_header_footer_item.mm b/ios/chrome/browser/ui/table_view/cells/table_view_disclosure_header_footer_item.mm index 3ef32da..5584f8c 100644 --- a/ios/chrome/browser/ui/table_view/cells/table_view_disclosure_header_footer_item.mm +++ b/ios/chrome/browser/ui/table_view/cells/table_view_disclosure_header_footer_item.mm
@@ -42,6 +42,8 @@ headerFooter); header.titleLabel.text = self.text; header.subtitleLabel.text = self.subtitleText; + header.isAccessibilityElement = YES; + header.accessibilityTraits |= UIAccessibilityTraitButton; DisclosureDirection direction = self.collapsed ? DisclosureDirectionUp : DisclosureDirectionDown; [header setInitialDirection:direction]; @@ -238,4 +240,11 @@ } } +#pragma mark - Accessibility + +- (NSString*)accessibilityLabel { + return [NSString stringWithFormat:@"%@, %@", self.titleLabel.text, + self.subtitleLabel.text]; +} + @end
diff --git a/media/DEPS b/media/DEPS index 6214a75..0e5c6e92 100644 --- a/media/DEPS +++ b/media/DEPS
@@ -25,6 +25,7 @@ "+third_party/widevine/cdm/widevine_cdm_common.h", "-ipc", "-media/blink", + "-media/webrtc", ] specific_include_rules = {
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn index 585ad87c..3b5e57d 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn
@@ -123,6 +123,7 @@ "audio_output_stream_sink.h", "audio_power_monitor.cc", "audio_power_monitor.h", + "audio_processing.h", "audio_source_diverter.h", "audio_sync_reader.cc", "audio_sync_reader.h",
diff --git a/media/audio/audio_processing.h b/media/audio/audio_processing.h new file mode 100644 index 0000000..ceee965 --- /dev/null +++ b/media/audio/audio_processing.h
@@ -0,0 +1,40 @@ +// Copyright 2018 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 MEDIA_AUDIO_AUDIO_PROCESSING_H_ +#define MEDIA_AUDIO_AUDIO_PROCESSING_H_ + +#include "base/files/file.h" +#include "base/time/time.h" +#include "base/unguessable_token.h" +#include "media/base/media_export.h" + +namespace media { + +enum class AutomaticGainControlType { kDisabled, kDefault, kExperimental }; +enum class EchoCancellationType { kDisabled, kAec2, kAec3, kSystemAec }; +enum class NoiseSuppressionType { kDisabled, kDefault, kExperimental }; + +struct MEDIA_EXPORT AudioProcessingSettings { + EchoCancellationType echo_cancellation = EchoCancellationType::kDisabled; + NoiseSuppressionType noise_suppression = NoiseSuppressionType::kDisabled; + AutomaticGainControlType automatic_gain_control = + AutomaticGainControlType::kDisabled; + bool high_pass_filter = false; + bool typing_detection = false; + bool stereo_mirroring = false; + + bool operator==(const AudioProcessingSettings& b) const { + return echo_cancellation == b.echo_cancellation && + noise_suppression == b.noise_suppression && + automatic_gain_control == b.automatic_gain_control && + high_pass_filter == b.high_pass_filter && + typing_detection == b.typing_detection && + stereo_mirroring == b.stereo_mirroring; + } +}; + +} // namespace media + +#endif // MEDIA_AUDIO_AUDIO_PROCESSING_H_
diff --git a/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc index e2b83646..7c09af1 100644 --- a/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc
@@ -84,7 +84,7 @@ // consumption, provided by the client. struct VaapiJpegDecodeAccelerator::DecodeRequest { DecodeRequest(int32_t bitstream_buffer_id, - std::unique_ptr<WritableUnalignedMapping> shm, + std::unique_ptr<UnalignedSharedMemory> shm, const scoped_refptr<VideoFrame>& video_frame) : bitstream_buffer_id(bitstream_buffer_id), shm(std::move(shm)), @@ -92,7 +92,7 @@ ~DecodeRequest() = default; int32_t bitstream_buffer_id; - std::unique_ptr<WritableUnalignedMapping> shm; + std::unique_ptr<UnalignedSharedMemory> shm; scoped_refptr<VideoFrame> video_frame; }; @@ -310,17 +310,17 @@ DVLOGF(4) << "Mapping new input buffer id: " << bitstream_buffer.id() << " size: " << bitstream_buffer.size(); + // UnalignedSharedMemory will take over the |bitstream_buffer.handle()|. + auto shm = std::make_unique<UnalignedSharedMemory>( + bitstream_buffer.handle(), bitstream_buffer.size(), true); + if (bitstream_buffer.id() < 0) { VLOGF(1) << "Invalid bitstream_buffer, id: " << bitstream_buffer.id(); NotifyErrorFromDecoderThread(bitstream_buffer.id(), INVALID_ARGUMENT); return; } - auto shm = std::make_unique<WritableUnalignedMapping>( - bitstream_buffer.handle(), bitstream_buffer.size(), - bitstream_buffer.offset()); - - if (!shm->IsValid()) { + if (!shm->MapAt(bitstream_buffer.offset(), bitstream_buffer.size())) { VLOGF(1) << "Failed to map input buffer"; NotifyErrorFromDecoderThread(bitstream_buffer.id(), UNREADABLE_INPUT); return;
diff --git a/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h index 4ba645e..f3f6e74 100644 --- a/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h +++ b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h
@@ -16,6 +16,7 @@ #include "base/synchronization/lock.h" #include "base/threading/thread.h" #include "media/base/bitstream_buffer.h" +#include "media/base/unaligned_shared_memory.h" #include "media/gpu/media_gpu_export.h" #include "media/gpu/vaapi/vaapi_jpeg_decoder.h" #include "media/gpu/vaapi/vaapi_wrapper.h"
diff --git a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc index 2b6040c0..afedbcd4 100644 --- a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc
@@ -50,8 +50,8 @@ VaapiJpegEncodeAccelerator::EncodeRequest::EncodeRequest( int32_t buffer_id, scoped_refptr<media::VideoFrame> video_frame, - std::unique_ptr<WritableUnalignedMapping> exif_shm, - std::unique_ptr<WritableUnalignedMapping> output_shm, + std::unique_ptr<UnalignedSharedMemory> exif_shm, + std::unique_ptr<UnalignedSharedMemory> output_shm, int quality) : buffer_id(buffer_id), video_frame(std::move(video_frame)), @@ -286,11 +286,12 @@ return; } - std::unique_ptr<WritableUnalignedMapping> exif_shm; + std::unique_ptr<UnalignedSharedMemory> exif_shm; if (exif_buffer) { - exif_shm = std::make_unique<WritableUnalignedMapping>( - exif_buffer->handle(), exif_buffer->size(), exif_buffer->offset()); - if (!exif_shm->IsValid()) { + // |exif_shm| will take ownership of the |exif_buffer->handle()|. + exif_shm = std::make_unique<UnalignedSharedMemory>( + exif_buffer->handle(), exif_buffer->size(), true); + if (!exif_shm->MapAt(exif_buffer->offset(), exif_buffer->size())) { VLOGF(1) << "Failed to map exif buffer"; task_runner_->PostTask( FROM_HERE, base::BindOnce(&VaapiJpegEncodeAccelerator::NotifyError, @@ -306,9 +307,10 @@ } } - auto output_shm = std::make_unique<WritableUnalignedMapping>( - output_buffer.handle(), output_buffer.size(), output_buffer.offset()); - if (!output_shm->IsValid()) { + // |output_shm| will take ownership of the |output_buffer.handle()|. + auto output_shm = std::make_unique<UnalignedSharedMemory>( + output_buffer.handle(), output_buffer.size(), false); + if (!output_shm->MapAt(output_buffer.offset(), output_buffer.size())) { VLOGF(1) << "Failed to map output buffer"; task_runner_->PostTask( FROM_HERE,
diff --git a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h index 534aa09..5a7f22c 100644 --- a/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h +++ b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h
@@ -50,15 +50,15 @@ struct EncodeRequest { EncodeRequest(int32_t buffer_id, scoped_refptr<media::VideoFrame> video_frame, - std::unique_ptr<WritableUnalignedMapping> exif_shm, - std::unique_ptr<WritableUnalignedMapping> output_shm, + std::unique_ptr<UnalignedSharedMemory> exif_shm, + std::unique_ptr<UnalignedSharedMemory> output_shm, int quality); ~EncodeRequest(); int32_t buffer_id; scoped_refptr<media::VideoFrame> video_frame; - std::unique_ptr<WritableUnalignedMapping> exif_shm; - std::unique_ptr<WritableUnalignedMapping> output_shm; + std::unique_ptr<UnalignedSharedMemory> exif_shm; + std::unique_ptr<UnalignedSharedMemory> output_shm; int quality; DISALLOW_COPY_AND_ASSIGN(EncodeRequest);
diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc index 38406c59..b347326 100644 --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -86,7 +86,7 @@ public: InputBuffer() = default; InputBuffer(uint32_t id, - std::unique_ptr<WritableUnalignedMapping> shm, + std::unique_ptr<UnalignedSharedMemory> shm, base::OnceCallback<void(int32_t id)> release_cb) : id_(id), shm_(std::move(shm)), release_cb_(std::move(release_cb)) {} ~InputBuffer() { @@ -98,11 +98,11 @@ // Indicates this is a dummy buffer for flush request. bool IsFlushRequest() const { return shm_ == nullptr; } int32_t id() const { return id_; } - WritableUnalignedMapping* shm() const { return shm_.get(); } + UnalignedSharedMemory* shm() const { return shm_.get(); } private: const int32_t id_ = -1; - const std::unique_ptr<WritableUnalignedMapping> shm_; + const std::unique_ptr<UnalignedSharedMemory> shm_; base::OnceCallback<void(int32_t id)> release_cb_; DISALLOW_COPY_AND_ASSIGN(InputBuffer); @@ -287,11 +287,11 @@ DCHECK(flush_buffer->IsFlushRequest()); input_buffers_.push(std::move(flush_buffer)); } else { - auto shm = std::make_unique<WritableUnalignedMapping>( - bitstream_buffer.handle(), bitstream_buffer.size(), - bitstream_buffer.offset()); - RETURN_AND_NOTIFY_ON_FAILURE(shm->IsValid(), "Failed to map input buffer", - UNREADABLE_INPUT, ); + auto shm = std::make_unique<UnalignedSharedMemory>( + bitstream_buffer.handle(), bitstream_buffer.size(), true); + RETURN_AND_NOTIFY_ON_FAILURE( + shm->MapAt(bitstream_buffer.offset(), bitstream_buffer.size()), + "Failed to map input buffer", UNREADABLE_INPUT, ); auto input_buffer = std::make_unique<InputBuffer>( bitstream_buffer.id(), std::move(shm),
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc index 9cbb8c26..f87a7510 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -126,12 +126,13 @@ struct VaapiVideoEncodeAccelerator::BitstreamBufferRef { BitstreamBufferRef(int32_t id, const BitstreamBuffer& buffer) : id(id), - shm(std::make_unique<WritableUnalignedMapping>(buffer.handle(), - buffer.size(), - buffer.offset())) {} - + shm(std::make_unique<UnalignedSharedMemory>(buffer.handle(), + buffer.size(), + false)), + offset(buffer.offset()) {} const int32_t id; - const std::unique_ptr<WritableUnalignedMapping> shm; + const std::unique_ptr<UnalignedSharedMemory> shm; + const off_t offset; }; VideoEncodeAccelerator::SupportedProfiles @@ -414,7 +415,6 @@ scoped_refptr<VaapiEncodeJob> encode_job, std::unique_ptr<BitstreamBufferRef> buffer) { DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); - DCHECK(buffer->shm->IsValid()); uint8_t* target_data = reinterpret_cast<uint8_t*>(buffer->shm->memory()); size_t data_size = 0; @@ -552,7 +552,7 @@ DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); DCHECK_NE(state_, kUninitialized); - if (!buffer_ref->shm->IsValid()) { + if (!buffer_ref->shm->MapAt(buffer_ref->offset, buffer_ref->shm->size())) { NOTIFY_ERROR(kPlatformFailureError, "Failed mapping shared memory."); return; }
diff --git a/media/webrtc/BUILD.gn b/media/webrtc/BUILD.gn new file mode 100644 index 0000000..27b02e0 --- /dev/null +++ b/media/webrtc/BUILD.gn
@@ -0,0 +1,20 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//media/media_options.gni") +import("//third_party/webrtc/webrtc.gni") + +source_set("webrtc") { + sources = [ + "audio_processor_controls.h", + ] + deps = [ + "//base", + "//media", + "//third_party/webrtc/api:libjingle_peerconnection_api", + "//third_party/webrtc/modules/audio_processing", + "//third_party/webrtc/modules/audio_processing:audio_processing_statistics", + "//third_party/webrtc_overrides:init_webrtc", + ] +}
diff --git a/media/webrtc/DEPS b/media/webrtc/DEPS new file mode 100644 index 0000000..2de716e --- /dev/null +++ b/media/webrtc/DEPS
@@ -0,0 +1,4 @@ +include_rules = [ + "+third_party/webrtc/api", + "+third_party/webrtc/modules/audio_processing", +]
diff --git a/media/webrtc/OWNERS b/media/webrtc/OWNERS new file mode 100644 index 0000000..82cf799 --- /dev/null +++ b/media/webrtc/OWNERS
@@ -0,0 +1,7 @@ +olka@chromium.org +maxmorin@chromium.org +dalecurtis@chromium.org +miu@chromium.org +ossu@chromium.org + +# COMPONENT: Blink>WebRTC>Audio
diff --git a/media/webrtc/audio_processor_controls.h b/media/webrtc/audio_processor_controls.h new file mode 100644 index 0000000..173bf49 --- /dev/null +++ b/media/webrtc/audio_processor_controls.h
@@ -0,0 +1,34 @@ +// Copyright 2018 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 MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_ +#define MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_ + +#include "base/callback.h" +#include "third_party/webrtc/api/mediastreaminterface.h" + +namespace media { + +class MEDIA_EXPORT AudioProcessorControls { + public: + using GetStatsCB = base::OnceCallback<void( + const webrtc::AudioProcessorInterface::AudioProcessorStatistics& stats)>; + + // Request the latest stats from the audio processor. Stats are returned + // asynchronously through |callback|. + virtual void GetStats(GetStatsCB callback) = 0; + + // Begin dumping echo cancellation data into |file|. + virtual void StartEchoCancellationDump(base::File file) = 0; + + // Stop any ongoin dump of echo cancellation data. + virtual void StopEchoCancellationDump() = 0; + + protected: + virtual ~AudioProcessorControls() = default; +}; + +} // namespace media + +#endif // MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_
diff --git a/net/BUILD.gn b/net/BUILD.gn index 2ff04a5..59a8968 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -406,6 +406,7 @@ "android/gurl_utils.cc", "android/http_auth_negotiate_android.cc", "android/http_auth_negotiate_android.h", + "android/android_http_util.cc", "android/keystore.cc", "android/keystore.h", "android/legacy_openssl.h", @@ -2996,6 +2997,7 @@ "android/java/src/org/chromium/net/AndroidTrafficStats.java", "android/java/src/org/chromium/net/GURLUtils.java", "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java", + "android/java/src/org/chromium/net/HttpUtil.java", "android/java/src/org/chromium/net/NetStringUtil.java", "android/java/src/org/chromium/net/NetworkChangeNotifier.java", "android/java/src/org/chromium/net/ProxyChangeListener.java",
diff --git a/net/android/BUILD.gn b/net/android/BUILD.gn index 2d58824e..9372d9dc 100644 --- a/net/android/BUILD.gn +++ b/net/android/BUILD.gn
@@ -15,6 +15,7 @@ "java/src/org/chromium/net/GURLUtils.java", "java/src/org/chromium/net/HttpNegotiateAuthenticator.java", "java/src/org/chromium/net/HttpNegotiateConstants.java", + "java/src/org/chromium/net/HttpUtil.java", "java/src/org/chromium/net/NetStringUtil.java", "java/src/org/chromium/net/NetworkChangeNotifier.java", "java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java", @@ -155,6 +156,7 @@ "javatests/src/org/chromium/net/AndroidNetworkLibraryTestUtil.java", "javatests/src/org/chromium/net/AndroidProxyConfigServiceTestUtil.java", "javatests/src/org/chromium/net/AndroidProxySelectorTest.java", + "javatests/src/org/chromium/net/HttpUtilTest.java", "javatests/src/org/chromium/net/NetErrorsTest.java", "javatests/src/org/chromium/net/NetworkChangeNotifierNoNativeTest.java", "javatests/src/org/chromium/net/NetworkChangeNotifierTest.java",
diff --git a/net/android/android_http_util.cc b/net/android/android_http_util.cc new file mode 100644 index 0000000..5b42fd0a --- /dev/null +++ b/net/android/android_http_util.cc
@@ -0,0 +1,30 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/android/jni_string.h" +#include "jni/HttpUtil_jni.h" +#include "net/http/http_util.h" +#include "url/gurl.h" + +using base::android::JavaParamRef; +using base::android::ScopedJavaLocalRef; +using base::android::ConvertJavaStringToUTF16; + +namespace net { + +jboolean JNI_HttpUtil_IsAllowedHeader( + JNIEnv* env, + const JavaParamRef<jclass>& clazz, + const JavaParamRef<jstring>& j_header_name, + const JavaParamRef<jstring>& j_header_value) { + std::string header_name(ConvertJavaStringToUTF8(env, j_header_name)); + std::string header_value(ConvertJavaStringToUTF8(env, j_header_value)); + + return HttpUtil::IsValidHeaderName(header_name) + && HttpUtil::IsSafeHeader(header_name) + && HttpUtil::IsValidHeaderValue(header_value); +} + +} // namespace net +
diff --git a/net/android/java/src/org/chromium/net/HttpUtil.java b/net/android/java/src/org/chromium/net/HttpUtil.java new file mode 100644 index 0000000..9214bc0 --- /dev/null +++ b/net/android/java/src/org/chromium/net/HttpUtil.java
@@ -0,0 +1,26 @@ +// Copyright 2018 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.net; + +import org.chromium.base.annotations.JNINamespace; + +/** + * Class to access HttpUtil library from Java. + * + * The corresponding native code is in net/android/android_http_util.cc. + */ +@JNINamespace("net") +public final class HttpUtil { + /** + * Returns true iff: + * - |headerName| is validly formed (see HttpUtil::IsValidHeaderName). + * - |headerName| is not a forbidden header (see HttpUtil::IsSafeHeader). + * - |headerValue| is validly formed (see HttpUtil::IsValidHeaderValue). + */ + public static boolean isAllowedHeader(String headerName, String headerValue) { + return nativeIsAllowedHeader(headerName, headerValue); + } + private static native boolean nativeIsAllowedHeader(String headerName, String headerValue); +}
diff --git a/net/android/javatests/src/org/chromium/net/HttpUtilTest.java b/net/android/javatests/src/org/chromium/net/HttpUtilTest.java new file mode 100644 index 0000000..63c6f057 --- /dev/null +++ b/net/android/javatests/src/org/chromium/net/HttpUtilTest.java
@@ -0,0 +1,86 @@ +// Copyright 2018 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.net; + +import android.support.test.filters.MediumTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.library_loader.LibraryLoader; +import org.chromium.base.library_loader.LibraryProcessType; +import org.chromium.base.library_loader.ProcessInitException; +import org.chromium.base.test.BaseJUnit4ClassRunner; + +import java.util.Arrays; +import java.util.List; + +/** + * Tests for {@link HttpUtil}. HttpUtil forwards to native code, and the lion's share of the logic + * is tested there. This test is primarily to make sure everything is plumbed through correctly. + */ +@RunWith(BaseJUnit4ClassRunner.class) +public class HttpUtilTest { + private static final List<String> UNALLOWED_HEADER_NAMES = Arrays.asList( + "accept-encoding", // Unsafe header. + "ACCEPT-ENCODING", // Unsafe header. + "referer", // Unsafe header. + "", // Badly formed header. + "ref(erer", // Badly formed header. + "ref\nerer" // Badly formed header. + ); + + private static final List<String> ALLOWED_HEADER_NAMES = Arrays.asList( + "accept-language", + "Cache-Control" + ); + + private static final String UNALLOWED_HEADER_VALUE = "value\nAccept-Encoding: br"; + private static final String ALLOWED_HEADER_VALUE = "value"; + + @Before + public void setUp() throws ProcessInitException { + LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_BROWSER); + } + + @Test + @MediumTest + public void testAllowedHeaders() { + for (String headerName: ALLOWED_HEADER_NAMES) { + Assert.assertTrue(headerName, + HttpUtil.isAllowedHeader(headerName, ALLOWED_HEADER_VALUE)); + } + } + + @Test + @MediumTest + public void testUnallowedHeaders() { + for (String headerName: UNALLOWED_HEADER_NAMES) { + Assert.assertFalse(headerName, + HttpUtil.isAllowedHeader(headerName, UNALLOWED_HEADER_VALUE)); + } + } + + @Test + @MediumTest + public void testUnallowedHeaderNames() { + for (String headerName: UNALLOWED_HEADER_NAMES) { + Assert.assertFalse(headerName, + HttpUtil.isAllowedHeader(headerName, ALLOWED_HEADER_VALUE)); + } + } + + + @Test + @MediumTest + public void testUnallowedHeaderValue() { + for (String headerName: ALLOWED_HEADER_NAMES) { + Assert.assertFalse(headerName, + HttpUtil.isAllowedHeader(headerName, UNALLOWED_HEADER_VALUE)); + } + } +}
diff --git a/remoting/host/basic_desktop_environment.cc b/remoting/host/basic_desktop_environment.cc index 434ea023..b4ab9fd 100644 --- a/remoting/host/basic_desktop_environment.cc +++ b/remoting/host/basic_desktop_environment.cc
@@ -20,6 +20,10 @@ #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" +#if defined(OS_WIN) +#include "remoting/host/win/evaluate_d3d.h" +#endif + #if defined(USE_X11) #include "remoting/host/linux/x11_util.h" #endif @@ -98,6 +102,16 @@ DCHECK(caller_task_runner_->BelongsToCurrentThread()); #if defined(USE_X11) IgnoreXServerGrabs(desktop_capture_options().x_display()->display(), true); +#elif defined(OS_WIN) + // The options passed to this instance are determined by a process running in + // Session 0. Access to DirectX functions in Session 0 is limited so the + // results are not guaranteed to be accurate in the desktop context. Due to + // this problem, we need to requery the following method to make sure we are + // still safe to use D3D APIs. Only overwrite the value if it isn't safe to + // use D3D APIs as we don't want to re-enable this setting if it was disabled + // via an experiment or client flag. + if (!IsD3DAvailable()) + options_.desktop_capture_options()->set_allow_directx_capturer(false); #endif }
diff --git a/remoting/host/desktop_environment_options.cc b/remoting/host/desktop_environment_options.cc index 3947ae4..5eef6c9 100644 --- a/remoting/host/desktop_environment_options.cc +++ b/remoting/host/desktop_environment_options.cc
@@ -45,14 +45,11 @@ void DesktopEnvironmentOptions::Initialize() { desktop_capture_options_.set_detect_updated_region(true); #if defined (OS_WIN) - // Whether DirectX capturer can be enabled depends on various facts, include - // also how many applications are using related APIs. WebRTC/DesktopCapturer - // will take care of all the details. So the check here only ensures it won't - // crash the binary: GetD3DCapability() returns false only when the binary - // crashes. - if (GetD3DCapability()) { - desktop_capture_options_.set_allow_directx_capturer(true); - } + // Whether DirectX capturer can be enabled depends on various factors, + // including how many applications are using related APIs. + // WebRTC/DesktopCapturer will take care of those details. This check is used + // to ensure D3D APIs are safe to access in the current environment. + desktop_capture_options_.set_allow_directx_capturer(IsD3DAvailable()); #endif }
diff --git a/remoting/host/evaluate_capability.cc b/remoting/host/evaluate_capability.cc index cdb6fce0..458de22d 100644 --- a/remoting/host/evaluate_capability.cc +++ b/remoting/host/evaluate_capability.cc
@@ -19,6 +19,7 @@ #include "remoting/host/switches.h" #if defined(OS_WIN) +#include "remoting/host/win/evaluate_3d_display_mode.h" #include "remoting/host/win/evaluate_d3d.h" #endif @@ -90,6 +91,9 @@ if (type == kEvaluateD3D) { return EvaluateD3D(); } + if (type == kEvaluate3dDisplayMode) { + return Evaluate3dDisplayMode(); + } #endif return kInvalidCommandLineExitCode;
diff --git a/remoting/host/host_attributes.cc b/remoting/host/host_attributes.cc index 11fed71..f1d5f29 100644 --- a/remoting/host/host_attributes.cc +++ b/remoting/host/host_attributes.cc
@@ -19,6 +19,7 @@ #include "base/win/windows_version.h" #include "media/base/win/mf_initializer.h" #include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h" +#include "remoting/host/win/evaluate_3d_display_mode.h" #include "remoting/host/win/evaluate_d3d.h" #endif @@ -103,7 +104,7 @@ } #if defined(OS_WIN) { - GetD3DCapability(&result); + GetD3DCapabilities(&result); auto version = base::win::GetVersion(); if (version >= base::win::VERSION_WIN8) {
diff --git a/remoting/host/switches.cc b/remoting/host/switches.cc index 99d2e23..492cdf96 100644 --- a/remoting/host/switches.cc +++ b/remoting/host/switches.cc
@@ -25,6 +25,7 @@ #if defined(OS_WIN) const char kEvaluateD3D[] = "d3d-support"; +const char kEvaluate3dDisplayMode[] = "3d-display-mode"; #endif const char kParentWindowSwitchName[] = "parent-window";
diff --git a/remoting/host/switches.h b/remoting/host/switches.h index 5af695f7..6f1b633 100644 --- a/remoting/host/switches.h +++ b/remoting/host/switches.h
@@ -40,6 +40,8 @@ #if defined(OS_WIN) // Executes EvaluateD3D() function. extern const char kEvaluateD3D[]; +// Executes Evaluate3dDisplayMode() function. +extern const char kEvaluate3dDisplayMode[]; #endif // Used to pass the HWND for the parent process to a child process.
diff --git a/remoting/host/win/BUILD.gn b/remoting/host/win/BUILD.gn index e74d704..72f12fc6 100644 --- a/remoting/host/win/BUILD.gn +++ b/remoting/host/win/BUILD.gn
@@ -82,6 +82,8 @@ "com_security.h", "default_audio_device_change_detector.cc", "default_audio_device_change_detector.h", + "evaluate_3d_display_mode.cc", + "evaluate_3d_display_mode.h", "evaluate_d3d.cc", "evaluate_d3d.h", "launch_process_with_token.cc",
diff --git a/remoting/host/win/evaluate_3d_display_mode.cc b/remoting/host/win/evaluate_3d_display_mode.cc new file mode 100644 index 0000000..9dbcc60 --- /dev/null +++ b/remoting/host/win/evaluate_3d_display_mode.cc
@@ -0,0 +1,56 @@ +// Copyright 2018 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 "remoting/host/win/evaluate_3d_display_mode.h" + +#include <D3DCommon.h> +#include <comdef.h> +#include <dxgi1_3.h> +#include <wrl/client.h> + +#include <iostream> + +#include "base/logging.h" +#include "base/macros.h" +#include "base/strings/string_util.h" +#include "remoting/host/evaluate_capability.h" +#include "remoting/host/host_exit_codes.h" +#include "remoting/host/switches.h" + +namespace remoting { + +namespace { + +constexpr char k3dDisplayModeEnabled[] = "3D-Display-Mode"; + +} // namespace + +int Evaluate3dDisplayMode() { + Microsoft::WRL::ComPtr<IDXGIFactory2> factory; + HRESULT hr = CreateDXGIFactory2(/*flags=*/0, IID_PPV_ARGS(&factory)); + if (hr != S_OK) { + LOG(WARNING) << "CreateDXGIFactory2 failed: 0x" << std::hex << hr; + return kInitializationFailed; + } + + if (factory->IsWindowedStereoEnabled()) + std::cout << k3dDisplayModeEnabled << std::endl; + + return kSuccessExitCode; +} + +bool Get3dDisplayModeEnabled() { + std::string output; + if (EvaluateCapability(kEvaluate3dDisplayMode, &output) != kSuccessExitCode) + return false; + + base::TrimString(output, base::kWhitespaceASCII, &output); + + bool is_3d_display_mode_enabled = (output == k3dDisplayModeEnabled); + LOG_IF(INFO, is_3d_display_mode_enabled) << "3D Display Mode enabled."; + + return is_3d_display_mode_enabled; +} + +} // namespace remoting
diff --git a/remoting/host/win/evaluate_3d_display_mode.h b/remoting/host/win/evaluate_3d_display_mode.h new file mode 100644 index 0000000..b72fe86 --- /dev/null +++ b/remoting/host/win/evaluate_3d_display_mode.h
@@ -0,0 +1,27 @@ +// Copyright 2018 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 REMOTING_HOST_WIN_EVALUATE_3D_DISPLAY_MODE_H_ +#define REMOTING_HOST_WIN_EVALUATE_3D_DISPLAY_MODE_H_ + +#include <string> +#include <vector> + +namespace remoting { + +// Evaluates the Stereoscopic 3D capability of the system. +// When this mode is enabled and we are in curtain mode on Windows, all DX +// CreateDevice calls take several seconds longer than usual. The result is +// that the connection may time out or be unusable so we want to query this +// setting to determine if we should just use the GDI capturer instead. +// DO NOT call this method within the host process. +int Evaluate3dDisplayMode(); + +// Returns whether 3D Display Mode (a.k.a. Stereoscopic 3D) is enabled. +// Note: This is an expensive call as it creates a new process and blocks on it. +bool Get3dDisplayModeEnabled(); + +} // namespace remoting + +#endif // REMOTING_HOST_WIN_EVALUATE_3D_DISPLAY_MODE_H_
diff --git a/remoting/host/win/evaluate_d3d.cc b/remoting/host/win/evaluate_d3d.cc index 8a1b1f6..becf9c4 100644 --- a/remoting/host/win/evaluate_d3d.cc +++ b/remoting/host/win/evaluate_d3d.cc
@@ -13,6 +13,7 @@ #include "remoting/host/evaluate_capability.h" #include "remoting/host/host_exit_codes.h" #include "remoting/host/switches.h" +#include "remoting/host/win/evaluate_3d_display_mode.h" #include "third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" #include "third_party/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" @@ -57,26 +58,55 @@ return kSuccessExitCode; } -bool GetD3DCapability(std::vector<std::string>* result /* = nullptr */) { - std::string d3d_info; - if (EvaluateCapability(kEvaluateD3D, &d3d_info) != kSuccessExitCode) { - if (result) { - result->push_back(kNoDirectXCapturer); - } +bool BlockD3DCheck() { + DWORD console_session = WTSGetActiveConsoleSessionId(); + DWORD current_session = 0; + if (!ProcessIdToSessionId(GetCurrentProcessId(), ¤t_session)) { + PLOG(WARNING) << "ProcessIdToSessionId failed: "; + } + + // Session 0 is not curtained as it does not have an interactive desktop. + bool is_curtained_session = + current_session != 0 && current_session != console_session; + + // Skip D3D checks if we are in a curtained session and 3D Display mode is + // enabled. Attempting to create a D3D device in this scenario takes a long + // time which often results in the user being disconnected due to timeouts. + // After digging in, it looks like the call to D3D11CreateDevice() is spinning + // while enumerating the display drivers. There isn't a simple fix for this + // so instead we should skip the D3D caps check and any other D3D related + // calls. This will mean falling back to the GDI capturer. + return is_curtained_session && Get3dDisplayModeEnabled(); +} + +bool GetD3DCapabilities(std::vector<std::string>* result) { + if (BlockD3DCheck()) { + result->push_back(kNoDirectXCapturer); return false; } - if (result) { - auto capabilities = base::SplitString( - d3d_info, - base::kWhitespaceASCII, - base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); - for (const auto& capability : capabilities) { - result->push_back(capability); - } + std::string d3d_info; + if (EvaluateCapability(kEvaluateD3D, &d3d_info) != kSuccessExitCode) { + result->push_back(kNoDirectXCapturer); + return false; } + + auto capabilities = + base::SplitString(d3d_info, base::kWhitespaceASCII, base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY); + for (const auto& capability : capabilities) { + result->push_back(capability); + } + return true; } +bool IsD3DAvailable() { + if (BlockD3DCheck()) + return false; + + std::string unused; + return (EvaluateCapability(kEvaluateD3D, &unused) == kSuccessExitCode); +} + } // namespace remoting
diff --git a/remoting/host/win/evaluate_d3d.h b/remoting/host/win/evaluate_d3d.h index 5e12323..32c3a375 100644 --- a/remoting/host/win/evaluate_d3d.h +++ b/remoting/host/win/evaluate_d3d.h
@@ -10,18 +10,21 @@ namespace remoting { -// Evaluates the D3D capability of the system and outputs the results into -// stdout. +// Evaluates the D3D capability of the system and sends the results to stdout. // DO NOT call this method within the host process. Only call in an isolated // child process. I.e. from EvaluateCapabilityLocally(). int EvaluateD3D(); // Evaluates the D3D capability of the system in a separate process. Returns -// true if the process succeeded. The capabilities will be stored in |result| if -// it's not nullptr. +// true if the process succeeded. The capabilities will be stored in |result|. // Note, this is not a cheap call, it uses EvaluateCapability() internally to // spawn a new process, which may take a noticeable amount of time. -bool GetD3DCapability(std::vector<std::string>* result = nullptr); +bool GetD3DCapabilities(std::vector<std::string>* result); + +// Used to ensure that pulling in the DirectX dependencies and creating a D3D +// Device does not result in a crash or system instability. +// Note: This is an expensive call as it creates a new process and blocks on it. +bool IsD3DAvailable(); } // namespace remoting
diff --git a/services/network/network_context_unittest.cc b/services/network/network_context_unittest.cc index c73804f8..121ecd64 100644 --- a/services/network/network_context_unittest.cc +++ b/services/network/network_context_unittest.cc
@@ -3230,7 +3230,8 @@ ASSERT_EQ(num_sockets, 4); } -TEST_F(NetworkContextTest, PreconnectMax) { +// Flaky; see http://crbug.com/874419 +TEST_F(NetworkContextTest, DISABLED_PreconnectMax) { std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(CreateContextParams());
diff --git a/services/network/public/mojom/udp_socket.mojom b/services/network/public/mojom/udp_socket.mojom index 2d1151e..f43d7d4 100644 --- a/services/network/public/mojom/udp_socket.mojom +++ b/services/network/public/mojom/udp_socket.mojom
@@ -87,6 +87,16 @@ // addresses. Returns a net error code. Should only be called after Bind(). SetBroadcast(bool broadcast) => (int32 result); + // Sets the OS send buffer size (in bytes) for the socket. Overwrites any + // previously set value. Returns a net error code. + // See |UDPSocketOptions::send_buffer_size| for more information. + SetSendBufferSize(int32 send_buffer_size) => (int32 result); + + // Sets the OS receive buffer size (in bytes) for the socket. Overwrites any + // previously set value. Returns a net error code. + // See |UDPSocketOptions::receive_buffer_size| for more information. + SetReceiveBufferSize(int32 receive_buffer_size) => (int32 result); + // Joins a multicast group. |group_address| is the group address to join, // could be either an IPv4 or IPv6 address. Returns a net error code. // See RFC 1112 for details on multicast.
diff --git a/services/network/udp_socket.cc b/services/network/udp_socket.cc index 5de2447..d929f329 100644 --- a/services/network/udp_socket.cc +++ b/services/network/udp_socket.cc
@@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/numerics/checked_math.h" +#include "base/numerics/ranges.h" #include "base/numerics/safe_conversions.h" #include "base/optional.h" #include "net/base/io_buffer.h" @@ -25,6 +26,13 @@ // IPv6. const uint32_t kMaxPacketSize = kMaxReadSize - 1; +int ClampBufferSize(int requested_buffer_size) { + constexpr int kMinBufferSize = 0; + constexpr int kMaxBufferSize = 128 * 1024; + return base::ClampToRange(requested_buffer_size, kMinBufferSize, + kMaxBufferSize); +} + class SocketWrapperImpl : public UDPSocket::SocketWrapper { public: SocketWrapperImpl(net::DatagramSocket::BindType bind_type, @@ -74,6 +82,12 @@ int SetBroadcast(bool broadcast) override { return socket_.SetBroadcast(broadcast); } + int SetSendBufferSize(int send_buffer_size) override { + return socket_.SetSendBufferSize(ClampBufferSize(send_buffer_size)); + } + int SetReceiveBufferSize(int receive_buffer_size) override { + return socket_.SetReceiveBufferSize(ClampBufferSize(receive_buffer_size)); + } int JoinGroup(const net::IPAddress& group_address) override { return socket_.JoinGroup(group_address); } @@ -113,11 +127,11 @@ } if (result == net::OK && options->receive_buffer_size != 0) { result = socket_.SetReceiveBufferSize( - base::saturated_cast<int32_t>(options->receive_buffer_size)); + ClampBufferSize(options->receive_buffer_size)); } if (result == net::OK && options->send_buffer_size != 0) { - result = socket_.SetSendBufferSize( - base::saturated_cast<int32_t>(options->send_buffer_size)); + result = + socket_.SetSendBufferSize(ClampBufferSize(options->send_buffer_size)); } return result; } @@ -193,6 +207,26 @@ std::move(callback).Run(net_result); } +void UDPSocket::SetSendBufferSize(int32_t send_buffer_size, + SetSendBufferSizeCallback callback) { + if (!is_bound_) { + std::move(callback).Run(net::ERR_UNEXPECTED); + return; + } + int net_result = wrapped_socket_->SetSendBufferSize(send_buffer_size); + std::move(callback).Run(net_result); +} + +void UDPSocket::SetReceiveBufferSize(int32_t receive_buffer_size, + SetSendBufferSizeCallback callback) { + if (!is_bound_) { + std::move(callback).Run(net::ERR_UNEXPECTED); + return; + } + int net_result = wrapped_socket_->SetReceiveBufferSize(receive_buffer_size); + std::move(callback).Run(net_result); +} + void UDPSocket::JoinGroup(const net::IPAddress& group_address, JoinGroupCallback callback) { if (!is_bound_) {
diff --git a/services/network/udp_socket.h b/services/network/udp_socket.h index 84fbf90..5bd5ff3 100644 --- a/services/network/udp_socket.h +++ b/services/network/udp_socket.h
@@ -61,6 +61,8 @@ net::CompletionOnceCallback callback, const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; virtual int SetBroadcast(bool broadcast) = 0; + virtual int SetSendBufferSize(int send_buffer_size) = 0; + virtual int SetReceiveBufferSize(int receive_buffer_size) = 0; virtual int JoinGroup(const net::IPAddress& group_address) = 0; virtual int LeaveGroup(const net::IPAddress& group_address) = 0; virtual int RecvFrom(net::IOBuffer* buf, @@ -80,6 +82,10 @@ mojom::UDPSocketOptionsPtr options, BindCallback callback) override; void SetBroadcast(bool broadcast, SetBroadcastCallback callback) override; + void SetSendBufferSize(int32_t send_buffer_size, + SetSendBufferSizeCallback callback) override; + void SetReceiveBufferSize(int32_t receive_buffer_size, + SetSendBufferSizeCallback callback) override; void JoinGroup(const net::IPAddress& group_address, JoinGroupCallback callback) override; void LeaveGroup(const net::IPAddress& group_address,
diff --git a/services/network/udp_socket_test_util.cc b/services/network/udp_socket_test_util.cc index cf7a9f34..e7887f8 100644 --- a/services/network/udp_socket_test_util.cc +++ b/services/network/udp_socket_test_util.cc
@@ -99,6 +99,30 @@ return net_error; } +int UDPSocketTestHelper::SetSendBufferSizeSync(int send_buffer_size) { + base::RunLoop run_loop; + int net_error = net::ERR_FAILED; + socket_->get()->SetSendBufferSize(send_buffer_size, + base::BindLambdaForTesting([&](int result) { + net_error = result; + run_loop.Quit(); + })); + run_loop.Run(); + return net_error; +} + +int UDPSocketTestHelper::SetReceiveBufferSizeSync(int receive_buffer_size) { + base::RunLoop run_loop; + int net_error = net::ERR_FAILED; + socket_->get()->SetReceiveBufferSize( + receive_buffer_size, base::BindLambdaForTesting([&](int result) { + net_error = result; + run_loop.Quit(); + })); + run_loop.Run(); + return net_error; +} + int UDPSocketTestHelper::JoinGroupSync(const net::IPAddress& group_address) { base::RunLoop run_loop; int net_error = net::ERR_FAILED;
diff --git a/services/network/udp_socket_test_util.h b/services/network/udp_socket_test_util.h index 579128f..8218209 100644 --- a/services/network/udp_socket_test_util.h +++ b/services/network/udp_socket_test_util.h
@@ -38,6 +38,8 @@ const std::vector<uint8_t>& input); int SendSync(const std::vector<uint8_t>& input); int SetBroadcastSync(bool broadcast); + int SetSendBufferSizeSync(int send_buffer_size); + int SetReceiveBufferSizeSync(int receive_buffer_size); int JoinGroupSync(const net::IPAddress& group_address); int LeaveGroupSync(const net::IPAddress& group_address);
diff --git a/services/network/udp_socket_unittest.cc b/services/network/udp_socket_unittest.cc index 1f29183..a33ff22 100644 --- a/services/network/udp_socket_unittest.cc +++ b/services/network/udp_socket_unittest.cc
@@ -62,6 +62,14 @@ NOTREACHED(); return net::ERR_NOT_IMPLEMENTED; } + int SetSendBufferSize(int send_buffer_size) override { + NOTREACHED(); + return net::ERR_NOT_IMPLEMENTED; + } + int SetReceiveBufferSize(int receive_buffer_size) override { + NOTREACHED(); + return net::ERR_NOT_IMPLEMENTED; + } int JoinGroup(const net::IPAddress& group_address) override { NOTREACHED(); return net::ERR_NOT_IMPLEMENTED; @@ -279,10 +287,16 @@ // Now these Setters should not work before Bind(). EXPECT_EQ(net::ERR_UNEXPECTED, helper.SetBroadcastSync(true)); + EXPECT_EQ(net::ERR_UNEXPECTED, helper.SetSendBufferSizeSync(4096)); + EXPECT_EQ(net::ERR_UNEXPECTED, helper.SetReceiveBufferSizeSync(4096)); // Now Bind() the socket. ASSERT_EQ(net::OK, helper.BindSync(local_addr, nullptr, &local_addr)); + // Setting the buffer size should now succeed. + EXPECT_EQ(net::OK, helper.SetSendBufferSizeSync(4096)); + EXPECT_EQ(net::OK, helper.SetReceiveBufferSizeSync(4096)); + // Calling Connect() after Bind() should fail because they can't be both used. ASSERT_EQ(net::ERR_SOCKET_IS_CONNECTED, helper.ConnectSync(local_addr, nullptr, &local_addr));
diff --git a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter index 26d0c04..591ee4da 100644 --- a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter +++ b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
@@ -181,24 +181,6 @@ # about an origin. -ReportingBrowserTest.TestReportingHeadersProcessed -# FileWriter doesn't work when the network service is enabled, presumably due -# to https://crbug.com/859594 --ExtensionStorageMonitorTest.DoubleInitialThreshold --ExtensionStorageMonitorTest.ExceedInitialThreshold --ExtensionStorageMonitorTest.ThrottleNotifications --ExtensionStorageMonitorTest.UserDisabledNotifications --FileSystemApiTest.FileSystemApiGetWritableWithWriteTest --FileSystemApiTest.FileSystemApiOpenDirectoryWithWriteTest --FileSystemApiTest.FileSystemApiOpenExistingFileWithWriteTest --FileSystemApiTest.FileSystemApiOpenMultipleWritableExistingFilesTest --FileSystemApiTest.FileSystemApiOpenWritableExistingFileWithWriteTest --FileSystemApiTest.FileSystemApiRestoreDirectoryEntry --FileSystemApiTest.FileSystemApiRestoreEntry --FileSystemApiTest.FileSystemApiSaveExistingFileWithWriteTest --FileSystemApiTest.FileSystemApiSaveNewFileWithWriteTest --PlatformAppWithFileBrowserTest.LaunchNewFile --SyncFileSystemApiTest.WriteFileThenGetUsage - # https://crbug.com/862176 # Requires checking Origin headers on requests made after extension unload. -ExtensionUnloadBrowserTest.UnloadWithContentScripts
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 055e1280..bd20cbb 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -3383,21 +3383,6 @@ ] } ], - "ReaderForAccessibility": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "AllowReaderForAccessibility" - ] - } - ] - } - ], "ReaderModeUI": [ { "platforms": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index bcf3190..3530de9 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -56,6 +56,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html [ Pass ] crbug.com/855279 fast/css/text-overflow-ellipsis-vertical-hittest.html [ Pass ] crbug.com/591099 fast/dom/inner-text-first-letter.html [ Pass ] +crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Pass ] # New failures are appended below by the script. crbug.com/591099 animations/rotate-transform-equivalent.html [ Failure ] @@ -341,7 +342,7 @@ crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_properties.html [ Failure ] crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_shorthand.html [ Failure ] crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_normal_wrapped.html [ Failure ] -crbug.com/591099 external/wpt/workers/Worker_terminate_event_queue.htm [ Crash Timeout ] +crbug.com/591099 external/wpt/workers/Worker_terminate_event_queue.htm [ Timeout ] crbug.com/591099 external/wpt/workers/baseurl/alpha/worker-in-worker.html [ Pass ] crbug.com/591099 external/wpt/workers/constructors/Worker/same-origin.html [ Timeout ] crbug.com/591099 external/wpt/workers/semantics/interface-objects/004.html [ Failure ] @@ -381,7 +382,6 @@ crbug.com/591099 fast/css/getComputedStyle/computed-style-percentage-top-with-position-inline.html [ Failure ] crbug.com/835484 fast/css/outline-narrowLine.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ Failure ] -crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Failure ] crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ] crbug.com/591099 fast/events/wheel/mainthread-touchpad-fling-latching.html [ Pass ] crbug.com/591099 fast/events/wheel/wheel-scroll-latching-on-scrollbar.html [ Pass ] @@ -408,8 +408,8 @@ crbug.com/591099 fast/table/dynamic-descendant-percentage-height.html [ Failure ] crbug.com/591099 fast/table/empty-table-percent-height.html [ Failure ] crbug.com/591099 fast/table/height-percent-test-vertical.html [ Failure ] -crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure ] -crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure Pass ] +crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure Pass ] +crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure ] crbug.com/858998 fast/table/table-continuation-outline-paint-crash.html [ Failure ] crbug.com/591099 fast/table/table-display-types-vertical.html [ Failure ] crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure ] @@ -558,6 +558,8 @@ crbug.com/591099 virtual/gpu-rasterization/images/feature-policy-max-downscaling-image-edge-cases.html [ Failure ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-color-over-image.html [ Pass ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-gradient-over-pattern.html [ Pass Timeout ] +crbug.com/591099 virtual/intersection-observer-v2/http/tests/intersection-observer/v2/cross-origin-effects.html [ Failure ] +crbug.com/591099 virtual/intersection-observer-v2/http/tests/intersection-observer/v2/cross-origin-occlusion.html [ Failure ] crbug.com/591099 virtual/layout_ng/ [ Skip ] crbug.com/824918 virtual/layout_ng_experimental/ [ Skip ] crbug.com/591099 virtual/mojo-blob-urls/external/wpt/FileAPI/url/sandboxed-iframe.html [ Pass ] @@ -573,7 +575,7 @@ crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/touch-rect-assert-first-layer-special.html [ Failure ] crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/touch-rect-crash-on-unpromote-layer.html [ Failure ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/ [ Skip ] -crbug.com/591099 virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Pass ] +crbug.com/591099 virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Pass Timeout ] crbug.com/591099 virtual/scroll_customization/ [ Skip ] crbug.com/591099 virtual/scroll_customization/fast/events/touch/compositor-touch-hit-rects.html [ Failure ] crbug.com/591099 virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.html [ Pass ] @@ -582,4 +584,4 @@ crbug.com/591099 virtual/threaded/ [ Skip ] crbug.com/591099 virtual/user-activation-v2/fast/events/mouse-cursor.html [ Failure ] crbug.com/591099 virtual/user-activation-v2/fast/events/touch/compositor-touch-hit-rects.html [ Failure ] -crbug.com/591099 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Pass ] +crbug.com/591099 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/LeakExpectations b/third_party/WebKit/LayoutTests/LeakExpectations index 533bf941..3cdc017a 100644 --- a/third_party/WebKit/LayoutTests/LeakExpectations +++ b/third_party/WebKit/LayoutTests/LeakExpectations
@@ -79,6 +79,9 @@ # Test flaking on Linux Trusty Leak crbug.com/862029 [ Linux ] http/tests/devtools/tracing/timeline-misc/timeline-window-filter.js [ Pass Leak ] +# Sheriff 2018-08-15 +crbug.com/874442 [ Linux ] svg/animations/mpath-remove-from-dependents-on-delete-crash.html [ Pass Crash ] + ########################################################################### # WARNING: Memory leaks must be fixed asap. Sheriff is expected to revert # # culprit CLs instead of suppressing the leaks. If you have any question, #
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index 245376f..563c569 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -252,9 +252,9 @@ # Slow on Win Debug in part due to incremental linking. crbug.com/647192 [ Win Debug ] fast/css3-text/css3-word-break/word-break-all-ascii.html [ Slow ] -# Slow in Debug on all platforms. -crbug.com/819641 [ Debug ] virtual/stable/webexposed/global-interface-listing.html [ Slow ] -crbug.com/819641 [ Debug ] webexposed/global-interface-listing.html [ Slow ] +# Slow on many platforms. +crbug.com/866165 virtual/stable/webexposed/global-interface-listing.html [ Slow ] +crbug.com/866165 webexposed/global-interface-listing.html [ Slow ] # SwiftShader slow tests crbug.com/726075 [ Win Linux Mac ] css3/filters/effect-reference-zoom-hw.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 577d3ad..00f48a2 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -295,6 +295,7 @@ crbug.com/774229 editing/pasteboard/copy-paste-white-space.html [ Failure ] crbug.com/855279 fast/css/text-overflow-ellipsis-vertical-hittest.html [ Failure ] crbug.com/591099 fast/dom/inner-text-first-letter.html [ Failure ] +crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Failure ] crbug.com/796943 fast/text/international/shape-across-elements-simple.html [ Failure ] crbug.com/859233 external/wpt/css/css-break/hit-test-inline-fragmentation-with-border-radius.html [ Failure ] crbug.com/845902 external/wpt/css/css-sizing/whitespace-and-break.html [ Failure ] @@ -1693,7 +1694,6 @@ crbug.com/736308 virtual/outofblink-cors/http/tests/fetch/chromium/error-messages.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-all.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-exact-match.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-removal.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-subdomains.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html [ Failure ] crbug.com/867834 virtual/outofblink-cors-ns/external/wpt/fetch/api/cors/sandboxed-iframe.html [ Failure ] @@ -1707,7 +1707,6 @@ crbug.com/736308 virtual/outofblink-cors-ns/http/tests/fetch/chromium/error-messages.html [ Failure ] crbug.com/736308 virtual/outofblink-cors-ns/http/tests/xmlhttprequest/origin-whitelisting-all.html [ Failure ] crbug.com/736308 virtual/outofblink-cors-ns/http/tests/xmlhttprequest/origin-whitelisting-exact-match.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors-ns/http/tests/xmlhttprequest/origin-whitelisting-removal.html [ Failure ] crbug.com/736308 virtual/outofblink-cors-ns/http/tests/xmlhttprequest/origin-whitelisting-subdomains.html [ Failure ] crbug.com/736308 virtual/outofblink-cors-ns/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html [ Failure ] @@ -1722,7 +1721,7 @@ crbug.com/280342 [ Mac Linux Win ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass ] -crbug.com/520736 [ Win7 ] media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ] +crbug.com/520736 [ Win7 Linux ] media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ] crbug.com/520736 [ Win7 Mac ] virtual/video-surface-layer/media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ] crbug.com/865839 external/wpt/service-workers/service-worker/update-after-navigation-redirect.https.html [ Timeout ] @@ -1730,7 +1729,7 @@ crbug.com/841922 [ Linux Win Mac ] virtual/video-surface-layer/media/video-controls-focus-movement-on-hide.html [ Pass Failure ] -crbug.com/862716 [ Mac Linux Win ] css3/filters/effect-brightness-clamping-hw.html [ Failure Pass ] +crbug.com/862716 [ Mac Linux Win ] css3/filters/effect-brightness-clamping-hw.html [ Failure Pass Timeout ] crbug.com/862806 [ Mac ] css3/filters/effect-drop-shadow-hw.html [ Failure Pass ] crbug.com/862826 [ Mac Linux ] external/wpt/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html [ Failure Pass ] @@ -2714,7 +2713,6 @@ crbug.com/366558 [ Linux Win ] external/wpt/svg/text/reftests/text-multiline-003.svg [ Failure ] crbug.com/366553 external/wpt/svg/text/reftests/text-inline-size-201.svg [ Failure ] crbug.com/366553 external/wpt/svg/text/reftests/text-inline-size-001.svg [ Failure ] -crbug.com/872697 external/wpt/svg/painting/reftests/markers-orient-001.svg [ Failure ] crbug.com/366553 external/wpt/svg/text/reftests/text-inline-size-002.svg [ Failure ] crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-min-content-size-003.html [ Failure ] crbug.com/366553 external/wpt/svg/text/reftests/text-inline-size-006.svg [ Failure ] @@ -3919,6 +3917,13 @@ # Sheriff failures 2018-08-14 crbug.com/873435 virtual/user-activation-v2/fast/events/middleClickAutoscroll-in-iframe.html [ Timeout Pass ] +# Sheriff failures 2018-08-15 +crbug.com/873435 [ Mac ] fast/events/middleClickAutoscroll-in-iframe.html [ Timeout Pass ] +crbug.com/869726 [ Mac ] fast/events/touch/touch-latched-scroll-node-removed.html [ Pass Failure ] +crbug.com/869726 [ Mac ] fast/events/wheel/wheel-latched-scroll-node-removed.html [ Pass Failure ] +crbug.com/874444 [ Linux ] external/wpt/fullscreen/api/element-request-fullscreen-two-elements-manual.html [ Pass Failure ] +crbug.com/874500 [ Mac ] media/media-ended.html [ Pass Timeout ] + crbug.com/715718 external/wpt/media-source/mediasource-activesourcebuffers.html [ Failure Pass ] crbug.com/715718 external/wpt/media-source/mediasource-remove.html [ Failure Pass ] crbug.com/715718 [ Win ] external/wpt/xhr/FormData-append.html [ Failure Pass ] @@ -4493,7 +4498,7 @@ # Sheriff 2018-03-29 crbug.com/827088 bluetooth/requestDevice/chooser/new-scan-device-added.html [ Pass Crash ] -crbug.com/827209 fast/events/middleClickAutoscroll-latching.html [ Pass Failure ] +crbug.com/827209 fast/events/middleClickAutoscroll-latching.html [ Pass Failure Timeout ] crbug.com/827209 virtual/mouseevent_fractional/fast/events/middleClickAutoscroll-latching.html [ Pass Failure ] # Sheriff 2018-08-14 crbug.com/827209 virtual/user-activation-v2/fast/events/middleClickAutoscroll-latching.html [ Pass Timeout Failure ] @@ -4533,7 +4538,7 @@ crbug.com/818426 [ Linux ] virtual/gpu/fast/canvas/canvas-lost-gpu-context.html [ Pass Timeout ] crbug.com/800745 [ Linux ] virtual/gpu/fast/canvas/canvas-composite-video.html [ Pass Timeout ] -crbug.com/832274 [ Linux ] fast/forms/search/search-appearance-basic.html [ Pass Failure ] +crbug.com/832274 [ Linux Win ] fast/forms/search/search-appearance-basic.html [ Pass Failure ] crbug.com/840881 external/wpt/service-workers/service-worker/resource-timing.https.html [ Failure ] crbug.com/840881 virtual/outofblink-cors/external/wpt/service-workers/service-worker/resource-timing.https.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 122aeb59..12c201e2 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -36370,7 +36370,7 @@ "/css/css-contain/contain-size-007.html", [ [ - "/css/reference/pass_if_pass_below.html", + "/css/css-contain/reference/pass_if_pass_below_clipped.html", "==" ] ], @@ -36382,7 +36382,7 @@ "/css/css-contain/contain-size-008.html", [ [ - "/css/reference/pass_if_pass_below.html", + "/css/css-contain/reference/pass_if_pass_below_clipped.html", "==" ] ], @@ -36394,7 +36394,7 @@ "/css/css-contain/contain-size-009.html", [ [ - "/css/reference/pass_if_pass_below.html", + "/css/css-contain/reference/pass_if_pass_below_clipped.html", "==" ] ], @@ -36406,7 +36406,7 @@ "/css/css-contain/contain-size-010.html", [ [ - "/css/reference/pass_if_pass_below.html", + "/css/css-contain/reference/pass_if_pass_below_clipped.html", "==" ] ], @@ -112685,11 +112685,6 @@ {} ] ], - "css/css-backgrounds/parsing/resources/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-backgrounds/reference/60x60-green-background.html": [ [ {} @@ -113185,6 +113180,11 @@ {} ] ], + "css/css-backgrounds/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-backgrounds/support/pattern-grg-rgr-grg.png": [ [ {} @@ -113370,7 +113370,7 @@ {} ] ], - "css/css-box/parsing/resources/parsing-testcommon.js": [ + "css/css-box/support/parsing-testcommon.js": [ [ {} ] @@ -113410,12 +113410,12 @@ {} ] ], - "css/css-cascade/parsing/support/parsing-testcommon.js": [ + "css/css-cascade/reference/ref-filled-green-100px-square.xht": [ [ {} ] ], - "css/css-cascade/reference/ref-filled-green-100px-square.xht": [ + "css/css-cascade/support/parsing-testcommon.js": [ [ {} ] @@ -113490,12 +113490,12 @@ {} ] ], - "css/css-color/parsing/resources/parsing-testcommon.js": [ + "css/css-color/rebeccapurple-ref.html": [ [ {} ] ], - "css/css-color/rebeccapurple-ref.html": [ + "css/css-color/support/parsing-testcommon.js": [ [ {} ] @@ -114005,6 +114005,11 @@ {} ] ], + "css/css-contain/support/60x60-red.png": [ + [ + {} + ] + ], "css/css-contain/support/blue-100x100.png": [ [ {} @@ -124560,11 +124565,6 @@ {} ] ], - "css/css-images/parsing/resources/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-images/support/1x1-green.gif": [ [ {} @@ -124660,6 +124660,11 @@ {} ] ], + "css/css-images/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-images/support/pattern-grg-rgr-grg.png": [ [ {} @@ -125340,7 +125345,7 @@ {} ] ], - "css/css-masking/parsing/resources/parsing-testcommon.js": [ + "css/css-masking/support/parsing-testcommon.js": [ [ {} ] @@ -126740,11 +126745,6 @@ {} ] ], - "css/css-shapes/parsing/resources/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-shapes/parsing/shape-outside-invalid-expected.txt": [ [ {} @@ -127155,6 +127155,11 @@ {} ] ], + "css/css-shapes/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-shapes/support/pattern-grg-rgr-grg.png": [ [ {} @@ -130255,11 +130260,6 @@ {} ] ], - "css/css-transforms/parsing/resources/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-transforms/parsing/transform-box-valid-expected.txt": [ [ {} @@ -130635,6 +130635,11 @@ {} ] ], + "css/css-transforms/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-transforms/support/pattern-grg-rgr-grg.png": [ [ {} @@ -132330,11 +132335,6 @@ {} ] ], - "css/css-ui/parsing/support/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-ui/reference/box-sizing-001-ref.html": [ [ {} @@ -133615,6 +133615,11 @@ {} ] ], + "css/css-ui/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-ui/support/r1-1.svg": [ [ {} @@ -134550,11 +134555,6 @@ {} ] ], - "css/css-writing-modes/parsing/resources/parsing-testcommon.js": [ - [ - {} - ] - ], "css/css-writing-modes/reference/available-size-001-ref.html": [ [ {} @@ -136135,6 +136135,11 @@ {} ] ], + "css/css-writing-modes/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/css-writing-modes/support/pass-cdts-abs-pos-non-replaced.png": [ [ {} @@ -137485,7 +137490,7 @@ {} ] ], - "css/motion/parsing/resources/parsing-testcommon.js": [ + "css/motion/support/parsing-testcommon.js": [ [ {} ] @@ -139290,6 +139295,11 @@ {} ] ], + "css/selectors/scope-selector-expected.txt": [ + [ + {} + ] + ], "css/selectors/selector-placeholder-shown-type-change-001-ref.html": [ [ {} @@ -139500,6 +139510,11 @@ {} ] ], + "css/support/parsing-testcommon.js": [ + [ + {} + ] + ], "css/support/pattern-grg-rgr-grg.png": [ [ {} @@ -201598,6 +201613,12 @@ {} ] ], + "css/selectors/scope-selector.html": [ + [ + "/css/selectors/scope-selector.html", + {} + ] + ], "css/selectors/user-invalid.html": [ [ "/css/selectors/user-invalid.html", @@ -251566,6 +251587,12 @@ {} ] ], + "service-workers/service-worker/navigation-preload/navigationPreload.https.html": [ + [ + "/service-workers/service-worker/navigation-preload/navigationPreload.https.html", + {} + ] + ], "service-workers/service-worker/navigation-preload/redirect.https.html": [ [ "/service-workers/service-worker/navigation-preload/redirect.https.html", @@ -278016,7 +278043,7 @@ "support" ], "background-fetch/idlharness.https.any-expected.txt": [ - "4ab883226278a9601f6aac711d73ec9770f80077", + "4673735ca3027f737d85b2d32aee6a43ad3bb78c", "support" ], "background-fetch/idlharness.https.any.js": [ @@ -278028,11 +278055,11 @@ "support" ], "background-fetch/idlharness.https.any.sharedworker-expected.txt": [ - "6768d75b8d2aa9db766ef95c62ce8d063718b6dd", + "8ff75be93a49ef11aa9948e35ee8393e8091b07a", "support" ], "background-fetch/idlharness.https.any.worker-expected.txt": [ - "6768d75b8d2aa9db766ef95c62ce8d063718b6dd", + "8ff75be93a49ef11aa9948e35ee8393e8091b07a", "support" ], "background-fetch/mixed-content-and-allowed-schemes.https.window.js": [ @@ -300692,7 +300719,7 @@ "reftest" ], "css/css-backgrounds/box-shadow-syntax-001.html": [ - "fcf77540a8d60885c814fedad81ce86e8b5255c9", + "6cbbce702cb17e23f862b88f909cf993b51f86bc", "testharness" ], "css/css-backgrounds/box-shadow/box-shadow-blur-definition-001.xht": [ @@ -300800,139 +300827,139 @@ "visual" ], "css/css-backgrounds/parsing/background-attachment-invalid.html": [ - "f3479c12b4c3fb596877e06a1055d0790f2d916d", + "fabd0e0072c7447a7ae0b52295fe88211a68593f", "testharness" ], "css/css-backgrounds/parsing/background-attachment-valid.html": [ - "96c140513e4e6dfd99a69ebea422b19eda9f98a5", + "91042e0d546d9dc83f9ce63c4d602859c8a78b9a", "testharness" ], "css/css-backgrounds/parsing/background-clip-invalid.html": [ - "c3f8bc72eccd2321acdc8253d15c4a3324d0cf87", + "7365a1a8707a6fd67592f4bf013ba8f23fac492b", "testharness" ], "css/css-backgrounds/parsing/background-clip-valid.html": [ - "24f905fce13d982a0c1337ba55d557b6cad777ca", + "15abe3a005b020a8c454d821258e7e195931db78", "testharness" ], "css/css-backgrounds/parsing/background-color-invalid.html": [ - "ca5f8bc490fe1cdb83df34304e26e100a3c10bfb", + "dc1eac0fe44a8579b5442107dbedcafc86b79291", "testharness" ], "css/css-backgrounds/parsing/background-color-valid.html": [ - "28b2f10b322194066a3eaa8029ea61d21ee00611", + "692e08c477b525e84afefc840edbb602108bbd35", "testharness" ], "css/css-backgrounds/parsing/background-image-invalid.html": [ - "a5e459fe22426cb6dccbc91f67b649806967e47a", + "f663a6eb63ee5fece33ce7be0b431f66546766d6", "testharness" ], "css/css-backgrounds/parsing/background-image-valid.html": [ - "f251b9f16bece823fe92ef4952f8e7da46a7a41d", + "6dd5e4f8a8c226186a90fe92cde6de07db13fbea", "testharness" ], "css/css-backgrounds/parsing/background-invalid.html": [ - "88412ff025301663a689a806f35ac4cdbbb7fe24", + "15d1e7c4e6330ad6ec4cf8a2855ff867a6ded08a", "testharness" ], "css/css-backgrounds/parsing/background-origin-invalid.html": [ - "8337afbb2ac2ab37caa57d97a85f3d278c8a65ad", + "c998ca5d7e49ee8a3452c67b909ad1a3050e516b", "testharness" ], "css/css-backgrounds/parsing/background-origin-valid.html": [ - "0144aef6f80d1594665300244338af3a6740a4f0", + "46b6f77bef5df3c86e5d73bb710f7ee53e7de93d", "testharness" ], "css/css-backgrounds/parsing/background-position-invalid.html": [ - "4153736473996f62128d73591516718bb649510d", + "c485a991dcdc51198b462f2e022477875403a4dc", "testharness" ], "css/css-backgrounds/parsing/background-position-valid.html": [ - "6df1aeb1091a51952aafc8f9e48deed5e7a483c3", + "24ccc42fdb9c3d2f1bc9d9b7573156451271c68b", "testharness" ], "css/css-backgrounds/parsing/background-repeat-invalid.html": [ - "4f3b85fde314433c80d2b6c5d6f6906fa4cdc208", + "f5a08d09e5e4f01e610c4a6c731b58795f16dee2", "testharness" ], "css/css-backgrounds/parsing/background-repeat-valid.html": [ - "77d68bd03014d3f1898d1a05ed371a68f071ce3d", + "ff12d849a7e70da19b92d8dbf621f2db355ca390", "testharness" ], "css/css-backgrounds/parsing/background-size-invalid.html": [ - "b7389e94e0d05c8799b27fbf1ac5a4480e184c15", + "cb4be5a71b01ee6e400cd45a4af0467acd2b1ec0", "testharness" ], "css/css-backgrounds/parsing/background-size-valid.html": [ - "ee41ea05c486306e2aac58e6a9dfadd3497bc230", + "fb5f9b93bf867348c4aa354a49413f11851be705", "testharness" ], "css/css-backgrounds/parsing/background-valid.html": [ - "f382689c8f1d86cccadaab9f80d0ecd41e21757d", + "c528882c34ebfdbd383d2e1a4c1beb6ccefc94ce", "testharness" ], "css/css-backgrounds/parsing/border-color-invalid.html": [ - "f7440a1fc56d993b54d900263876bf5760ed73af", + "cf261423a2092a1b917d75b7ef7b1798cb261b9d", "testharness" ], "css/css-backgrounds/parsing/border-color-valid.html": [ - "07c3c5a177b266026ed4de667ba7740d58f377e7", + "3682e814282afddfefdd8da8fc8833d237386771", "testharness" ], "css/css-backgrounds/parsing/border-image-invalid.html": [ - "0d54df14c6d198fa6c7110b387a57ff1386a2d3f", + "81e06e28b2d96dd4fa1a6bda9480cfd798f6f3ce", "testharness" ], "css/css-backgrounds/parsing/border-image-outset-invalid.html": [ - "722a5b88b693db18cb6d20433d44641b41eb6695", + "75d2e6a70d30af34aae19dada05c0b0d022eb40d", "testharness" ], "css/css-backgrounds/parsing/border-image-outset-valid.html": [ - "d80773f48312a0ff60a6a490b8e9158f3f72b114", + "52d55d620e3afb7f5135f4f2dac74491bcd3dbcc", "testharness" ], "css/css-backgrounds/parsing/border-image-repeat-invalid.html": [ - "fb3440ba2b0ec3c0ed202cb40fa20aa5d0a8f044", + "79704f9485fc9af2c74217bf12165a553424299b", "testharness" ], "css/css-backgrounds/parsing/border-image-repeat-valid.html": [ - "405c18cf0407ac680cd0102348089a72c884fbe2", + "8bfaf0c2d303e50974a61fc0925e361ba8841645", "testharness" ], "css/css-backgrounds/parsing/border-image-slice-invalid.html": [ - "ef665af3a5630c712144870cb2560569b0d75cf3", + "c2959c01bc9f7b039f2e0cc767e61edd91287dc9", "testharness" ], "css/css-backgrounds/parsing/border-image-slice-valid.html": [ - "d9adf2b34e093fb1fcdff71cc9be6c549cdf0551", + "4d408a6cf5befab002d00b7ca453aee5f33fa277", "testharness" ], "css/css-backgrounds/parsing/border-image-source-invalid.html": [ - "a9bf80e5e2c518d27cc410f045c56dd803c2d548", + "c535ec16c3faa9a95958b069ad88f1e8a8ed6dee", "testharness" ], "css/css-backgrounds/parsing/border-image-source-valid.html": [ - "4dfd11f340a5c624ebdbdf991d1064f256440620", + "167d27179d796353bd61ee4996a29e67ab968e94", "testharness" ], "css/css-backgrounds/parsing/border-image-valid.html": [ - "dcd67e89a4a80500122902ac42718d88995d62d7", + "e3988ed0a877181e84328111249b7a78b8296327", "testharness" ], "css/css-backgrounds/parsing/border-image-width-invalid.html": [ - "920cca15379699b52c6bf98358275e9ad861c60b", + "3cef10313ac3252fb7ed50cd022fc2f87ca6b7fb", "testharness" ], "css/css-backgrounds/parsing/border-image-width-valid.html": [ - "03d01fa1b4210afdb925a7557a7dcb565c8fae1b", + "7896aecb410df53b28fb87459068d9b82796d7de", "testharness" ], "css/css-backgrounds/parsing/border-invalid.html": [ - "7d440d3407b30ceeadd86ff988ceed0fc15a16cd", + "ec00c0273cd847b6e6d58473984f9ee905340bb2", "testharness" ], "css/css-backgrounds/parsing/border-radius-invalid.html": [ - "6f4acda31231fe132b0c34170f325113ab2cdb57", + "ae9f2b9c241505169ced90bb6e90d9876ddead37", "testharness" ], "css/css-backgrounds/parsing/border-radius-valid-expected.txt": [ @@ -300940,41 +300967,37 @@ "support" ], "css/css-backgrounds/parsing/border-radius-valid.html": [ - "2a0b1292725876317c83cbe17550c7f3f37b02e8", + "518e936b40b2d4241207af2743acfd81cbd70b9c", "testharness" ], "css/css-backgrounds/parsing/border-style-invalid.html": [ - "439ff8f51e6049a23dc2176c0f2ea539ccdd7e69", + "8d81cc5fd209a5cb8b3b0551d0835ab5040cc0e4", "testharness" ], "css/css-backgrounds/parsing/border-style-valid.html": [ - "34986ad639f32cc55b606726f184341dfd101f73", + "a0ddaebeea9eee776ae5d5452094993c68528c85", "testharness" ], "css/css-backgrounds/parsing/border-valid.html": [ - "446db991ee8f51268ce5762a656680163e351a67", + "26557591820ddc0776d017f8379bec32599c3eb1", "testharness" ], "css/css-backgrounds/parsing/border-width-invalid.html": [ - "44d2cadf99230b809e0924329696bf07d3679850", + "88709a6fdbc8143a827fb92eea14f04a80c8cd15", "testharness" ], "css/css-backgrounds/parsing/border-width-valid.html": [ - "fc062b103669d1e10fcf88aa5ba82c50d341e66d", + "bb9d4bb0119d6aad3aaafaec920f96f0f8e4c776", "testharness" ], "css/css-backgrounds/parsing/box-shadow-invalid.html": [ - "7488f7843c2c85f377682810631b6d3a0ff64b54", + "850186fe3afdea38b9ff89b823f6dea5fc1467e8", "testharness" ], "css/css-backgrounds/parsing/box-shadow-valid.html": [ - "67fe66d643369d20f1f30d04d6ae0306be4be80b", + "f24a3f22739618190a63b837209d2830e5037f62", "testharness" ], - "css/css-backgrounds/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-backgrounds/reference/60x60-green-background.html": [ "edd089b01a18e6884de3a6b20d9a8e6931c8fd63", "support" @@ -301375,6 +301398,10 @@ "a1c18592bfbf5a598c133c23a0fbe12b195fd1ed", "support" ], + "css/css-backgrounds/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-backgrounds/support/pattern-grg-rgr-grg.png": [ "a188423017146630d9cf6c89e738b5decb7011d9", "support" @@ -301560,51 +301587,51 @@ "support" ], "css/css-box/parsing/clear-invalid.html": [ - "ee593f2639cdfb9a26edad7eb5de002e4d077850", + "a525486bafe1c57e6c5385eb03cdc2e8a00654c0", "testharness" ], "css/css-box/parsing/clear-valid.html": [ - "c7a6815b7ba52412c376fef82115b6253fe76bdb", + "0fc9b141b4bbc13de0878fb582bcaab873fdfa5f", "testharness" ], "css/css-box/parsing/float-invalid.html": [ - "dda7379c1d0a45dae405ac599c9ab6ec82bba7de", + "a34c001e26345e86e7a3ae3e20b1827fce4c6c99", "testharness" ], "css/css-box/parsing/float-valid.html": [ - "450d8e39065e1b70fef54da8f71ee4d964d0874c", + "c3a92c16a86352cf537b8b9c85e28787ea2493cf", "testharness" ], "css/css-box/parsing/height-invalid.html": [ - "1e64c2115fab346fe519e4f82d6e8cbd5eadd6df", + "8f502b45f94ea21f8d8712375ab77faf4071cf1e", "testharness" ], "css/css-box/parsing/height-valid.html": [ - "6748edae8c0116264361f1677176788751a3f5fd", + "bda0871574f2553763718d3a12c9e26de5bf5a9c", "testharness" ], "css/css-box/parsing/margin-invalid.html": [ - "02b8f1197408b5e6266e429d4e86f97aec7573ae", + "43d6f5764fa49c247f43e460e84310c0ae98bb13", "testharness" ], "css/css-box/parsing/margin-valid.html": [ - "6c63a5bf1b5d44b2429d0d1e6df6149db626c04c", + "66b5395d479faa8fdc1393f1b9f9494e832f6fc4", "testharness" ], "css/css-box/parsing/max-height-invalid.html": [ - "f5681a9b9166e6ad1e0dd9dffe6e9086d9f2aa45", + "682df6841a2eb6f0c559b80390b8967ff9429fe2", "testharness" ], "css/css-box/parsing/max-height-valid.html": [ - "39eba8c0f2cb7a928f906d2114318d02adfa931e", + "e089e6762bd52a6fd350b9e69ed02c106fb19698", "testharness" ], "css/css-box/parsing/max-width-invalid.html": [ - "79a162578c69e2894e1b5ad1e6e8157736b74c2a", + "70ee0c9e3d85f2b978a25601137142b41ce5ac8f", "testharness" ], "css/css-box/parsing/max-width-valid.html": [ - "36b408f3adcb3f511e95e99d0e222fc863793752", + "5d669dd2a78c6adea60a8ee4f122ff74982d351d", "testharness" ], "css/css-box/parsing/min-height-invalid-expected.txt": [ @@ -301612,11 +301639,11 @@ "support" ], "css/css-box/parsing/min-height-invalid.html": [ - "5dbcd534780891103b98ef2f8a7ac2e55a0e5d4c", + "9899ee024e15c408676d3ad9e735879b7c02b041", "testharness" ], "css/css-box/parsing/min-height-valid.html": [ - "7c2b05368598f29e9961ffc4b79a481ccf56e473", + "f7bdd64418801f98e6ff64495efc4b40e18632d0", "testharness" ], "css/css-box/parsing/min-width-invalid-expected.txt": [ @@ -301624,19 +301651,19 @@ "support" ], "css/css-box/parsing/min-width-invalid.html": [ - "2aec4d98131be0de37aada0d6ea22a7128eab11c", + "6e31b126e58c593fece8f43ee24904ee3c360d27", "testharness" ], "css/css-box/parsing/min-width-valid.html": [ - "c98fa942b4300deb4b53cd897c7edbf036946214", + "95c27af351d79fb8b61669319dbce0bde7ff1c66", "testharness" ], "css/css-box/parsing/overflow-invalid.html": [ - "9be5ab7e7006147705f999ff81a5bde9cd5335c9", + "3fce6ddc88a65823a27559ceaef12c7dacdf2a01", "testharness" ], "css/css-box/parsing/overflow-valid.html": [ - "03c026f82b3a915e16fd8570491c5e11f11e7bfb", + "81a7e8ae40b8e90ae7936f316c4ffd8a58b7dc39", "testharness" ], "css/css-box/parsing/padding-invalid-expected.txt": [ @@ -301644,33 +301671,33 @@ "support" ], "css/css-box/parsing/padding-invalid.html": [ - "d0cc715ad6ce1e2488bd874d9ee3eeb1a3ffaf8d", + "6dbbfa940e2530ec2c8b1028bd474abc39456b8c", "testharness" ], "css/css-box/parsing/padding-valid.html": [ - "c5d31987e637c39891d4568bbc1076714025898a", + "76a1ba0970410d38afc47e06357f4f89f1246c67", "testharness" ], - "css/css-box/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-box/parsing/visibility-invalid.html": [ - "6a6c23d644c887c81b4456b8262ca18107b4370f", + "147a4b198acd1937eb8bb5c4d86bbbc44f8e2f6a", "testharness" ], "css/css-box/parsing/visibility-valid.html": [ - "91f1bca19b97a3d7b0adffedf01110bf548e39d9", + "f02ce93d1125c8b57c3538ed4d121f08fabfeb84", "testharness" ], "css/css-box/parsing/width-invalid.html": [ - "8630f0656bd070b707cbd48ef7d0c24a183b913b", + "67003213db5c26defd9899a2449511ee65d2e87a", "testharness" ], "css/css-box/parsing/width-valid.html": [ - "2fe349753adc16ea57af2ad0759c567b6c6e83d3", + "47f22e86b2c30d3a44873a6e113639e779aee77d", "testharness" ], + "css/css-box/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-break/META.yml": [ "0aad659229987a811dbf6b4b927f5df2b86ea974", "support" @@ -301732,17 +301759,13 @@ "reftest" ], "css/css-cascade/parsing/all-invalid.html": [ - "11f578baab6ee7e35dafef3d58ce7bc7d74f29d4", + "a4c74a2e3acc8c0feadfc9b89a49f4e3e78a20c1", "testharness" ], "css/css-cascade/parsing/all-valid.html": [ - "aa6d6c986a89ba1c39bd4a6eb856acd525c5852a", + "b5f2073e51c6a5dff3e508ba8a228ddf344ad123", "testharness" ], - "css/css-cascade/parsing/support/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-cascade/reference/ref-filled-green-100px-square.xht": [ "2f6ee60666fbb65497dc8749683d66ae543bad12", "support" @@ -301751,6 +301774,10 @@ "4f041c7bdf74642a33c3f453f1bb5254e62924a3", "reftest" ], + "css/css-cascade/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-cascade/unset-val-001.html": [ "eda6d4c9908e8ac7faf2dcd53adea36c15415d51", "reftest" @@ -302008,25 +302035,21 @@ "reftest" ], "css/css-color/parsing/color-invalid.html": [ - "a716957996b6441d1bba1d6d4fa636d4368f68c5", + "b18d0032833770fcadd0305e8deedb686dd95656", "testharness" ], "css/css-color/parsing/color-valid.html": [ - "d13b776333ec9953ccfc403dfdc262ced259bd9a", + "93affab94c91a4c119144923dcc4fd88726edd4c", "testharness" ], "css/css-color/parsing/opacity-invalid.html": [ - "7ba8ffc6bbb4c27d43e9e6a11edbe52f8ca21613", + "f2356fd9e0fadddad490c7df2628379cd8e9d1d8", "testharness" ], "css/css-color/parsing/opacity-valid.html": [ - "edf3b52c29261dd0d4993f076ddd01dbe7edb805", + "e772376bf678b85a5065fe11fbad1ad99e41ccbf", "testharness" ], - "css/css-color/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-color/rebeccapurple-ref.html": [ "e089e2daad5e5db7131015bf45739e64050c6b36", "support" @@ -302099,6 +302122,10 @@ "9ab9ae45413993ead7c3beaaf34a71474ee948dd", "reftest" ], + "css/css-color/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-color/t31-color-currentColor-b-ref.html": [ "ac046cd81f1bc32809de3a8d035564505de24e90", "support" @@ -303004,7 +303031,7 @@ "reftest" ], "css/css-contain/contain-paint-cell-001.html": [ - "4e60ccfc696c774411f407da84481a45afbae7ce", + "74d89a813fb9a135c0a602ec8628b0abb509ef16", "reftest" ], "css/css-contain/contain-paint-cell-002.html": [ @@ -303084,19 +303111,19 @@ "reftest" ], "css/css-contain/contain-size-007.html": [ - "8c75bee5e46d80563532d441f6195a1e5bf455f8", + "9aa9869788238019f9e400ea8ce87c7d47c9f08b", "reftest" ], "css/css-contain/contain-size-008.html": [ - "cbe3b7b06287b828b49e992f247a4a6e00cfcc80", + "076e0c0b543967fe19c4907f548681faaba45e1f", "reftest" ], "css/css-contain/contain-size-009.html": [ - "14b67af417b6c662fbb38f6875ebb2a625923063", + "922de768cf1461fe94e1cc9583ba69b44692e9a1", "reftest" ], "css/css-contain/contain-size-010.html": [ - "efe7acae5fc908a049275c407acc26843dc89552", + "7e138ccdcd0a542eb9f6a7f3cf065c1a04373bef", "reftest" ], "css/css-contain/contain-size-011.html": [ @@ -303220,11 +303247,11 @@ "reftest" ], "css/css-contain/contain-style-counters-003.html": [ - "76497c919df7133e06622c873d4ee659f2b08d4e", + "4dfe7cf05e4e6fe4540aad55f8c90bf4a7cfb0e2", "reftest" ], "css/css-contain/contain-style-counters-004.html": [ - "9a5f6f91d00eeb0389cc05f343bc2b031736797a", + "9f60faacada9dfb3094064eb4a9d7f8164f247f8", "reftest" ], "css/css-contain/contain-style-counters-ref.html": [ @@ -303427,6 +303454,10 @@ "36d2369f9c7e3220660a4e5496c2ac2f24a60962", "support" ], + "css/css-contain/support/60x60-red.png": [ + "415b835abaaab822aab11880354296e7356bbb0a", + "support" + ], "css/css-contain/support/blue-100x100.png": [ "d0b5fff876757ee51461e45ca7485e438c357df7", "support" @@ -317028,15 +317059,15 @@ "support" ], "css/css-images/parsing/gradient-position-invalid.html": [ - "dbddb52f007c399a575f3fcd3714f037cc5c9ed1", + "42ac7a5cbda189dcd440c02978761085622c490e", "testharness" ], "css/css-images/parsing/gradient-position-valid.html": [ - "b939e0d37a56ee607a4b7b4c59721c8facabb049", + "0a556c6996e221a753721c267ddbb55e1f99d791", "testharness" ], "css/css-images/parsing/image-orientation-invalid.html": [ - "4e0fc11d78b4e9aa36d558d16e6d3740ef01d6a6", + "3d4a5419112d761d052e7065409e7f995d6b8e56", "testharness" ], "css/css-images/parsing/image-orientation-valid-expected.txt": [ @@ -317044,11 +317075,11 @@ "support" ], "css/css-images/parsing/image-orientation-valid.html": [ - "5f7c8f0abf80cb663ff4bd76cfeef5e76f5814b4", + "2dc86b236f58fa804e14d808fb23b0519e450424", "testharness" ], "css/css-images/parsing/image-rendering-invalid.html": [ - "b053afe022c8928c8c18dc4e2dbba3c7224fe8c1", + "1a0fe5a8085ac6052ef3559e9a38495f702be56a", "testharness" ], "css/css-images/parsing/image-rendering-valid-expected.txt": [ @@ -317056,11 +317087,11 @@ "support" ], "css/css-images/parsing/image-rendering-valid.html": [ - "ee2bd095839ad643e8e1fc4e9924d11ee8befc22", + "00b85ead78270ae5e955649726169f7f463d3765", "testharness" ], "css/css-images/parsing/image-resolution-invalid.html": [ - "f48b7620d2e486815c51c616ddfa211739921dd4", + "8d6e6c58a9a30e7ffda3603a3e27477602dcbebf", "testharness" ], "css/css-images/parsing/image-resolution-valid-expected.txt": [ @@ -317068,11 +317099,11 @@ "support" ], "css/css-images/parsing/image-resolution-valid.html": [ - "b5306320fe0ab963bfcd81874616d19866d9fea6", + "bc5e89adb94afb5d31c93620b1fa8eb27cecd9e6", "testharness" ], "css/css-images/parsing/object-fit-invalid.html": [ - "30ce0f8f7a0b3d71c2c9347bfff588024f3f298d", + "e26b5beeac74a107854f28b0bf0d44fdf4167a88", "testharness" ], "css/css-images/parsing/object-fit-valid-expected.txt": [ @@ -317080,21 +317111,17 @@ "support" ], "css/css-images/parsing/object-fit-valid.html": [ - "ffbe081c87d23c18001dfd1835675801bb8c7ea2", + "d77a331fa61042a205f58b46e736afaee6367988", "testharness" ], "css/css-images/parsing/object-position-invalid.html": [ - "20d721601fc3f13c6136cf01d41a9dd0372b865e", + "e84bcf78920ab4776218459a5c51f45f6a75ed41", "testharness" ], "css/css-images/parsing/object-position-valid.html": [ - "3c9d9c61b0d80d46e939349b46e222dbd35aa454", + "412c8b305039bbd6e204dc4f93140f24e3f2d8f3", "testharness" ], - "css/css-images/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-images/support/1x1-green.gif": [ "a3c674d4bdde016ea98db01141b2584c67526e4a", "support" @@ -317171,6 +317198,10 @@ "1534ce96acd740465227066407d61ec4cf4242e5", "support" ], + "css/css-images/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-images/support/pattern-grg-rgr-grg.png": [ "a188423017146630d9cf6c89e738b5decb7011d9", "support" @@ -318828,7 +318859,7 @@ "testharness" ], "css/css-masking/parsing/clip-invalid.html": [ - "81cd98170ea4abe216c0cf155aa493c58079bd53", + "843d0a6070cbcbc36c0f53895dd8d686db565060", "testharness" ], "css/css-masking/parsing/clip-path-invalid-expected.txt": [ @@ -318836,7 +318867,7 @@ "support" ], "css/css-masking/parsing/clip-path-invalid.html": [ - "791ea3c564f629ed8d679499f5483e122ad9f602", + "003da268bdfbab37e535bf4dd434a2e225334e03", "testharness" ], "css/css-masking/parsing/clip-path-valid-expected.txt": [ @@ -318844,22 +318875,22 @@ "support" ], "css/css-masking/parsing/clip-path-valid.html": [ - "4ac5715cdba374d3b702157ffce4a0a45009995a", + "5ba1faa18f49d02d54d1c437b3b653ac4e343fc1", "testharness" ], "css/css-masking/parsing/clip-rule-invalid.html": [ - "5a7673c56ae29a10133ed1395ae1e61ee2a7dd81", + "33f47c2c62dfcc2b44a94308e801ae68a27f6175", "testharness" ], "css/css-masking/parsing/clip-rule-valid.html": [ - "9236b88f0ac03139210fe6f5fd5f9fa08a613c09", + "71db94f07ef38e0828e7a9129616ec98522f6c88", "testharness" ], "css/css-masking/parsing/clip-valid.html": [ - "2630e55883c57a0a733071ad2f49b55e2bd77a59", + "3344372e1c55f453a3eebfecdd8238c15e80368f", "testharness" ], - "css/css-masking/parsing/resources/parsing-testcommon.js": [ + "css/css-masking/support/parsing-testcommon.js": [ "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", "support" ], @@ -321703,24 +321734,20 @@ "4794db47539ddd9fece83ccd6974e3d1018798a0", "testharness" ], - "css/css-shapes/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-shapes/parsing/shape-image-threshold-invalid.html": [ - "72fb606c460752043db729e7157483fd01f7ce0b", + "1c2b92b72b14db09f397ebaf62a19d215a98ea65", "testharness" ], "css/css-shapes/parsing/shape-image-threshold-valid.html": [ - "040363d13bbed463d1e5e02fea84566da39853cb", + "fc648f3cdf257f023032046b21b8a95f05e66c6b", "testharness" ], "css/css-shapes/parsing/shape-margin-invalid.html": [ - "678fe576221b82b6a85927de3337cef02f85da8d", + "b0e650ccb9ca8c85be89e28b4760f73a578df6a0", "testharness" ], "css/css-shapes/parsing/shape-margin-valid.html": [ - "bf937f106b1d6e5b15abce0971da8773777a0ac0", + "a33c7b3378cbe28dc2e760a1549d02c5cae9e82d", "testharness" ], "css/css-shapes/parsing/shape-outside-invalid-expected.txt": [ @@ -321728,11 +321755,11 @@ "support" ], "css/css-shapes/parsing/shape-outside-invalid-position.html": [ - "3b7e01bf56a8c3d8afaa600ba027502f716fddcc", + "ce563c7d8c71176110b626b08272d0251456ff1b", "testharness" ], "css/css-shapes/parsing/shape-outside-invalid.html": [ - "024c4a2789493964b162397bc994b699274e1423", + "74fec354bba0f05fed22cd364f88d561e22939a6", "testharness" ], "css/css-shapes/parsing/shape-outside-valid-expected.txt": [ @@ -321740,11 +321767,11 @@ "support" ], "css/css-shapes/parsing/shape-outside-valid-position.html": [ - "be19a2491b17f77d9dfda2fe03f6f099d7fe7d9b", + "4243aa4524d83cd4e8e68d83a1c90a9c3b5beaf2", "testharness" ], "css/css-shapes/parsing/shape-outside-valid.html": [ - "5b90c13064455cff16f5a4d54a6343c76775f3cc", + "a9d310c3ec092b9bf4a643c7a40c83312d45965b", "testharness" ], "css/css-shapes/shape-outside-invalid-001.html": [ @@ -322879,6 +322906,10 @@ "461fd17b274662b88500cdf42bab7f3b79e6019d", "support" ], + "css/css-shapes/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-shapes/support/pattern-grg-rgr-grg.png": [ "cfb6ecc271c296c69b133a81f350a777b608bea4", "support" @@ -329452,35 +329483,31 @@ "reftest" ], "css/css-transforms/parsing/perspective-origin-parsing-invalid.html": [ - "90c8004a65f712acfeb60368bdda84fc85952567", + "d78013d92e0c59a501851007a2bc01425514406c", "testharness" ], "css/css-transforms/parsing/perspective-origin-parsing-valid.html": [ - "4849602a7ede7e6a9390092525dfcaec42ef9c7f", + "7ad2cfca26debf226bf83eb0be9bc07c2210ef88", "testharness" ], - "css/css-transforms/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-transforms/parsing/rotate-parsing-invalid.html": [ - "26d442d2a05466304913d60e5494bd8a24f005a2", + "4e1c0cbdbe6ad5af8adacf5be25da0553352a9ae", "testharness" ], "css/css-transforms/parsing/rotate-parsing-valid.html": [ - "8109d4cc91eb242f108b8bbb193d7b6c71507d90", + "9821b657c419ff4de15b3383b3e1c5d5dc659813", "testharness" ], "css/css-transforms/parsing/scale-parsing-invalid.html": [ - "947aa8e51a396dcbd3e88c66d82b8b6efb9a58a7", + "c87eb1edbeff6e3874014b1f866bf4c0ae280f11", "testharness" ], "css/css-transforms/parsing/scale-parsing-valid.html": [ - "b715fd67ba6e2aa0d0bddd7c0342c80af1f70690", + "1131559e96497b69533a86eb166f346a7de12e69", "testharness" ], "css/css-transforms/parsing/transform-box-invalid.html": [ - "68bba0550ce8a7a2439ff750f5f570b3bb8745ca", + "309c5b0d1c47c13290346d69a21a48ce6499ea3d", "testharness" ], "css/css-transforms/parsing/transform-box-valid-expected.txt": [ @@ -329488,31 +329515,31 @@ "support" ], "css/css-transforms/parsing/transform-box-valid.html": [ - "ec155f1a87f57f6b21803816fd4fd740bb88295a", + "bc746f3a3029018d7c785a4867ba38aa7857bfcd", "testharness" ], "css/css-transforms/parsing/transform-invalid.html": [ - "1fef3227ea79618e5ce262c9052ef323515e7ae9", + "c18905ea47d5f557dfa69c2db4ba128913bf635e", "testharness" ], "css/css-transforms/parsing/transform-origin-invalid.html": [ - "ef7189aed47a3425cb8ac99792f0be5a14187fdd", + "c945407b321a52ec4c7b345449c1b64f0bca5089", "testharness" ], "css/css-transforms/parsing/transform-origin-valid.html": [ - "dad6cd0f561a7c786b71be7acec320f41475ea8f", + "9c8731e1c34623d04bd1d1faf756e34b05a5b92c", "testharness" ], "css/css-transforms/parsing/transform-valid.html": [ - "81df9ceb4a0205b2bb6a0a8d63397d94d591814e", + "5195dccfd6d8dc87e05c8244d9191ff6fcfd6009", "testharness" ], "css/css-transforms/parsing/translate-parsing-invalid.html": [ - "1f4abad86af0f7be1ccafe8892c8a0a34b4e41b4", + "719ff1aace0a31b501ffea18ea588a20b095c17d", "testharness" ], "css/css-transforms/parsing/translate-parsing-valid.html": [ - "f1da23d979a48dd71fab4feb3bc6c9abdc6a9111", + "57b3f972632a2e879a44232d2212ddebac571a0f", "testharness" ], "css/css-transforms/patternTransform/reference/svg-patternTransform-combination-ref.html": [ @@ -330775,6 +330802,10 @@ "0f2b9133fcfa22d5506a5cee307bd1a4d50e87e9", "support" ], + "css/css-transforms/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-transforms/support/pattern-grg-rgr-grg.png": [ "cfb6ecc271c296c69b133a81f350a777b608bea4", "support" @@ -337128,35 +337159,35 @@ "reftest" ], "css/css-ui/parsing/box-sizing-invalid.html": [ - "d6c0f262fc9194e92627062a02db9bc2300976f5", + "91212bdd89b4af7f83a5a71c6e5f31d04e53e37b", "testharness" ], "css/css-ui/parsing/box-sizing-valid.html": [ - "cdea435ef74fdb66bc9b480bd23771f918da6db0", + "9f83bb250960ec8fcb82e9d1e775a4d80491ef89", "testharness" ], "css/css-ui/parsing/caret-color-invalid.html": [ - "d094b012b055649557e2db27c4a41084b5504ff4", + "c8a550ebd557c4867208dd65ea62aa580ba7b4da", "testharness" ], "css/css-ui/parsing/caret-color-valid.html": [ - "9499e106fbc910331750f1580e296feb141caa39", + "44f7877877c7b3e93f9b24fd13761bfc0a4af420", "testharness" ], "css/css-ui/parsing/cursor-invalid.html": [ - "34a18b4943bc71be6e4537800cae3bfed0b924a0", + "23b17a366f32d1ca77ba64c11e2d8a76af642046", "testharness" ], "css/css-ui/parsing/cursor-valid.html": [ - "2cc358e954aaa33bcf87ae410e3d65ee672ace17", + "f18247b697c87ef1b75528969f8b02ac3d797373", "testharness" ], "css/css-ui/parsing/outline-color-invalid.html": [ - "edf914872ef9267b25ec2ab9a0f1c58159341694", + "8954dc4aa97fd2fb331ef6411dff35d651b170a2", "testharness" ], "css/css-ui/parsing/outline-color-valid-mandatory.html": [ - "dd895036c95d84f9c9d6f7632eafd9a1b7aecb8d", + "601f843385ba1c564a673b54977729109e4e8929", "testharness" ], "css/css-ui/parsing/outline-color-valid-optional-expected.txt": [ @@ -337164,31 +337195,31 @@ "support" ], "css/css-ui/parsing/outline-color-valid-optional.html": [ - "f77a0c9af4c627fbf59e2c55b4bcc3dfb49b9771", + "b9421c2a1940bdde0488ea63506c3a50dce8a4bb", "testharness" ], "css/css-ui/parsing/outline-invalid.html": [ - "8ba3081d8628a487310c9d7acda70c6c76158857", + "2ea8071b689e946c28e319e14335cfc430da9c98", "testharness" ], "css/css-ui/parsing/outline-offset-invalid.html": [ - "e1587c0a9fefe8eeec8325ed6bb2b7c2d6b4428c", + "9680adc54693707d128526ec5632d75f27873174", "testharness" ], "css/css-ui/parsing/outline-offset-valid.html": [ - "361108b768a172752c85f4b2794a511d464e745e", + "42c103c14b7306df980bb01084397efeb81f2356", "testharness" ], "css/css-ui/parsing/outline-style-invalid.html": [ - "14ca6f72222fbb551b85cef7c8c5d9da3788c139", + "d1a72c085c10fb3c98dd51943a791dc5b3a390e5", "testharness" ], "css/css-ui/parsing/outline-style-valid.html": [ - "74997c2c984b523229f4f68e534aeb6e2b2725d9", + "f922b1ee8c5b882bb8b4ca6bdcd56ed55cfb1c2c", "testharness" ], "css/css-ui/parsing/outline-valid-mandatory.html": [ - "647d29a5fdd7b352a2d1fbbfa4bb0436e2eaa784", + "c7c5de9703704912ec38702787c331549551bc35", "testharness" ], "css/css-ui/parsing/outline-valid-optional-expected.txt": [ @@ -337196,15 +337227,15 @@ "support" ], "css/css-ui/parsing/outline-valid-optional.html": [ - "9fc8bd366735dd05cc37c1497c7aed6a91e32630", + "b6f0b8505f571b6b4628226658964e39662f2a3a", "testharness" ], "css/css-ui/parsing/outline-width-invalid.html": [ - "0403c9910c17f76da0e834d2c9263898b405d049", + "119ff27e5d61f8b7db0f91f501cbb6acfa0b6b19", "testharness" ], "css/css-ui/parsing/outline-width-valid.html": [ - "b902d6da35d6dac8d0e08fe99760434294311263", + "6b8d9eabed51a3319488546ef222df2537fc4915", "testharness" ], "css/css-ui/parsing/resize-invalid-expected.txt": [ @@ -337212,23 +337243,19 @@ "support" ], "css/css-ui/parsing/resize-invalid.html": [ - "fd6f661bc65d483cf2136d4d889f3778d5012ddf", + "74bc0000914be7fcc6b3cb5404f89c76e97da580", "testharness" ], "css/css-ui/parsing/resize-valid.html": [ - "70bff9554807d01fdf39b1c8566a24ea864aca58", + "ddb656b18f00261568cacbcf62f9210dc77c33af", "testharness" ], - "css/css-ui/parsing/support/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-ui/parsing/text-overflow-invalid.html": [ - "d0cf5f82994d7004d27a57adf9caa8981220847a", + "aebacb698bb17b17f0a51d4095c08208e3fe8c3a", "testharness" ], "css/css-ui/parsing/text-overflow-valid.html": [ - "cb1d4d0815d3e7b55c5adf33dae95cedcdcf75ae", + "346327fa81d2e901ed54fe392613e629b969fff1", "testharness" ], "css/css-ui/reference/box-sizing-001-ref.html": [ @@ -338343,6 +338370,10 @@ "2d1dffcb42c54326795ed90700d23b7347a1644b", "support" ], + "css/css-ui/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-ui/support/r1-1.svg": [ "e2eb4fc2608d74be2156eccb5ea5a22866e6eb66", "support" @@ -342336,47 +342367,43 @@ "manual" ], "css/css-writing-modes/parsing/direction-invalid.html": [ - "9f1076e0da9353816521cf34646981c33d82badb", + "55854fea8066c35fd49d696f65260b9858188c91", "testharness" ], "css/css-writing-modes/parsing/direction-valid.html": [ - "c68d1dd7d9c2eef8d95c9c90c697a61125dd47b0", + "6f449f30daaf83a278f96712bfa0b1f150486fc8", "testharness" ], - "css/css-writing-modes/parsing/resources/parsing-testcommon.js": [ - "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", - "support" - ], "css/css-writing-modes/parsing/text-combine-upright-invalid.html": [ - "21ca5f024035630875f14a5f45b165548333733f", + "2de45e56c869f2b6fe895fb0d710b0a13a0231a0", "testharness" ], "css/css-writing-modes/parsing/text-combine-upright-valid.html": [ - "680c92d6c12a38ec1f5689a5c2b9969041ee3672", + "bb63c4b138a9efc722aab0fbd1a7d7d9a5fb4f89", "testharness" ], "css/css-writing-modes/parsing/text-orientation-invalid.html": [ - "cb38e4ab395dfabc99813ee8459ebaae4d79e2d0", + "3f899d90b2472b8f810122aad99b87dc23ee422b", "testharness" ], "css/css-writing-modes/parsing/text-orientation-valid.html": [ - "d047527d687a9b240e27e835de0fb8786189e399", + "4074e225c6a83957f4868447d273c2d1c984bcaf", "testharness" ], "css/css-writing-modes/parsing/unicode-bidi-invalid.html": [ - "911e697b065db6e6f7b6e563e84601cf176eb99e", + "47b7438410682c8700d87bfaad0b6b3392043ed0", "testharness" ], "css/css-writing-modes/parsing/unicode-bidi-valid.html": [ - "21c01cd648f6b465fdb46d85a9d247882ca14317", + "9f13594ea5418b2a0f694e2910570f02ff9179e9", "testharness" ], "css/css-writing-modes/parsing/writing-mode-invalid.html": [ - "d41cb214ab942064e064191c7db41b9b5dff1674", + "0421ed85ebe114c69c779f19d4a74efc517f6455", "testharness" ], "css/css-writing-modes/parsing/writing-mode-valid.html": [ - "fa0a2060cda483bf479203069ad53432a4a36b36", + "27ef098727b829d7501d8c8cdc03b83a4bdae7bb", "testharness" ], "css/css-writing-modes/percent-margin-vlr-003.xht": [ @@ -344223,6 +344250,10 @@ "5f13e5aca395d012e50c015a5bbd49f9c0580cc9", "support" ], + "css/css-writing-modes/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/css-writing-modes/support/pass-cdts-abs-pos-non-replaced.png": [ "3df751f05481d199c1f076ddfbf76d6c879d04f9", "support" @@ -346116,7 +346147,7 @@ "testharness" ], "css/cssom/interfaces-expected.txt": [ - "fbc192e786f1038e31e73b4b32ffbb5f9161d726", + "d2be1b05dc5c0da95a73e98d4baa5b18e82d1dd5", "support" ], "css/cssom/interfaces.html": [ @@ -346816,31 +346847,31 @@ "testharness" ], "css/motion/parsing/offset-anchor-parsing-invalid.html": [ - "b48194c7ee35af7d114fd514f060ea9e8aae6372", + "263bf5e90e97feaffcda56964574da86efe46eb5", "testharness" ], "css/motion/parsing/offset-anchor-parsing-valid.html": [ - "f3408e205ea2e2f91c40a35bb68cd18535889e5e", + "b6fd4cd481caa76c8403c25f8ae1dce8480e67db", "testharness" ], "css/motion/parsing/offset-distance-parsing-invalid.html": [ - "93fa55e813b8fd82a11c1c70e331f07e2ef8ff8c", + "308594cce0d302e136f7f7b80d46348af3453f5e", "testharness" ], "css/motion/parsing/offset-distance-parsing-valid.html": [ - "cfd7f351c6e3721c28d5b4992be02d5f1f86fcb6", + "fd2b7b7e4fdadebc23f8d3e5ce53005420fafa71", "testharness" ], "css/motion/parsing/offset-parsing-invalid.html": [ - "34fdad4a9791aaf30687b070830a5b34934bcda5", + "9d4860437250fb09dcc136bbf0b24ab3a29a26f2", "testharness" ], "css/motion/parsing/offset-parsing-valid.html": [ - "2ec82b84908d897abb22ae366a0c1bbb0847d466", + "2f26a4a2a5faeb3e8a373c06c75dffe48f1495ca", "testharness" ], "css/motion/parsing/offset-path-parsing-invalid.html": [ - "5a37548528ea4d633f17b9a3215f9e6a30ce617c", + "c7117b65de8ab65e5b6be8b5627d978967aea388", "testharness" ], "css/motion/parsing/offset-path-parsing-valid-expected.txt": [ @@ -346848,26 +346879,26 @@ "support" ], "css/motion/parsing/offset-path-parsing-valid.html": [ - "dad552eff4cbb61796c2b7954e4dbf2fdce96324", + "d9645d0fde91ac72bd3d458657007227a31cabfd", "testharness" ], "css/motion/parsing/offset-position-parsing-invalid.html": [ - "9a6a5cef379e2f81ae6b48662a83c6bd88bfc259", + "001c8be1b7f575afed7c6f4efd02f805c363b691", "testharness" ], "css/motion/parsing/offset-position-parsing-valid.html": [ - "878ef0365545f1ee0efcbd4ded1ec3dcda2c7543", + "af243639080a9fb1d799e0c4c3cd20c62a200dd5", "testharness" ], "css/motion/parsing/offset-rotate-parsing-invalid.html": [ - "36cebf21d27913e201a445cee732ed7bf6152b30", + "a067b00431936295f581e8cffbaf55784298d574", "testharness" ], "css/motion/parsing/offset-rotate-parsing-valid.html": [ - "8712c429bf7f7f2e3d16e3548edd7eddc6ae3e7d", + "3c44d3ea8fd225c04fce312c192713be14e8c99a", "testharness" ], - "css/motion/parsing/resources/parsing-testcommon.js": [ + "css/motion/support/parsing-testcommon.js": [ "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", "support" ], @@ -348679,6 +348710,14 @@ "0d6e67589dab95d5362f82a99565947ebb487658", "reftest" ], + "css/selectors/scope-selector-expected.txt": [ + "be13c85a53442101b51b03b0989311279c36337f", + "support" + ], + "css/selectors/scope-selector.html": [ + "482d05bf80ae7c23b7756fa7ba81723c34f2a73f", + "testharness" + ], "css/selectors/scope-without-scoping.html": [ "f70b8d60543c5a28fcf955b1780f15c03d60991a", "reftest" @@ -348927,6 +348966,10 @@ "0f2b9133fcfa22d5506a5cee307bd1a4d50e87e9", "support" ], + "css/support/parsing-testcommon.js": [ + "14f32b772f27a9bc75fe90e2ea1d8e4fb3649e95", + "support" + ], "css/support/pattern-grg-rgr-grg.png": [ "cfb6ecc271c296c69b133a81f350a777b608bea4", "support" @@ -382084,7 +382127,7 @@ "support" ], "interfaces/web-animations.idl": [ - "6e18ebf1500c5caf090f01b2b01a7857bef4596e", + "7419072a4a5581a5e6fdf590a115ff85434a1259", "support" ], "interfaces/web-bluetooth.idl": [ @@ -403776,7 +403819,7 @@ "testharness" ], "service-workers/service-worker/active.https.html": [ - "974fc8372db8f06f87919d35be48f922166d6652", + "11d84091126171e97f837ea994bea7df20ee64fa", "testharness" ], "service-workers/service-worker/appcache-ordering-main.https.html": [ @@ -404184,7 +404227,7 @@ "testharness" ], "service-workers/service-worker/installing.https.html": [ - "dda1a1967e6e0be64b9bd2198a08aa0429e185ff", + "528d2a688602df854a259d723e95c66a4e3147dc", "testharness" ], "service-workers/service-worker/interfaces-sw.https-expected.txt": [ @@ -404291,6 +404334,10 @@ "18c163e36d5eb7d9dc2cdfe748b0c25783d729ab", "testharness" ], + "service-workers/service-worker/navigation-preload/navigationPreload.https.html": [ + "ea1d166a69e86ce6b9ee9aef3ebbc7a2a09751d0", + "testharness" + ], "service-workers/service-worker/navigation-preload/redirect.https.html": [ "461d4eb6e4a7e707ca9963ff94831e7a9235fce3", "testharness" @@ -405676,7 +405723,7 @@ "testharness" ], "service-workers/service-worker/serviceworkerobject-scripturl.https.html": [ - "a22a00bc791201302ce62f53a4980a4db7d41de1", + "36f51a48e70c846d9873e758db7c202babf71234", "testharness" ], "service-workers/service-worker/shared-worker-controlled.https.html": [ @@ -405776,7 +405823,7 @@ "testharness" ], "service-workers/service-worker/waiting.https.html": [ - "7f891059dd421274db18967fd570abb3b1a90285", + "57af2cfd4921614cd26650dd02ffed1920a7c9e9", "testharness" ], "service-workers/service-worker/websocket-in-service-worker.https.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any-expected.txt index 0ea3fdf9..d492664 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any-expected.txt
@@ -22,7 +22,7 @@ PASS BackgroundFetchRegistration interface: attribute uploaded PASS BackgroundFetchRegistration interface: attribute downloadTotal PASS BackgroundFetchRegistration interface: attribute downloaded -FAIL BackgroundFetchRegistration interface: attribute state assert_true: The prototype object must have a property "state" expected true got false +PASS BackgroundFetchRegistration interface: attribute state FAIL BackgroundFetchRegistration interface: attribute failureReason assert_true: The prototype object must have a property "failureReason" expected true got false PASS BackgroundFetchRegistration interface: attribute onprogress PASS BackgroundFetchRegistration interface: operation abort()
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.sharedworker-expected.txt index c4caab2..301f96e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.sharedworker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.sharedworker-expected.txt
@@ -22,7 +22,7 @@ PASS BackgroundFetchRegistration interface: attribute uploaded PASS BackgroundFetchRegistration interface: attribute downloadTotal PASS BackgroundFetchRegistration interface: attribute downloaded -FAIL BackgroundFetchRegistration interface: attribute state assert_true: The prototype object must have a property "state" expected true got false +PASS BackgroundFetchRegistration interface: attribute state FAIL BackgroundFetchRegistration interface: attribute failureReason assert_true: The prototype object must have a property "failureReason" expected true got false PASS BackgroundFetchRegistration interface: attribute onprogress PASS BackgroundFetchRegistration interface: operation abort()
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.worker-expected.txt index c4caab2..301f96e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/idlharness.https.any.worker-expected.txt
@@ -22,7 +22,7 @@ PASS BackgroundFetchRegistration interface: attribute uploaded PASS BackgroundFetchRegistration interface: attribute downloadTotal PASS BackgroundFetchRegistration interface: attribute downloaded -FAIL BackgroundFetchRegistration interface: attribute state assert_true: The prototype object must have a property "state" expected true got false +PASS BackgroundFetchRegistration interface: attribute state FAIL BackgroundFetchRegistration interface: attribute failureReason assert_true: The prototype object must have a property "failureReason" expected true got false PASS BackgroundFetchRegistration interface: attribute onprogress PASS BackgroundFetchRegistration interface: operation abort()
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/box-shadow-syntax-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/box-shadow-syntax-001.html index e7c83b3ec2..4b8f186 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/box-shadow-syntax-001.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/box-shadow-syntax-001.html
@@ -5,7 +5,7 @@ <meta name="assert" content="Box shadow color, inset, and length parameters can be mixed in any order, but lengths must stay adjacent." /> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="parsing/resources/parsing-testcommon.js"></script> +<script src="support/parsing-testcommon.js"></script> <script> // color only test_valid_value("box-shadow", "4px 4px green", "green 4px 4px");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-invalid.html index e4924a2..0af7394 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-attachment supports only the grammar '<attachment>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-valid.html index 4c7243f..9a0f2409 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-attachment-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-attachment supports the full grammar '<attachment>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-invalid.html index 50647e8..50b887e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-clip supports only the grammar '<box>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-valid.html index 2b6bd49..27783152 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-clip-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-clip supports the full grammar '<box>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-invalid.html index cc31e26..ff90dff 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-color supports only the grammar '<color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-valid.html index d7a5d967..b84e13f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-color-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-color supports the full grammar '<color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-invalid.html index a5f2a90..12103e01 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-image supports only the grammar '<bg-image>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-valid.html index 873800f..601efb6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-image-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-image supports the full grammar '<bg-image>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-invalid.html index adc178b..19f5d965 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background supports only the grammar '<bg-layer># , <final-bg-layer>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-invalid.html index 5458925..1ef2d9f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-origin supports only the grammar '<box>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-valid.html index ff52126..bbd59d3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-origin-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-origin supports the full grammar '<box>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-invalid.html index 5ddf5e0..9a3e9cb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-position supports only the grammar '<bg-position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-valid.html index 836f348..371bc7a3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-position-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-position supports the full grammar '<bg-position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-invalid.html index a32f508..55229a7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-repeat supports only the grammar '<repeat-style>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-valid.html index 7554909..3a00b19 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-repeat-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-repeat supports the full grammar '<repeat-style>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-invalid.html index 7259cbd..7497f43 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-size supports only the grammar '<bg-size>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-valid.html index 6703164..71d6069 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background-size supports the full grammar '<bg-size>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-valid.html index 29737e20..39c4672f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="background supports the full grammar '<bg-layer># , <final-bg-layer>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-invalid.html index 5c63d8b..67248dd6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-color supports only the grammar '<color>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-valid.html index 6ee147c7..c69f9622 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-color-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-color supports the full grammar '<color>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-invalid.html index 762be9a..87194a5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image supports only the grammar ' <‘border-image-source’> || <‘border-image-slice’> [ / <‘border-image-width’> | / <‘border-image-width’>? / <‘border-image-outset’> ]? || <‘border-image-repeat’>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-invalid.html index ffe0959..5e76198 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-outset supports only the grammar '[ <length> | <number> ]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-valid.html index dc18937..5ead260 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-outset-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-outset supports the full grammar '[ <length> | <number> ]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-invalid.html index b17b531dd..0a70aab 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-repeat supports only the grammar '[ stretch | repeat | round | space ]{1,2}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-valid.html index 6e13dc85..e77ae48fd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-repeat-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-repeat supports the full grammar '[ stretch | repeat | round | space ]{1,2}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-invalid.html index 7bdb67f6..b2f55f14f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-slice supports only the grammar '[<number> | <percentage>]{1,4} && fill?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-valid.html index 257f276..66d747f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-slice-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-slice supports the full grammar '[<number> | <percentage>]{1,4} && fill?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-invalid.html index 99a06ce..78d042d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-source supports only the grammar 'none | <image>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-valid.html index e12cb92..c032dcd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-source-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-source supports the full grammar 'none | <image>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-valid.html index 79bff45..880dc87 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image supports the full grammar ' <‘border-image-source’> || <‘border-image-slice’> [ / <‘border-image-width’> | / <‘border-image-width’>? / <‘border-image-outset’> ]? || <‘border-image-repeat’>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-invalid.html index f85e947..c7fba1c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-width supports only the grammar '[ <length-percentage> | <number> | auto ]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-valid.html index 503f2374..5917c7f6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-image-width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-image-width supports the full grammar '[ <length-percentage> | <number> | auto ]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-invalid.html index f59f249..baaa66c3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-width supports only the grammar '<line-width> || <line-style> || <color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-invalid.html index a8afbbe9..28460aa 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-radius supports only the grammar '<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-valid.html index cd6fa491..96cdf201 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-radius-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-radius supports the full grammar '<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-invalid.html index 47e54224..ecc9d6b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-style supports only the grammar '<line-style>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-valid.html index 0779854..dc8311b1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-style-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-style supports the full grammar '<line-style>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-valid.html index 5f29f6b..e94938a3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-width supports the full grammar '<line-width> || <line-style> || <color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-invalid.html index ff90837..85a3414 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-width supports only the grammar '<line-width>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-valid.html index b98a2082..00dc1c0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/border-width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="border-width supports the full grammar '<line-width>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-invalid.html index fa007373..1bcfc694 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="box-shadow supports only the grammar 'none | <shadow>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-valid.html index 4ea289b7..29bb263b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/box-shadow-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="box-shadow supports the full grammar 'none | <shadow>#'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-invalid.html index 6c2980cc..a91e61f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clear supports only the grammar 'none | left | right | both'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-valid.html index 59b68f1..db0b5aa0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/clear-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clear supports the full grammar 'none | left | right | both'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-invalid.html index f20183f..0ff53be3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="float supports only the grammar 'left | right | top | bottom | start | end | none | <page-floats>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-valid.html index be91602a..aecbd99 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/float-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="float supports the full grammar 'left | right | top | bottom | start | end | none | <page-floats>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-invalid.html index 120cce6f..acc595f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="height supports only the grammar '[<length> | <percentage>] | available | min-content | max-content | fit-content | complex | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-valid.html index 9b3df67c..38f76ea 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/height-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="height supports the full grammar '[<length> | <percentage>] | available | min-content | max-content | fit-content | complex | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-invalid.html index d28c482..9c21749 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="margin supports only the grammar '[ <length> | <percentage> | auto]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-valid.html index 9986222e..fc14af2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/margin-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="margin supports the full grammar '[ <length> | <percentage> | auto]{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-invalid.html index 9f37619..9b8e72d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="max-height supports only the grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-valid.html index 846eb1d..35ad18ab 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-height-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="max-height supports the full grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-invalid.html index 32f51ef..487d15e6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="max-width supports only the grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-valid.html index 73e17591..95b2ae9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/max-width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="max-width supports the full grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-invalid.html index 846d188..a35ac3f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="min-height supports only the grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-valid.html index 7286670..1a2b838 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-height-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="min-height supports the full grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-invalid.html index e6998b0..2a29090 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="min-width supports only the grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-valid.html index 5440b87..ebe9ee7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/min-width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="min-width supports the full grammar '[ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-invalid.html index dd97b982..da09e64 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="overflow supports only the grammar '[ visible | hidden | scroll | auto | no-display | no-content ]{1,2}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-valid.html index d4411c8..898d760 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/overflow-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="overflow supports the full grammar '[ visible | hidden | scroll | auto | no-display | no-content ]{1,2}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-invalid.html index 54bfc69..7a83d75a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="padding supports only the grammar '<length>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-valid.html index f3cda52..33522ba 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/padding-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="padding supports the full grammar '<length>{1,4}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-invalid.html index 3905069..07fe6eb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="visibility supports only the grammar 'visible | hidden | collapse'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-valid.html index fbff1f0..de1cb9b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/visibility-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="visibility supports the full grammar 'visible | hidden | collapse'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-invalid.html index f573ba2c..defd7d27 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="width supports only the grammar '[<length> | <percentage>] | available | min-content | max-content | fit-content | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-valid.html index 7ae55ccb..f4be6b2b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/parsing/width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="width supports the full grammar '[<length> | <percentage>] | available | min-content | max-content | fit-content | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-box/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-box/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-invalid.html index 8b7c044a..526f9fd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="all supports only the grammar 'initial | inherit | unset'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-valid.html index 668a6c2..42baa25 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/all-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="all supports the full grammar 'initial | inherit | unset'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/support/parsing-testcommon.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/parsing/support/parsing-testcommon.js rename to third_party/WebKit/LayoutTests/external/wpt/css/css-cascade/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-invalid.html index 978eb895..ec59e0fb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="color supports only the grammar '<color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-valid.html index e94eb38..ee5948e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/color-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="color supports the full grammar '<color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-invalid.html index 955903ff..7e64036eb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="opacity supports only the grammar '<alphavalue>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-valid.html index 738c3d0..bf22b09 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/opacity-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="opacity supports the full grammar '<alphavalue>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-color/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-color/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-color/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-paint-cell-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-paint-cell-001.html index 964f33a..d66a1694 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-paint-cell-001.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-paint-cell-001.html
@@ -5,7 +5,7 @@ <title>CSS Containment Test: 'contain: paint' applies to 'table-cell' elements</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-layout"> + <link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-paint"> <link rel="match" href="reference/contain-paint-047-ref.html"> <meta content="This test checks that the paint containment applies to table-cell elements. Therefore the content of the table-cell element should be clipped to the padding edge of its principal box." name="assert">
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-007.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-007.html index 71e61af..4d4bce8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-007.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-007.html
@@ -3,15 +3,19 @@ <title>CSS Containment Test: Size containment on table-row-group</title> <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> <link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size"> -<link rel="match" href="../reference/pass_if_pass_below.html"> +<link rel="match" href="reference/pass_if_pass_below_clipped.html"> <meta name=assert content="Size containment doesn't apply to table-row-group elements."> <style> div { display: table-row-group; contain: size; +} +section { overflow: hidden; } </style> <p>Test passes if there is the word "PASS" below.</p> +<section> <div>PASS</div> +<section>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-008.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-008.html index fb7b525..63deea8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-008.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-008.html
@@ -3,15 +3,19 @@ <title>CSS Containment Test: Size containment on table-header-group</title> <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> <link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size"> -<link rel="match" href="../reference/pass_if_pass_below.html"> +<link rel="match" href="reference/pass_if_pass_below_clipped.html"> <meta name=assert content="Size containment doesn't apply to table-header-group elements."> <style> div { display: table-header-group; contain: size; +} +section { overflow: hidden; } </style> <p>Test passes if there is the word "PASS" below.</p> +<section> <div>PASS</div> +</section>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-009.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-009.html index 4b080c4..a285d5e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-009.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-009.html
@@ -3,15 +3,19 @@ <title>CSS Containment Test: Size containment on table-footer-group</title> <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> <link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size"> -<link rel="match" href="../reference/pass_if_pass_below.html"> +<link rel="match" href="reference/pass_if_pass_below_clipped.html"> <meta name=assert content="Size containment doesn't apply to table-footer-group elements."> <style> div { display: table-footer-group; contain: size; +} +section { overflow: hidden; } </style> <p>Test passes if there is the word "PASS" below.</p> +<section> <div>PASS</div> +</section>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-010.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-010.html index 59fdb8b..0061894 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-010.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-size-010.html
@@ -3,15 +3,19 @@ <title>CSS Containment Test: Size containment on table-row</title> <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> <link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size"> -<link rel="match" href="../reference/pass_if_pass_below.html"> +<link rel="match" href="reference/pass_if_pass_below_clipped.html"> <meta name=assert content="Size containment doesn't apply to table-row elements."> <style> div { display: table-row; contain: size; +} +section { overflow: hidden; } </style> <p>Test passes if there is the word "PASS" below.</p> +<section> <div>PASS</div> +</section>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-003.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-003.html index d99f139..b550f11 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-003.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-003.html
@@ -40,7 +40,7 @@ This increments the counter identified as "counter-of-span" of the step value of 4 (an entirely arbitrary number) each and every time there is a <span> descendant within the subtree - of div#test + of body */ div
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-004.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-004.html index 1e751d15..e0e0528 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-004.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/contain-style-counters-004.html
@@ -40,7 +40,7 @@ This increments the counter identified as "counter-of-span" of the step value of 5 (an entirely arbitrary number) each and every time there is a <span> descendant within the subtree - of div#test + of body */ div
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/support/60x60-red.png b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/support/60x60-red.png new file mode 100644 index 0000000..823f125 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-contain/support/60x60-red.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-invalid.html index 7a63648..f224263 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="gradient positions support only the '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-valid.html index 6eae484..04ca328d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/gradient-position-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="gradient positions support the full '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-invalid.html index c16c7bd9..a55e335 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-orientation supports only the grammar 'from-image | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-valid.html index d2d24ba..c1e2015 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-orientation-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-orientation supports the full grammar 'from-image | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-invalid.html index 84b0727..1ce1a232 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-rendering supports only the grammar 'auto | smooth | high-quality | crisp-edges | pixelated'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-valid.html index 80ea1c44..1918a247 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-rendering-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-rendering supports the full grammar 'auto | smooth | high-quality | crisp-edges | pixelated'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-invalid.html index 332ad15..d0998cc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-resolution supports only the grammar '[ from-image || <resolution> ] && snap?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-valid.html index 9317902..6ee676f4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/image-resolution-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="image-resolution supports the full grammar '[ from-image || <resolution> ] && snap?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-invalid.html index e4a298b..26841d4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="object-fit supports only the grammar 'fill | none | [contain | cover] || scale-down'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-valid.html index 0f73cfe2..50ea725 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-fit-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="object-fit supports the full grammar 'fill | none | [contain | cover] || scale-down'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-invalid.html index 87de7b92..d722f1a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="object-position supports only the '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-valid.html index f78f67e..7121cc42 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/object-position-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="object-position supports the full '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-images/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-invalid.html index 68b67c9..91939637 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip supports only the grammar 'rect() | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-invalid.html index 3f5940a5f..881cbc08 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip-path supports only the grammar '<clip-source> | [ <basic-shape> || <geometry-box> ] | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-valid.html index d7b27859..fef14c9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-path-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip-path supports the full grammar '<clip-source> | [ <basic-shape> || <geometry-box> ] | none'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-invalid.html index 10f6aee..50694703 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip-rule supports only the grammar 'nonzero | evenodd'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-valid.html index db22680..ca805e1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-rule-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip-rule supports the full grammar 'nonzero | evenodd'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-valid.html index 34a24ea..95c31f7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/clip-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="clip supports the full grammar 'rect() | auto'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/support/parsing-testcommon.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js rename to third_party/WebKit/LayoutTests/external/wpt/css/css-masking/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-invalid.html index e3871d8..dcabbe6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-image-threshold supports only the grammar '<number>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-valid.html index 5b77db8..0a71e75 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-image-threshold-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-image-threshold supports the full grammar '<number>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-invalid.html index 4f3b4f2..ebb1938d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-margin supports only the grammar '<length> | <percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-valid.html index 68634b6..f36a8eb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-margin-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-margin supports the full grammar '<length> | <percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid-position.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid-position.html index 7d2b64b..90023ae 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid-position.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid-position.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-outside positions support only the '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid.html index 9f541cf..a2a8923 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-outside supports only the grammar 'none | [ <basic-shape> || <shape-box> ] | <image>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid-position.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid-position.html index ca01b352..225b015 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid-position.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid-position.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-outside positions support the full '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid.html index ae0e0bf..28f45353 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/parsing/shape-outside-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="shape-outside supports the full grammar 'none | [ <basic-shape> || <shape-box> ] | <image>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-invalid.html index 09f2f47..75350cc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="perspective-origin supports only the '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-valid.html index 8421376..b53a34a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/perspective-origin-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="perspective-origin supports the full '<position>' grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html index 8326db3..63a74e2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="rotate supports only the grammar 'none | <number>{3}? <angle>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html index b2e5749..789ea00 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="rotate supports the full grammar 'none | <number>{3}? <angle>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html index 82b47cc..050171ca 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="scale supports only the grammar 'none | <number>{1,3}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html index e058f06..0d8783af 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="scale supports the full grammar 'none | <number>{1,3}'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html index 3af91965..23f7ddc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform-box supports only the grammar 'content-box | border-box | fill-box | stroke-box | view-box'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-valid.html index 742750b..a5d8af9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-box-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform-box supports the full grammar 'content-box | border-box | fill-box | stroke-box | view-box'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-invalid.html index dc81069c..02c2b95 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform supports only the grammar 'none | <transform-list>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html index dab56a0..0adcc1f2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform-origin supports only the grammar from spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html index ab36024ef..52aa6ff 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform-origin supports the full grammar from spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-valid.html index 9a5b9c06..f9efaa1f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/transform-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="transform supports the full grammar 'none | <transform-list>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html index d8de1f7..e602d91 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="translate supports only the grammar 'none | <length-percentage> [ <length-percentage> <length>? ]?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html index b117d27..ab4f27f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="translate supports the full grammar 'none | <length-percentage> [ <length-percentage> <length>? ]?'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-invalid.html index 4ced382..0b6ee8578 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="box-sizing supports only the grammar 'content-box | border-box'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-valid.html index fb60ac23..68010ff 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/box-sizing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="box-sizing supports the full grammar 'content-box | border-box'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-invalid.html index b4c9cb7..a980b0e2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="caret-color supports only the grammar 'auto | <color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-valid.html index 41cc706..31e1b6c5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/caret-color-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="caret-color supports the full grammar 'auto | <color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-invalid.html index dda8031..1866b45c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="cursor supports only the grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-valid.html index e33b82e..b16a6fe 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/cursor-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="cursor supports the full grammar."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-invalid.html index 195f55d..b554c1ac 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-color supports only the grammar '<color> | invert'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-mandatory.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-mandatory.html index fbe730b..92f1b04 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-mandatory.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-mandatory.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-color supports '<color>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-optional.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-optional.html index bf12b87f..9b82aeb5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-optional.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-color-valid-optional.html
@@ -9,7 +9,7 @@ <meta name="flags" content="may"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-invalid.html index c56a579..f9aa61b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline supports only the grammar '<outline-color> || <outline> || <outline>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-invalid.html index 1ee9477..1106e86 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-offset supports only the grammar '<length>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-valid.html index c5e023b8..c0b8891 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-offset-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-offset supports the full grammar '<length>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-invalid.html index 2340c62..b93a984 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-style supports only the grammar 'auto | <outline-line-style>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-valid.html index 5adcfda..93d14a4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-style-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-style supports the full grammar 'auto | <outline-line-style>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-mandatory.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-mandatory.html index a296c98..f8322a4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-mandatory.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-mandatory.html
@@ -9,7 +9,7 @@ <meta name="assert" content="outline supports the full grammar '<outline-color> || <outline> || <outline>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-optional.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-optional.html index e179406c..44cf823 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-optional.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-valid-optional.html
@@ -11,7 +11,7 @@ <meta name="flags" content="may"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-invalid.html index 07012fef..40e4961 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-width supports only the grammar '<border-width>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-valid.html index 050371246..db6c77c8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/outline-width-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="outline-width supports the full grammar '<border-width>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-invalid.html index a56a1dbc..b166c01 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="resize supports only the grammar 'none | both | horizontal | vertical'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-valid.html index 025b0e4..3acc9b0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/resize-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="resize supports the full grammar 'none | both | horizontal | vertical'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-invalid.html index f3945a1..22affb7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-overflow supports only the grammar 'clip | ellipsis'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-valid.html index 3f0aaa60..bc2a4fd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/text-overflow-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-overflow supports the full grammar 'clip | ellipsis'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="support/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-ui/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-invalid.html index a587b9f..0927ca3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="direction supports only the grammar 'ltr | rtl'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-valid.html index 436226a..ca4d7bb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/direction-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="direction supports the full grammar 'ltr | rtl'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-invalid.html index 8807997..08cbb96 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-combine-upright supports only the grammar 'none | all'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-valid.html index f599f12b..bd56fb5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-combine-upright-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-combine-upright supports the full grammar 'none | all'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-invalid.html index 4461dbe..118764d6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-orientation supports only the grammar 'mixed | upright | sideways'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-valid.html index f6304fd..2f2b662 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/text-orientation-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="text-orientation supports the full grammar 'mixed | upright | sideways'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-invalid.html index 10907cbe..de7cb6d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="unicode-bidi supports only the grammar 'normal | embed | isolate | bidi-override | isolate-override | plaintext'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-valid.html index 49c42345..97a3d59 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/unicode-bidi-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="unicode-bidi supports the full grammar 'normal | embed | isolate | bidi-override | isolate-override | plaintext'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-invalid.html index 7b36e47..6a512a71 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="writing-mode supports only the grammar 'horizontal-tb | vertical-rl | vertical-lr'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-valid.html index 4264e38..4fd856a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/parsing/writing-mode-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="writing-mode supports the full grammar 'horizontal-tb | vertical-rl | vertical-lr'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt index 8c816a18..1c560a9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 377 tests; 322 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 377 tests; 323 PASS, 54 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS Partial interface Document: original interface defined PASS Partial interface Window: original interface defined @@ -38,7 +38,7 @@ PASS StyleSheet interface: attribute title PASS StyleSheet interface: attribute media PASS StyleSheet interface: attribute disabled -FAIL CSSStyleSheet interface: existence and properties of interface object assert_throws: interface object didn't throw TypeError when called as a constructor function "function () { [native code] }" did not throw +PASS CSSStyleSheet interface: existence and properties of interface object PASS CSSStyleSheet interface object length PASS CSSStyleSheet interface object name PASS CSSStyleSheet interface: existence and properties of interface prototype object
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-invalid.html index 39c3eb1..45917c1b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-anchor supports only the grammar 'auto | <position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-valid.html index 5bb10bb..3010106 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-anchor-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-anchor supports the full grammar 'auto | <position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-invalid.html index 5fbbe8eb..1cbb27f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-distance supports only the grammar '<length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-valid.html index 4fe6755..56569c8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-distance-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-distance supports the full grammar '<length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-invalid.html index 54298ac..343d22e4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset supports only the grammar from the spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-valid.html index c7a4e64..b645199 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset supports the full grammar from the spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-invalid.html index 95bce06..c0a3248 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-path supports only the grammar from the spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-valid.html index 429abb9..c1e229e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-path-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-path supports the full grammar from the spec."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-invalid.html index c008eff0..42370d44 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-position supports only the grammar 'auto | <position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-valid.html index 984e79c8..3cf235c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-position-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-position supports the full grammar 'auto | <position>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-invalid.html index f69ccfc..591189a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-invalid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-rotate supports only the grammar '[ auto | reverse ] || <angle>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-valid.html b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-valid.html index 18eb8203..f481ec89 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-valid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/offset-rotate-parsing-valid.html
@@ -8,7 +8,7 @@ <meta name="assert" content="offset-rotate supports the full grammar '[ auto | reverse ] || <angle>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="resources/parsing-testcommon.js"></script> +<script src="../support/parsing-testcommon.js"></script> </head> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/resources/parsing-testcommon.js deleted file mode 100644 index b075882..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/motion/parsing/resources/parsing-testcommon.js +++ /dev/null
@@ -1,39 +0,0 @@ -'use strict'; - -// serializedValue can be the expected serialization of value, -// or an array of permitted serializations, -// or omitted if value should serialize as value. -function test_valid_value(property, value, serializedValue) { - if (arguments.length < 3) - serializedValue = value; - - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_not_equals(div.style.getPropertyValue(property), "", "property should be set"); - - var div = document.createElement('div'); - div.style[property] = value; - var readValue = div.style.getPropertyValue(property); - if (serializedValue instanceof Array) - assert_in_array(readValue, serializedValue, "serialization should be sound"); - else - assert_equals(readValue, serializedValue, "serialization should be canonical"); - - div.style[property] = readValue; - assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip"); - - }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); -} - -function test_invalid_value(property, value) { - var stringifiedValue = JSON.stringify(value); - - test(function(){ - var div = document.createElement('div'); - div.style[property] = value; - assert_equals(div.style.getPropertyValue(property), ""); - }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); -}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/motion/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/motion/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector-expected.txt new file mode 100644 index 0000000..27b02a2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS scope selector works in shadowRoot.firstChild +FAIL Selecting direct child of shadow root with :scope should work assert_equals: should get the direct child of shadowRoot expected Element node <div class="div" id="external_div">Shadow Element<div id=... but got null +FAIL Selecting descendants of shadow root with :scope should work assert_equals: should get the first div descendant of shadowRoot expected Element node <div class="div" id="external_div">Shadow Element<div id=... but got null +PASS querySelector() with ":scope" should return null, whether the context object is an element or a shadow root +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector.html b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector.html new file mode 100644 index 0000000..bda0aed6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/scope-selector.html
@@ -0,0 +1,34 @@ +<!doctype html> +<link rel='help' href='https://drafts.csswg.org/selectors-4/#the-scope-pseudo'> +<meta name='description' content=':scope should match when context object is a shadow root'> +<script src='/resources/testharness.js'></script> +<script src='/resources/testharnessreport.js'></script> +<div id='shadowHost'></div> +<script> +'use strict' + const shadowRoot = shadowHost.attachShadow({mode:'open'}) + shadowRoot.innerHTML = '<div class="div" id="external_div">Shadow Element<div id="nesteddiv">nested</div></div>'; + +test(() => { + assert_equals(shadowRoot.firstChild.querySelectorAll(':scope > div').length, 1, 'should get the number of direct children of external_div'); + assert_equals(shadowRoot.firstChild.querySelector(':scope > div'), shadowRoot.getElementById("nesteddiv"), 'should get the first direct child of external_div'); + assert_equals(shadowRoot.firstChild.querySelector(':scope > div').innerHTML, 'nested', 'should get the text in nesteddiv'); +}, 'scope selector works in shadowRoot.firstChild') + +test(() => { + assert_equals(shadowRoot.querySelector(':scope > div'), shadowRoot.getElementById('external_div'), 'should get the direct child of shadowRoot'); + assert_equals(shadowRoot.querySelectorAll(':scope > div').length, 1, 'should get the number of direct div children of shadowRoot'); +}, 'Selecting direct child of shadow root with :scope should work') + +test(() => { + assert_equals(shadowRoot.querySelector(':scope div'), shadowRoot.getElementById('external_div'), 'should get the first div descendant of shadowRoot'); + assert_equals(shadowRoot.querySelectorAll(':scope div').length, 2, 'should get the number of the div descendants of shadowRoot'); +}, 'Selecting descendants of shadow root with :scope should work') + +test(() => { + assert_equals(shadowRoot.firstChild.querySelector(':scope'), null, 'should return null'); + assert_equals(shadowRoot.querySelector(':scope'), null, 'should return null'); + assert_equals(shadowRoot.querySelectorAll(':scope').length, 0, 'should return 0'); +}, 'querySelector() with ":scope" should return null, whether the context object is an element or a shadow root') + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/support/parsing-testcommon.js similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/css/css-ui/parsing/support/parsing-testcommon.js copy to third_party/WebKit/LayoutTests/external/wpt/css/support/parsing-testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/web-animations.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/web-animations.idl index 2e66d6f..7dce1002 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/interfaces/web-animations.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/web-animations.idl
@@ -98,22 +98,22 @@ }; dictionary BaseComputedKeyframe { - double? offset = null; - double computedOffset; - DOMString easing = "linear"; - CompositeOperation? composite = null; + double? offset = null; + double computedOffset; + DOMString easing = "linear"; + CompositeOperationOrAuto composite = "auto"; }; dictionary BasePropertyIndexedKeyframe { (double? or sequence<double?>) offset = []; (DOMString or sequence<DOMString>) easing = []; - (CompositeOperation? or sequence<CompositeOperation?>) composite = []; + (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = []; }; dictionary BaseKeyframe { - double? offset = null; - DOMString easing = "linear"; - CompositeOperation? composite = null; + double? offset = null; + DOMString easing = "linear"; + CompositeOperationOrAuto composite = "auto"; }; dictionary KeyframeEffectOptions : EffectTiming { @@ -125,6 +125,8 @@ enum CompositeOperation {"replace", "add", "accumulate"}; +enum CompositeOperationOrAuto {"replace", "add", "accumulate", "auto"}; + interface mixin Animatable { Animation animate (object? keyframes, optional (unrestricted double or KeyframeAnimationOptions) options);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/testdriver.js b/third_party/WebKit/LayoutTests/external/wpt/resources/testdriver.js index c9231d9..42ec824 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/resources/testdriver.js +++ b/third_party/WebKit/LayoutTests/external/wpt/resources/testdriver.js
@@ -67,7 +67,8 @@ button.innerHTML = "This test requires user interaction.<br />" + "Please click here to allow " + intent + "."; button.id = "wpt-test-driver-bless-" + (idCounter += 1); - document.body.appendChild(button); + const elem = document.body || document.documentElement; + elem.appendChild(button); return new Promise(function(resolve, reject) { button.addEventListener("click", resolve);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/active.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/active.https.html index deee6a50e..350a34b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/active.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/active.https.html
@@ -5,51 +5,46 @@ <script src="resources/test-helpers.sub.js"></script> <body> <script> + +const SCRIPT = 'resources/empty-worker.js'; +const SCOPE = 'resources/blank.html'; + // "active" is set -async_test(function(t) { - var step = t.step_func.bind(t); - var url = 'resources/empty-worker.js'; - var scope = 'resources/blank.html'; - var frame; - var registration; +promise_test(async t => { - service_worker_unregister(t, scope) - .then(step(function() { return with_iframe(scope); })) - .then(step(function(f) { - frame = f; - return navigator.serviceWorker.register(url, {scope: scope}); - })) - .then(step(function(r) { - registration = r; - return wait_for_state(t, r.installing, 'activating'); - })) - .then(step(function() { - var container = frame.contentWindow.navigator.serviceWorker; - assert_equals( - container.controller, - null, - 'On activating state a document should not have a controller'); - assert_equals( - registration.active.scriptURL, - normalizeURL(url), - 'On activating state a document should have an active worker '); - assert_equals( - registration.waiting, - null, - 'On activating state a document should not have a waiting worker'); - assert_equals( - registration.installing, - null, - 'On activating state a document should not have an installing ' + - 'worker'); + t.add_cleanup(async() => { + if (frame) + frame.remove(); + if (registration) + await registration.unregister(); + }); - // FIXME: Add a test for a frame created after installation. - // Should the existing frame ("frame") block activation? - })) - .then(step(function() { - frame.remove(); - return service_worker_unregister_and_done(t, scope); - })) - .catch(unreached_rejection(t)); - }, 'active is set'); + await service_worker_unregister(t, SCOPE); + const frame = await with_iframe(SCOPE); + const registration = + await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE}); + await wait_for_state(t, registration.installing, 'activating'); + const container = frame.contentWindow.navigator.serviceWorker; + assert_equals(container.controller, null, 'controller'); + assert_equals(registration.active.state, 'activating', + 'registration.active'); + assert_equals(registration.waiting, null, 'registration.waiting'); + assert_equals(registration.installing, null, 'registration.installing'); + + // FIXME: Add a test for a frame created after installation. + // Should the existing frame ("frame") block activation? +}, 'active is set'); + +// Tests that the ServiceWorker objects returned from active attribute getter +// that represent the same service worker are the same objects. +promise_test(async t => { + const registration1 = + await service_worker_unregister_and_register(t, SCRIPT, SCOPE); + const registration2 = await navigator.serviceWorker.getRegistration(SCOPE); + assert_equals(registration1.active, registration2.active, + 'ServiceWorkerRegistration.active should return the same ' + + 'object'); + await registration1.unregister(); +}, 'The ServiceWorker objects returned from active attribute getter that ' + + 'represent the same service worker are the same objects'); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/installing.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/installing.https.html index 57d87811..0f257b6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/installing.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/installing.https.html
@@ -5,33 +5,44 @@ <script src="resources/test-helpers.sub.js"></script> <body> <script> + +const SCRIPT = 'resources/empty-worker.js'; +const SCOPE = 'resources/blank.html'; + // "installing" is set -async_test(function(t) { - var step = t.step_func.bind(t); - var url = 'resources/empty-worker.js'; - var scope = 'resources/blank.html'; - var frame; +promise_test(async t => { - service_worker_unregister(t, scope) - .then(step(function() { return with_iframe(scope); })) - .then(step(function(f) { - frame = f; - return navigator.serviceWorker.register(url, {scope: scope}); - })) - .then(step(function(registration) { - var container = frame.contentWindow.navigator.serviceWorker; - assert_equals(container.controller, null); - assert_equals(registration.active, null); - assert_equals(registration.waiting, null); - assert_equals(registration.installing.scriptURL, normalizeURL(url)); + t.add_cleanup(async() => { + if (frame) + frame.remove(); + if (registration) + await registration.unregister(); + }); - // FIXME: Add a test for a frame created after installation. - // Should the existing frame ("frame") block activation? - })) - .then(step(function() { - frame.remove(); - return service_worker_unregister_and_done(t, scope); - })) - .catch(unreached_rejection(t)); + await service_worker_unregister(t, SCOPE); + const frame = await with_iframe(SCOPE); + const registration = + await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE}); + const container = frame.contentWindow.navigator.serviceWorker; + assert_equals(container.controller, null, 'controller'); + assert_equals(registration.active, null, 'registration.active'); + assert_equals(registration.waiting, null, 'registration.waiting'); + assert_equals(registration.installing.scriptURL, normalizeURL(SCRIPT), + 'registration.installing.scriptURL'); + // FIXME: Add a test for a frame created after installation. + // Should the existing frame ("frame") block activation? }, 'installing is set'); + +// Tests that The ServiceWorker objects returned from installing attribute getter +// that represent the same service worker are the same objects. +promise_test(async t => { + const registration1 = + await service_worker_unregister_and_register(t, SCRIPT, SCOPE); + const registration2 = await navigator.serviceWorker.getRegistration(SCOPE); + assert_equals(registration1.installing, registration2.installing, + 'ServiceWorkerRegistration.installing should return the ' + + 'same object'); + await registration1.unregister(); +}, 'The ServiceWorker objects returned from installing attribute getter that ' + + 'represent the same service worker are the same objects'); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/navigationPreload.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/navigationPreload.https.html new file mode 100644 index 0000000..392e5c14 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/navigationPreload.https.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>ServiceWorker: navigator.serviceWorker.navigationPreload</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../resources/test-helpers.sub.js"></script> +<script src="resources/helpers.js"></script> +<script> +promise_test(async t => { + const SCRIPT = '../resources/empty-worker.js'; + const SCOPE = '../resources/navigationpreload'; + const registration = + await service_worker_unregister_and_register(t, SCRIPT, SCOPE); + const navigationPreload = registration.navigationPreload; + assert_true(navigationPreload instanceof NavigationPreloadManager, + 'ServiceWorkerRegistration.navigationPreload'); + await registration.unregister(); +}, "The navigationPreload attribute must return service worker " + + "registration's NavigationPreloadManager object."); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html index 58f25f3..6004985a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
@@ -7,25 +7,20 @@ 'use strict'; function url_test(name, url) { - var scope = 'resources/scope/' + name; - var expectedURL = normalizeURL(url); + const scope = 'resources/scope/' + name; + const expectedURL = normalizeURL(url); - promise_test(function(t) { - return service_worker_unregister_and_register(t, url, scope) - .then(function(registration) { - var worker = registration.installing; - - t.add_cleanup(function() { - registration.unregister(); - }); - - assert_equals(worker.scriptURL, expectedURL, - 'Returned ServiceWorker object should have scriptURL'); - }); - }, 'Verify the scriptURL property: ' + name); + promise_test(async t => { + const registration = + await service_worker_unregister_and_register(t, url, scope); + const worker = registration.installing; + assert_equals(worker.scriptURL, expectedURL, 'scriptURL'); + await registration.unregister(); + }, 'Verify the scriptURL property: ' + name); } url_test('relative', 'resources/empty-worker.js'); url_test('with-fragment', 'resources/empty-worker.js#ref'); +url_test('with-query', 'resources/empty-worker.js?ref'); url_test('absolute', normalizeURL('./resources/empty-worker.js')); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/waiting.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/waiting.https.html index 2b0dbc9..499e581 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/waiting.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/waiting.https.html
@@ -5,36 +5,43 @@ <script src="resources/test-helpers.sub.js"></script> <body> <script> -promise_test(t => { - var script = 'resources/empty-worker.js'; - var scope = 'resources/blank.html'; - var frame; - var registration; - return service_worker_unregister(t, scope) - .then(() => { return with_iframe(scope); }) - .then(f => { - frame = f; - return navigator.serviceWorker.register(script, {scope: scope}); - }) - .then(r => { - registration = r; - add_result_callback(() => { registration.unregister(); }); - return wait_for_state(t, r.installing, 'installed'); - }) - .then(() => { - const controller = - frame.contentWindow.navigator.serviceWorker.controller; - assert_equals(controller, null, '.controller'); +const SCRIPT = 'resources/empty-worker.js'; +const SCOPE = 'resources/blank.html'; - assert_equals(registration.active, null, '.active'); - assert_equals(registration.waiting.state, 'installed', '.waiting'); - assert_equals(registration.installing, null, '.installing'); - }) - .then(() => { - frame.remove(); - return registration.unregister(); - }); - }, 'waiting is set after installation'); +promise_test(async t => { + + t.add_cleanup(async() => { + if (frame) + frame.remove(); + if (registration) + await registration.unregister(); + }); + + await service_worker_unregister(t, SCOPE); + const frame = await with_iframe(SCOPE); + const registration = + await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE}); + await wait_for_state(t, registration.installing, 'installed'); + const controller = frame.contentWindow.navigator.serviceWorker.controller; + assert_equals(controller, null, 'controller'); + assert_equals(registration.active, null, 'registration.active'); + assert_equals(registration.waiting.state, 'installed', + 'registration.waiting'); + assert_equals(registration.installing, null, 'registration.installing'); +}, 'waiting is set after installation'); + +// Tests that the ServiceWorker objects returned from waiting attribute getter +// that represent the same service worker are the same objects. +promise_test(async t => { + const registration1 = + await service_worker_unregister_and_register(t, SCRIPT, SCOPE); + const registration2 = await navigator.serviceWorker.getRegistration(SCOPE); + assert_equals(registration1.waiting, registration2.waiting, + 'ServiceWorkerRegistration.waiting should return the same ' + + 'object'); + await registration1.unregister(); +}, 'The ServiceWorker objects returned from waiting attribute getter that ' + + 'represent the same service worker are the same objects'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-001.svg b/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-001.svg index 2278019c..f8fcf9f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-001.svg +++ b/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-001.svg
@@ -18,6 +18,10 @@ mix-blend-mode: screen; } + #edgecover > rect { + mix-blend-mode: normal; + } + g { isolation: isolate; } @@ -32,7 +36,7 @@ </g> <!-- Stroke to prevent aliasing from effecting results. --> - <g style="mix-blend-mode:normal;fill:none;stroke:black;stroke-width:2px"> + <g style="fill:none;stroke:black;stroke-width:2px" id="edgecover"> <rect x="120" y="80" width="160" height="160"/> <rect x="200" y="80" width="160" height="160"/> <rect x="160" y="160" width="160" height="160"/>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-002.svg b/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-002.svg index 01e180f..d74333c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-002.svg +++ b/third_party/WebKit/LayoutTests/external/wpt/svg/render/reftests/blending-002.svg
@@ -18,21 +18,23 @@ mix-blend-mode: screen; } - g { - isolation: isolate; + #edgecover > rect { + mix-blend-mode: normal; } </style> <g id="test-body-content"> - <rect x="120" y="80" width="160" height="160" fill="red"/> - <g> - <rect x="200" y="80" width="160" height="160" fill="lime"/> - <rect x="160" y="160" width="160" height="160" fill="blue"/> + <g style="isolation: isolate"> + <rect x="120" y="80" width="160" height="160" fill="red"/> + <g style="isolation: isolate"> + <rect x="200" y="80" width="160" height="160" fill="lime"/> + <rect x="160" y="160" width="160" height="160" fill="blue"/> + </g> </g> <!-- Stroke to prevent aliasing from effecting results. --> - <g style="mix-blend-mode:normal;fill:none;stroke:black;stroke-width:2px"> + <g style="fill:none;stroke:black;stroke-width:2px" id="edgecover"> <rect x="120" y="80" width="160" height="160"/> <rect x="200" y="80" width="160" height="160"/> <rect x="160" y="160" width="160" height="160"/>
diff --git a/third_party/WebKit/LayoutTests/fast/css/CSSStyleSheet-constructable.html b/third_party/WebKit/LayoutTests/fast/css/CSSStyleSheet-constructable.html index c0d358148..30e177e 100644 --- a/third_party/WebKit/LayoutTests/fast/css/CSSStyleSheet-constructable.html +++ b/third_party/WebKit/LayoutTests/fast/css/CSSStyleSheet-constructable.html
@@ -9,26 +9,6 @@ const redStyleTexts = [".red { color: red; }", ".red + span + span { color: red; }"]; test(() => { - const sheet = new CSSStyleSheet({title: "Red", disabled: true, media: "screen, print"}); - assert_equals(sheet.title, "Red"); - assert_equals(sheet.ownerNode, null); - assert_equals(sheet.ownerRule, null); - assert_equals(sheet.media.length, 2); - assert_equals(sheet.media.item(0), "screen"); - assert_equals(sheet.media.item(1), "print"); - assert_true(sheet.disabled); - assert_equals(sheet.cssRules.length, 0); - - sheet.insertRule(redStyleTexts[0]); - assert_equals(sheet.cssRules.length, 1); - assert_equals(sheet.cssRules[0].cssText, redStyleTexts[0]); - - sheet.insertRule(redStyleTexts[1]); - assert_equals(sheet.cssRules.length, 2); - assert_equals(sheet.cssRules[0].cssText, redStyleTexts[1]); -}, 'Empty CSSStyleSheet can be constructed using script'); - -test(() => { const sheet = document.createEmptyCSSStyleSheet({title: "Red", disabled: true, media: "screen, print"}); assert_equals(sheet.title, "Red"); assert_equals(sheet.ownerNode, null);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt index 39d0f34..ee72f095 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
@@ -74,7 +74,7 @@ PASS TryAllocate('CSSRuleList') is 'exception' PASS TryAllocate('CSSStyleDeclaration') is 'exception' PASS TryAllocate('CSSStyleRule') is 'exception' -FAIL TryAllocate('CSSStyleSheet') should be exception. Was [object CSSStyleSheet]. +PASS TryAllocate('CSSStyleSheet') is 'exception' PASS TryAllocate('DOMImplementation') is 'exception' PASS TryAllocate('HTMLCollection') is 'exception' PASS TryAllocate('MediaList') is 'exception'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-basic.html b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-basic.html index 1cc19ce..635c024c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-basic.html +++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-basic.html
@@ -66,9 +66,9 @@ check(39, 212, 1, 1, [e.body]); check(39, 202, 1, 11, [e.d2, e.body]); check(39, 212, 1, 11, [e.p2, e.body]); - check(39, 202, 2, 41, [e.d2, e.p2, e.body]); - check(39, 202, 6, 41, [e.span, e.d2, e.p2, e.body]); - check(39, 202, 16, 41, [e.p5, e.span, e.d2, e.p2, e.body]); + check(39, 202, 2, 41, [e.p2, e.d2, e.body]); + check(39, 202, 6, 41, [e.span, e.p2, e.d2, e.body]); + check(39, 202, 16, 41, [e.p5, e.span, e.p2, e.d2, e.body]); check(39, 202, 1, 21, [e.d2, e.p2, e.body]); check(29, 212, 21, 1, [e.p5, e.body]); check(29, 202, 21, 21, [e.p5, e.d2, e.p2, e.body]);
diff --git a/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY.html b/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY.html index 18e7dbf..d1bb965 100644 --- a/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY.html +++ b/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY.html
@@ -137,7 +137,7 @@ event.offsetY == event.expectedOffsetY) result = 'PASS: event hit ' + element.id + ' at offset (' + event.offsetX + ', ' + event.offsetY + ')'; else - result = 'FAIL: event at (' + event.clientX + ', ' + event.clientY + ') expected to hit ' + event.expectedElement + ' at (' + event.expectedOffsetX + ', ' + event.expectedOffsetY + ') but hit ' + element.id + ' at (' + event.offsetX + ', ' + event.offsetY + ')'; + result = 'FAIL: event expected to hit ' + event.expectedElement + ' at (' + event.expectedOffsetX + ', ' + event.expectedOffsetY + ') but hit ' + element.id + ' at (' + event.offsetX + ', ' + event.offsetY + ')'; log(result); }
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html index f64d79b..8b812dee 100644 --- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html
@@ -1,6 +1,9 @@ <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <style> + * { + margin: 0; + } #pusher { width: 1000px; height: 1000px; @@ -42,10 +45,12 @@ eventFired = false; await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_equals(lastEvent.clientX, 100); - assert_equals(lastEvent.clientY, 100); - assert_equals(lastEvent.pageX, 100); - assert_equals(lastEvent.pageY, 100); + assert_equals(lastEvent.clientX, 100, "clientX"); + assert_equals(lastEvent.clientY, 100, "clientY"); + assert_equals(lastEvent.pageX, 100, "pageX"); + assert_equals(lastEvent.pageY, 100, "pageY"); + assert_equals(lastEvent.offsetX, 100, "offsetX"); + assert_equals(lastEvent.offsetY, 100, "offsetY"); }, 'Default'); promise_test(async () => { @@ -53,22 +58,26 @@ eventSender.setPageZoomFactor(1.2); await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageY, 83.33333, floatPrecision); - eventSender.setPageZoomFactor(1.0) + assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision, "clientX"); + assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision, "clientY"); + assert_approx_equals(lastEvent.pageX, 83.33333, floatPrecision, "pageX"); + assert_approx_equals(lastEvent.pageY, 83.33333, floatPrecision, "pageY"); + assert_approx_equals(lastEvent.offsetX, 83.33333, floatPrecision, "offsetX"); + assert_approx_equals(lastEvent.offsetY, 83.33333, floatPrecision, "offsetY"); }, 'Zoomed'); promise_test(async () => { eventFired = false; window.scrollTo(50, 50); + eventSender.setPageZoomFactor(1.0) await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_equals(lastEvent.clientX, 100); - assert_equals(lastEvent.clientY, 100); - assert_equals(lastEvent.pageX, 150); - assert_equals(lastEvent.pageY, 150); + assert_equals(lastEvent.clientX, 100, "clientX"); + assert_equals(lastEvent.clientY, 100, "clientY"); + assert_equals(lastEvent.pageX, 150, "pageX"); + assert_equals(lastEvent.pageY, 150, "pageY"); + assert_equals(lastEvent.offsetX, 150, "offsetX"); + assert_equals(lastEvent.offsetY, 150, "offsetY"); window.scrollTo(0, 0); }, 'Scrolled'); @@ -78,10 +87,12 @@ window.scrollTo(50, 50); await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageX, 133.33333, floatPrecision); - assert_approx_equals(lastEvent.pageY, 133.33333, floatPrecision); + assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision, "clientX"); + assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision, "clientY"); + assert_approx_equals(lastEvent.pageX, 133.33333, floatPrecision, "pageX"); + assert_approx_equals(lastEvent.pageY, 133.33333, floatPrecision, "pageY"); + assert_approx_equals(lastEvent.offsetX, 133.33333, floatPrecision, "offsetX"); + assert_approx_equals(lastEvent.offsetY, 133.33333, floatPrecision, "offsetY"); eventSender.setPageZoomFactor(1.0) window.scrollTo(0, 0); }, 'Zoomed and scrolled');
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html index 341d627..ba17319 100644 --- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html
@@ -1,6 +1,9 @@ <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <style> + * { + margin: 0; + } #pusher { width: 1000px; height: 1000px; @@ -42,10 +45,12 @@ eventFired = false; await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_equals(lastEvent.clientX, 100); - assert_equals(lastEvent.clientY, 100); - assert_equals(lastEvent.pageX, 100); - assert_equals(lastEvent.pageY, 100); + assert_equals(lastEvent.clientX, 100, "clientX"); + assert_equals(lastEvent.clientY, 100, "clientY"); + assert_equals(lastEvent.pageX, 100, "pageX"); + assert_equals(lastEvent.pageY, 100, "pageY"); + assert_equals(lastEvent.offsetX, 100, "offsetX"); + assert_equals(lastEvent.offsetY, 100, "offsetY"); }, 'Default'); promise_test(async () => { @@ -53,22 +58,26 @@ eventSender.setPageZoomFactor(1.2); await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageY, 83.33333, floatPrecision); - eventSender.setPageZoomFactor(1.0) + assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision, "clientX"); + assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision, "clientY"); + assert_approx_equals(lastEvent.pageX, 83.33333, floatPrecision, "pageX"); + assert_approx_equals(lastEvent.pageY, 83.33333, floatPrecision, "pageY"); + assert_approx_equals(lastEvent.offsetX, 83.33333, floatPrecision, "offsetX"); + assert_approx_equals(lastEvent.offsetY, 83.33333, floatPrecision, "offsetY"); }, 'Zoomed'); promise_test(async () => { eventFired = false; window.scrollTo(50, 50); + eventSender.setPageZoomFactor(1.0) await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_equals(lastEvent.clientX, 100); - assert_equals(lastEvent.clientY, 100); - assert_equals(lastEvent.pageX, 150); - assert_equals(lastEvent.pageY, 150); + assert_equals(lastEvent.clientX, 100, "clientX"); + assert_equals(lastEvent.clientY, 100, "clientY"); + assert_equals(lastEvent.pageX, 150, "pageX"); + assert_equals(lastEvent.pageY, 150, "pageY"); + assert_equals(lastEvent.offsetX, 150, "offsetX"); + assert_equals(lastEvent.offsetY, 150, "offsetY"); window.scrollTo(0, 0); }, 'Scrolled'); @@ -78,10 +87,12 @@ window.scrollTo(50, 50); await sendMouseDownAt(100, 100); assert_true(eventFired); - assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision); - assert_approx_equals(lastEvent.pageX, 133.33333, floatPrecision); - assert_approx_equals(lastEvent.pageY, 133.33333, floatPrecision); + assert_approx_equals(lastEvent.clientX, 83.33333, floatPrecision, "clientX"); + assert_approx_equals(lastEvent.clientY, 83.33333, floatPrecision, "clientY"); + assert_approx_equals(lastEvent.pageX, 133.33333, floatPrecision, "pageX"); + assert_approx_equals(lastEvent.pageY, 133.33333, floatPrecision, "pageY"); + assert_approx_equals(lastEvent.offsetX, 133.33333, floatPrecision, "offsetX"); + assert_approx_equals(lastEvent.offsetY, 133.33333, floatPrecision, "offsetY"); eventSender.setPageZoomFactor(1.0) window.scrollTo(0, 0); }, 'Zoomed and scrolled');
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator-expected.txt new file mode 100644 index 0000000..fe244e4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator-expected.txt
@@ -0,0 +1,7 @@ +Tests popver for spread operator. + +Request popover for array: +Array(3) +Request popover for object: +Object +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator.js b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator.js new file mode 100644 index 0000000..cd0b102 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/popover-for-spread-operator.js
@@ -0,0 +1,27 @@ +// Copyright 2018 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. + +(async function() { + TestRunner.addResult(`Tests popver for spread operator.\n`); + await TestRunner.loadModule('sources_test_runner'); + await TestRunner.showPanel('sources'); + + await SourcesTestRunner.startDebuggerTestPromise(/* quiet */ true); + TestRunner.evaluateInPageAnonymously(` +let arr = [1,2,3]; +console.log(...arr); +let obj = {a:1}; +console.log({...obj}); +debugger; +//# sourceURL=test.js`); + await new Promise(resolve => UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, resolve)); + const sourceFrame = await SourcesTestRunner.showScriptSourcePromise('test.js'); + TestRunner.addResult('Request popover for array:'); + const {description: arr} = await SourcesTestRunner.objectForPopover(sourceFrame, 2, 16); + TestRunner.addResult(arr); + TestRunner.addResult('Request popover for object:'); + const {description: obj} = await SourcesTestRunner.objectForPopover(sourceFrame, 4, 17); + TestRunner.addResult(obj); + SourcesTestRunner.completeDebuggerTest(); +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-image.html b/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-image.html new file mode 100644 index 0000000..586319bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-image.html
@@ -0,0 +1,18 @@ +<!doctype html> +<html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<img src="http://localhost:8080/security/resources/cors-image.php?max-age=60" crossorigin></img> +<script> +async_test((test) => { + document.querySelector('img').addEventListener('load', () => { + const iframe = document.createElement('iframe'); + iframe.sandbox = 'allow-scripts'; + iframe.src = 'resources/cors-check-for-cached-image-iframe.html'; + document.body.appendChild(iframe); + }); + window.addEventListener('message', test.step_func_done((e) => { + assert_equals(e.data, 'PASS'); + })); +}, 'We should not reuse CORS check result when requested from another origin'); +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-script.html b/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-script.html new file mode 100644 index 0000000..e1c42cc1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/cors-check-for-cached-script.html
@@ -0,0 +1,13 @@ +<!doctype html> +<html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="http://localhost:8080/security/resources/cors-script.php?max-age=60" crossorigin></script> +<script> +async_test((test) => { + window.addEventListener('message', test.step_func_done((e) => { + assert_equals(e.data, 'PASS'); + })); +}, 'We should not reuse CORS check result when requested from another origin'); +</script> +<iframe sandbox="allow-scripts allow-modals" src="resources/cors-check-for-cached-script-iframe.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-image-iframe.html b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-image-iframe.html new file mode 100644 index 0000000..e79c781c --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-image-iframe.html
@@ -0,0 +1,4 @@ +<!doctype html> +<img src="http://localhost:8080/security/resources/cors-image.php?max-age=60" crossorigin + onload="parent.postMessage('FAIL', '*')" + onerror="parent.postMessage('PASS', '*')">
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-script-iframe.html b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-script-iframe.html new file mode 100644 index 0000000..e991a14 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-check-for-cached-script-iframe.html
@@ -0,0 +1,5 @@ +<!doctype html> +<html> +<script src="http://localhost:8080/security/resources/cors-script.php?max-age=60" crossorigin + onload="parent.postMessage('FAIL', '*')" + onerror="parent.postMessage('PASS', '*')"></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-image.php b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-image.php new file mode 100644 index 0000000..4413a68 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-image.php
@@ -0,0 +1,16 @@ +<?php +$max_age = $_GET['max-age']; +if (!(empty($max_age))) { + header('Cache-Control: max-age=' . $max_age); +} + +header("Access-Control-Allow-Origin: http://127.0.0.1:8000"); + +$name = 'abe.png'; +$fp = fopen($name, 'rb'); +header("Content-Type: image/png"); +header("Content-Length: " . filesize($name)); + +fpassthru($fp); +exit; +?>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php index e26cd58..1f903c3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php +++ b/third_party/WebKit/LayoutTests/http/tests/security/resources/cors-script.php
@@ -8,6 +8,11 @@ } } +$max_age = $_GET['max-age']; +if (!(empty($max_age))) { + header('Cache-Control: max-age=' . $max_age); +} + if (strtolower($_GET['credentials']) == 'true') { header('Access-Control-Allow-Credentials: true'); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index 1bdf968..9d415d1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -39,6 +39,7 @@ getter downloaded getter id getter onprogress + getter state getter uploadTotal getter uploaded method abort
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt deleted file mode 100644 index 41ce841..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt +++ /dev/null
@@ -1,48 +0,0 @@ -CONSOLE WARNING: line 17: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -CONSOLE ERROR: line 19: Access to XMLHttpRequest at 'http://localhost:8000/xmlhttprequest/resources/get.txt' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -Tests the behavior of whitelisting origins and removing them later. - -Testing: source origin: http://127.0.0.1:8000 destination origin: http:localhost -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting PASS) -PASS: PASS -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. - - -Testing: source origin: http://127.0.0.1:8000 destination origin: http:localhost allowing subdomains -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting PASS) -PASS: PASS -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. - - -Testing: source origin: http://127.0.0.1:8000 destination origin: hTtP:LoCaLhOsT allowing subdomains -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting PASS) -PASS: PASS -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. - - -Testing: source origin: http://127.0.0.1:8000 destination origin: http: allowing subdomains -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting PASS) -PASS: PASS -Loading: http://localhost:8000/xmlhttprequest/resources/get.txt (expecting NETWORK_ERR) -PASS: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/xmlhttprequest/resources/get.txt'. - - -
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal.html deleted file mode 100644 index 36540a1..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-removal.html +++ /dev/null
@@ -1,51 +0,0 @@ -<p>Tests the behavior of whitelisting origins and removing them later.</p> - -<pre id="console"></pre> -<script> -testRunner.dumpAsText(); - -function log(message) -{ - document.getElementById("console").appendChild(document.createTextNode(message + "\n")); -} - -function loadURL(url, expectSuccess) -{ - log("Loading: " + url + " " + (expectSuccess ? "(expecting PASS)" : "(expecting NETWORK_ERR)")); - - var req = new XMLHttpRequest(); - req.open("GET", url, false); - try { - req.send(null); - log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText); - } catch (e) { - log((expectSuccess ? "FAIL: " : "PASS: ") + e); - } -} - -function test(origin, protocol, host, subdomains, url) -{ - log("Testing: source origin: " + origin + " destination origin: " + protocol + ":" + host + " " + (subdomains ? "allowing subdomains" : "")); - - loadURL(url, false); - - testRunner.addOriginAccessWhitelistEntry(origin, protocol.toLowerCase(), host.toLowerCase(), subdomains); - - loadURL(url, true); - - testRunner.removeOriginAccessWhitelistEntry(origin, protocol, host, subdomains); - - loadURL(url, false); - - log("\n"); -} - -var tests = [ - ["http://127.0.0.1:8000", "http", "localhost", false, "http://localhost:8000/xmlhttprequest/resources/get.txt"], - ["http://127.0.0.1:8000", "http", "localhost", true, "http://localhost:8000/xmlhttprequest/resources/get.txt"], - ["http://127.0.0.1:8000", "hTtP", "LoCaLhOsT", true, "http://localhost:8000/xmlhttprequest/resources/get.txt"], - ["http://127.0.0.1:8000", "http", "", true, "http://localhost:8000/xmlhttprequest/resources/get.txt"] -]; - -tests.forEach(function(testEntry) { test.apply(null, testEntry) }); -</script>
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/imperative-api.html b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api.html index 76fb8e9..d56438b 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/imperative-api.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api.html
@@ -18,6 +18,10 @@ </div> <div id="host3"> </div> +<div id="child4"></div> +<div id="host4"> + <div id="child5"></div> +</div> <script> @@ -28,9 +32,18 @@ const child1 = document.querySelector('#child1'); const child2 = document.querySelector('#child2'); const child3 = document.querySelector('#child3'); +const child4 = document.querySelector('#child4'); +const child5 = document.querySelector('#child5'); const shadow_root = host.attachShadow({ mode: 'open', slotting: 'manual' }); +const shadow_root1 = host4.attachShadow({ mode: 'open' }); const slot1 = document.createElement('slot'); +const slot2 = document.createElement('slot'); +const slot3 = document.createElement('slot'); +const slot4 = document.createElement('slot'); shadow_root.appendChild(slot1); +shadow_root.appendChild(slot2); +shadow_root.appendChild(slot3); +shadow_root1.appendChild(slot4); test(() => { assert_not_equals(host1.attachShadow({ mode: 'open', slotting: 'manual' }), @@ -44,9 +57,34 @@ test(() => { assert_array_equals(slot1.assignedElements(), []); + assert_equals(child1.assignedSlot, null); + slot1.assign([child1]); + assert_array_equals(slot1.assignedNodes(), [child1]); + assert_equals(child1.assignedSlot, slot1); + + slot2.assign([child1]); + assert_array_equals(slot1.assignedNodes(), []); + assert_equals(child1.assignedSlot, slot2); + slot1.assign([child2,child3]); assert_array_equals(slot1.assignedNodes(), [child2,child3]); }, 'assignedNodes can be used in manual slotting'); + +test(() => { + slot3.assign([child4]); + assert_array_equals(slot3.assignedNodes(), []); +}, 'Nodes that is not connected to host should not be assigned'); + +test(() => { + assert_array_equals(slot4.assignedNodes(), [child5]); + assert_equals(child5.assignedSlot, slot4); + + slot4.assign([]); + assert_array_equals(slot4.assignedNodes(), [child5]); + assert_equals(child5.assignedSlot, slot4); +}, 'slotting API should not have any effect in auto mode'); + + </script>
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/v0/reattach-content-parent-crash.html b/third_party/WebKit/LayoutTests/shadow-dom/v0/reattach-content-parent-crash.html new file mode 100644 index 0000000..ffa1c4bd --- /dev/null +++ b/third_party/WebKit/LayoutTests/shadow-dom/v0/reattach-content-parent-crash.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<div id="host"><option></option></div> +<script> + test(() => { + const root = host.createShadowRoot(); + root.innerHTML = '<span style="display:none"><content /></span>'; + document.body.offsetTop; + root.firstChild.style.display = "block"; + }, "This test passes if there is no crash or DCHECK failure."); +</script>
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt new file mode 100644 index 0000000..7fdad0e --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt
@@ -0,0 +1,18 @@ +Absolute +Relative +Fixed +x x +Table Content +In Columns +Transformed +In RTL overflow +PASS: event at (109, 57) hit absolute at offset (19, 22) +PASS: event at (161, 13) hit relative at offset (21, 18) +PASS: event at (40, 297) hit table-content at offset (5, 8) +FAIL: event at (122, 407) expected to hit transformed at (8, 5) but hit transformed at (7.713230133056641, 5.262882232666016) +PASS: event at (573, 480) hit inside-overflow at offset (2, 9) +FAIL: event at (707, 174) expected to hit in-columns at (87, 13) but hit in-columns at (87.34375, 13) +PASS: event at (241, 67) hit fixed at offset (31, 7) +PASS: event at (244, 102) hit fixed at offset (34, 42) +PASS: event at (388, 88) hit fixed at offset (178, 28) +
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt new file mode 100644 index 0000000..e8e562f --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt
@@ -0,0 +1,24 @@ +Absolute position +Relative position +Fixed position +First Second +This cell has borderTopExtra +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +In columns +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +Div with transform +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + +In RTL overflow +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +PASS: event hit abs-box at offset (17, 22) +PASS: event hit rel-box at offset (22, 24) +PASS: event hit fixed-box at offset (10, 10) +PASS: event hit with-bordertopextra at offset (4, 4) +FAIL: event expected to hit in-columns at (35, 5) but hit in-columns at (34.8125, 5) +PASS: event hit inside-overflow at offset (7, 6) +FAIL: event expected to hit transformed at (11, 16) but hit transformed at (10.535758972167969, 15.941521644592285) +
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt index 067f2d1..3a7aaba 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -32,6 +32,7 @@ [Worker] getter downloaded [Worker] getter id [Worker] getter onprogress +[Worker] getter state [Worker] getter uploadTotal [Worker] getter uploaded [Worker] method abort
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index c93387d..7b252d6e 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -429,6 +429,7 @@ getter downloaded getter id getter onprogress + getter state getter uploadTotal getter uploaded method abort
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt index c44a629..d3fd915 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -32,6 +32,7 @@ [Worker] getter downloaded [Worker] getter id [Worker] getter onprogress +[Worker] getter state [Worker] getter uploadTotal [Worker] getter uploaded [Worker] method abort
diff --git a/third_party/blink/common/BUILD.gn b/third_party/blink/common/BUILD.gn index 6af196f..64379e7 100644 --- a/third_party/blink/common/BUILD.gn +++ b/third_party/blink/common/BUILD.gn
@@ -66,6 +66,15 @@ if (!is_ios) { deps += [ "//media" ] } + + if (is_android) { + sources += [ + "font_unique_name_lookup/font_table_matcher.cc", + "font_unique_name_lookup/icu_fold_case_util.cc", + ] + + deps += [ "//third_party/icu" ] + } } test("blink_common_unittests") { @@ -98,13 +107,6 @@ "test/run_all_unittests.cc", ] - if (!is_android) { - # TODO(crbug.com/845384): Enable these tests also on Android. Currently - # they are excluded as they require V8 environment but V8 snapshot is - # not available in the current minimum test setting. - sources += [ "message_port/string_message_codec_unittest.cc" ] - } - deps = [ "//base", "//base/test:test_support", @@ -115,4 +117,18 @@ "//v8", "//v8:v8_libplatform", ] + + if (!is_android) { + # TODO(crbug.com/845384): Enable these tests also on Android. Currently + # they are excluded as they require V8 environment but V8 snapshot is + # not available in the current minimum test setting. + sources += [ "message_port/string_message_codec_unittest.cc" ] + } else { + # is_android + sources += [ + "font_unique_name_lookup/font_table_matcher_unittest.cc", + "font_unique_name_lookup/icu_fold_case_util_unittest.cc", + ] + deps += [ ":common" ] + } }
diff --git a/third_party/blink/common/DEPS b/third_party/blink/common/DEPS index 2e888778..ddc8edb 100644 --- a/third_party/blink/common/DEPS +++ b/third_party/blink/common/DEPS
@@ -17,6 +17,7 @@ "+third_party/blink/common", "+third_party/blink/public/common", "+third_party/blink/public/mojom", + "+third_party/icu/source/common/unicode/unistr.h", "+ui/gfx/geometry", "+url", ]
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 28ddf74940..48b48ca 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -7,6 +7,9 @@ namespace blink { namespace features { +const base::Feature kAutofillPreviewStyleExperiment{ + "AutofillPreviewStyleExperiment", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enable eagerly setting up a CacheStorage interface pointer and // passing it to service workers on startup as an optimization. const base::Feature kEagerCacheStorageSetupForServiceWorkers{ @@ -48,5 +51,9 @@ const base::Feature kStopNonTimersInBackground{ "stop-non-timers-in-background", base::FEATURE_DISABLED_BY_DEFAULT}; +const char kAutofillPreviewStyleExperimentBgColorParameterName[] = "bg_color"; + +const char kAutofillPreviewStyleExperimentColorParameterName[] = "color"; + } // namespace features } // namespace blink
diff --git a/content/browser/font_unique_name_lookup/font_table_matcher.cc b/third_party/blink/common/font_unique_name_lookup/font_table_matcher.cc similarity index 91% rename from content/browser/font_unique_name_lookup/font_table_matcher.cc rename to third_party/blink/common/font_unique_name_lookup/font_table_matcher.cc index d049014..b647d268 100644 --- a/content/browser/font_unique_name_lookup/font_table_matcher.cc +++ b/third_party/blink/common/font_unique_name_lookup/font_table_matcher.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/font_unique_name_lookup/font_table_matcher.h" +#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h" #include "base/strings/utf_string_conversions.h" -#include "content/browser/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" #include <algorithm> -namespace content { +namespace blink { FontTableMatcher::FontTableMatcher( const base::ReadOnlySharedMemoryMapping& mapping) { @@ -67,4 +67,4 @@ return intersection_result.empty(); } -} // namespace content +} // namespace blink
diff --git a/content/browser/font_unique_name_lookup/font_table_matcher_unittest.cc b/third_party/blink/common/font_unique_name_lookup/font_table_matcher_unittest.cc similarity index 84% rename from content/browser/font_unique_name_lookup/font_table_matcher_unittest.cc rename to third_party/blink/common/font_unique_name_lookup/font_table_matcher_unittest.cc index 3cf9164c..6fd6fb9 100644 --- a/content/browser/font_unique_name_lookup/font_table_matcher_unittest.cc +++ b/third_party/blink/common/font_unique_name_lookup/font_table_matcher_unittest.cc
@@ -2,29 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/font_unique_name_lookup/font_table_matcher.h" -#include "content/browser/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" namespace { const char kTestFilePath1[] = "tmp/test/font1.ttf"; const char kDummyAndroidBuildFingerPrint[] = "A"; void PopulateFontUniqueNameEntry( - content::FontUniqueNameTable_FontUniqueNameEntry* entry, + blink::FontUniqueNameTable_FontUniqueNameEntry* entry, const std::string& path, int32_t ttc_index, const std::string& full_name, const std::string& postscript_name) { entry->set_file_path(path); entry->set_ttc_index(ttc_index); - entry->set_full_name(content::IcuFoldCase(full_name)); - entry->set_postscript_name(content::IcuFoldCase(postscript_name)); + entry->set_full_name(blink::IcuFoldCase(full_name)); + entry->set_postscript_name(blink::IcuFoldCase(postscript_name)); } } // namespace -namespace content { +namespace blink { class FontTableMatcherTest : public ::testing::Test { protected: @@ -69,4 +69,4 @@ ASSERT_FALSE(result.has_value()); } -} // namespace content +} // namespace blink
diff --git a/content/browser/font_unique_name_lookup/icu_fold_case_util.cc b/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util.cc similarity index 72% rename from content/browser/font_unique_name_lookup/icu_fold_case_util.cc rename to third_party/blink/common/font_unique_name_lookup/icu_fold_case_util.cc index d24a0ec..048679c 100644 --- a/content/browser/font_unique_name_lookup/icu_fold_case_util.cc +++ b/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util.cc
@@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/icu/source/common/unicode/unistr.h" -namespace content { +namespace blink { std::string IcuFoldCase(const std::string& name_request) { icu_62::UnicodeString name_request_unicode = @@ -15,4 +16,4 @@ return name_request_lower; } -} // namespace content +} // namespace blink
diff --git a/content/browser/font_unique_name_lookup/icu_fold_case_util_unittest.cc b/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util_unittest.cc similarity index 84% rename from content/browser/font_unique_name_lookup/icu_fold_case_util_unittest.cc rename to third_party/blink/common/font_unique_name_lookup/icu_fold_case_util_unittest.cc index ca4abc3..12b3d5d 100644 --- a/content/browser/font_unique_name_lookup/icu_fold_case_util_unittest.cc +++ b/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util_unittest.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/font_unique_name_lookup/icu_fold_case_util.h" +#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" #include "testing/gtest/include/gtest/gtest.h" -namespace content { +namespace blink { TEST(IcuFoldCaseUtilTest, FoldingExamples) { ASSERT_EQ(IcuFoldCase("Roboto Condensed Bold Italic"), @@ -18,4 +18,4 @@ IcuFoldCase("скорбь сходит щедрот")); } -} // namespace content +} // namespace blink
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn index 508f22f..545af712 100644 --- a/third_party/blink/public/BUILD.gn +++ b/third_party/blink/public/BUILD.gn
@@ -704,7 +704,6 @@ "platform/modules/cache_storage/cache_storage.mojom", "platform/modules/credentialmanager/credential_manager.mojom", "platform/modules/fetch/fetch_api_request.mojom", - "platform/modules/font_unique_name_lookup/font_unique_name_lookup.mojom", "platform/modules/geolocation/geolocation_service.mojom", "platform/modules/hyphenation/hyphenation.mojom", "platform/modules/insecure_input/insecure_input_service.mojom", @@ -774,6 +773,7 @@ "platform/input_host.mojom", "platform/input_messages.mojom", "platform/modules/document_metadata/copyless_paste.mojom", + "platform/modules/font_unique_name_lookup/font_unique_name_lookup.mojom", "platform/modules/installation/installation.mojom", "platform/modules/installedapp/installed_app_provider.mojom", "platform/modules/installedapp/related_application.mojom",
diff --git a/third_party/blink/public/common/BUILD.gn b/third_party/blink/public/common/BUILD.gn index 72fb8fb..b74382d 100644 --- a/third_party/blink/public/common/BUILD.gn +++ b/third_party/blink/public/common/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/compiler/compiler.gni") import("//build/config/features.gni") import("//testing/test.gni") +import("//third_party/protobuf/proto_library.gni") # Public common API headers, mojom and libraries that can be linked and # referenced both by browser-side and renderer-side components. @@ -83,4 +84,20 @@ if (!is_ios) { deps += [ "//media" ] } + + if (is_android) { + sources += [ + "font_unique_name_lookup/font_table_matcher.h", + "font_unique_name_lookup/icu_fold_case_util.h", + ] + deps += [ ":font_unique_name_table_proto" ] + } +} + +if (is_android) { + proto_library("font_unique_name_table_proto") { + sources = [ + "font_unique_name_lookup/font_unique_name_table.proto", + ] + } }
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index 64e6b07..98663c3 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -11,6 +11,7 @@ namespace blink { namespace features { +BLINK_COMMON_EXPORT extern const base::Feature kAutofillPreviewStyleExperiment; BLINK_COMMON_EXPORT extern const base::Feature kEagerCacheStorageSetupForServiceWorkers; BLINK_COMMON_EXPORT extern const base::Feature kLayoutNG; @@ -22,6 +23,11 @@ BLINK_COMMON_EXPORT extern const base::Feature kPortals; BLINK_COMMON_EXPORT extern const base::Feature kStopNonTimersInBackground; +BLINK_COMMON_EXPORT extern const char + kAutofillPreviewStyleExperimentBgColorParameterName[]; +BLINK_COMMON_EXPORT extern const char + kAutofillPreviewStyleExperimentColorParameterName[]; + } // namespace features } // namespace blink
diff --git a/content/browser/font_unique_name_lookup/font_table_matcher.h b/third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h similarity index 81% rename from content/browser/font_unique_name_lookup/font_table_matcher.h rename to third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h index 6d1cd701..290f6c0 100644 --- a/content/browser/font_unique_name_lookup/font_table_matcher.h +++ b/third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h
@@ -2,24 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_FONT_UNIQUE_NAME_LOOKUP_FONT_TABLE_MATCHER_H_ -#define CONTENT_BROWSER_FONT_UNIQUE_NAME_LOOKUP_FONT_TABLE_MATCHER_H_ +#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_FONT_UNIQUE_NAME_LOOKUP_FONT_TABLE_MATCHER_H_ +#define THIRD_PARTY_BLINK_PUBLIC_COMMON_FONT_UNIQUE_NAME_LOOKUP_FONT_TABLE_MATCHER_H_ #include "base/memory/read_only_shared_memory_region.h" -#include "content/browser/font_unique_name_lookup/font_unique_name_table.pb.h" -#include "content/common/content_export.h" +#include "third_party/blink/common/common_export.h" +#include "third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.pb.h" #include <stddef.h> #include <stdint.h> -namespace content { +namespace blink { // Parses a protobuf received in memory_mapping to build a font lookup // structure. Allows case-insensitively matching full font names or postscript -// font names aginst the parsed table by calling MatchName. Used in Blink for +// font names against the parsed table by calling MatchName. Used in Blink for // looking up // @font-face { src: local(<font_name>) } CSS font face src references. -class CONTENT_EXPORT FontTableMatcher { +class BLINK_COMMON_EXPORT FontTableMatcher { public: // Constructs a FontTableMatcher from a ReadOnlySharedMemoryMapping returned // by FontUniqueNameLookup. Internally parses the Protobuf structure in @@ -58,6 +58,6 @@ FontUniqueNameTable font_table_; }; -} // namespace content +} // namespace blink #endif // CONTENT_BROWSER_FONT_UNIQUE_NAME_LOOKUP_FONT_TABLE_MATCHER_H_
diff --git a/content/browser/font_unique_name_lookup/font_unique_name_table.proto b/third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.proto similarity index 96% rename from content/browser/font_unique_name_lookup/font_unique_name_table.proto rename to third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.proto index 6855749..4d9ae3c 100644 --- a/content/browser/font_unique_name_lookup/font_unique_name_table.proto +++ b/third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.proto
@@ -6,7 +6,7 @@ option optimize_for = LITE_RUNTIME; -package content; +package blink; message FontUniqueNameTable { // The Android build fingerprint for which this font list is stored.
diff --git a/third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h b/third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h new file mode 100644 index 0000000..86c94389 --- /dev/null +++ b/third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h
@@ -0,0 +1,21 @@ +// Copyright 2018 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_PUBLIC_COMMON_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL_H_ +#define THIRD_PARTY_BLINK_PUBLIC_COMMON_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL_H_ + +#include <string> +#include "third_party/blink/common/common_export.h" + +namespace blink { + +// Executes ICU's UnicodeString locale-independent foldCase method on +// |name_request| and returns a case folded string suitable for case-insensitive +// bitwise comparison. Used by FontTableMatcher and FontUniqueNameLookup for +// storing and comparing case folded font names. +std::string BLINK_COMMON_EXPORT IcuFoldCase(const std::string& name_request); + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_FONT_UNIQUE_NAME_LOOKUP_ICU_FOLD_CASE_UTIL_H_
diff --git a/third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom b/third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom index fb00f88..9b5f7dcd 100644 --- a/third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom +++ b/third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom
@@ -18,6 +18,12 @@ SERVICE_WORKER_UNAVAILABLE }; +enum BackgroundFetchState { + PENDING, + FAILURE, + SUCCESS +}; + // Represents the optional options a developer can provide when starting a new // Background Fetch fetch. Analogous to the following structure in the spec: // https://wicg.github.io/background-fetch/#background-fetch-manager
diff --git a/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h b/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h index d365482..0d21f81 100644 --- a/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h +++ b/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h
@@ -33,6 +33,7 @@ #include "base/time/time.h" #include "third_party/blink/public/common/message_port/transferable_message.h" +#include "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom-shared.h" #include "third_party/blink/public/platform/modules/service_worker/web_service_worker.h" #include "third_party/blink/public/platform/modules/service_worker/web_service_worker_registration.h" #include "third_party/blink/public/platform/web_canonical_cookie.h" @@ -67,25 +68,27 @@ virtual void DispatchActivateEvent(int event_id) = 0; - enum class BackgroundFetchState { kPending, kSucceeded, kFailed }; - virtual void DispatchBackgroundFetchAbortEvent( int event_id, const WebString& developer_id, - const WebString& unique_id) = 0; + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) = 0; virtual void DispatchBackgroundFetchClickEvent( int event_id, const WebString& developer_id, - const WebString& unique_id) = 0; + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) = 0; virtual void DispatchBackgroundFetchFailEvent( int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) = 0; virtual void DispatchBackgroundFetchSuccessEvent( int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) = 0; virtual void DispatchCookieChangeEvent( int event_id,
diff --git a/third_party/blink/public/web/web_security_policy.h b/third_party/blink/public/web/web_security_policy.h index e5f6f27..571c86f 100644 --- a/third_party/blink/public/web/web_security_policy.h +++ b/third_party/blink/public/web/web_security_policy.h
@@ -70,11 +70,6 @@ const WebString& destination_protocol, const WebString& destination_host, bool allow_destination_subdomains); - BLINK_EXPORT static void RemoveOriginAccessWhitelistEntry( - const WebURL& source_origin, - const WebString& destination_protocol, - const WebString& destination_host, - bool allow_destination_subdomains); BLINK_EXPORT static void RemoveAllOriginAccessWhitelistEntriesForOrigin( const WebURL& source_origin); BLINK_EXPORT static void ResetOriginAccessWhitelists();
diff --git a/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl b/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl index ab82d38..09622ad 100644 --- a/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl +++ b/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl
@@ -146,6 +146,110 @@ {% endif %} } +{% if idl_type == 'any' %} +v8::Maybe<{{return_cpp_type}}> {{cpp_class}}::Construct({{argument_declarations[1:] | join(', ')}}) { + // This function implements "construct" algorithm defined in + // "3.10. Invoking callback functions". + // https://heycam.github.io/webidl/#construct-a-callback-function + + if (!IsCallbackFunctionRunnable(CallbackRelevantScriptState(), + IncumbentScriptState())) { + // Wrapper-tracing for the callback function makes the function object and + // its creation context alive. Thus it's safe to use the creation context + // of the callback function here. + v8::HandleScope handle_scope(GetIsolate()); + CHECK(!CallbackFunction().IsEmpty()); + v8::Context::Scope context_scope(CallbackFunction()->CreationContext()); + V8ThrowException::ThrowError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "{{callback_function_name}}", + "The provided callback is no longer runnable.")); + return v8::Nothing<{{return_cpp_type}}>(); + } + + // step 7. Prepare to run script with relevant settings. + ScriptState::Scope callback_relevant_context_scope( + CallbackRelevantScriptState()); + // step 8. Prepare to run a callback with stored settings. + v8::Context::BackupIncumbentScope backup_incumbent_scope( + IncumbentScriptState()->GetContext()); + + // step 3. If ! IsConstructor(F) is false, throw a TypeError exception. + // + // Note that step 7. and 8. are side effect free (except for a very rare + // exception due to no incumbent realm), so it's okay to put step 3. after + // step 7. and 8. + if (!CallbackFunction()->IsConstructor()) { + V8ThrowException::ThrowTypeError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "{{callback_function_name}}", + "The provided callback is not a constructor.")); + return v8::Nothing<{{return_cpp_type}}>(); + } + + // step 9. Let esArgs be the result of converting args to an ECMAScript + // arguments list. If this throws an exception, set completion to the + // completion value representing the thrown exception and jump to the step + // labeled return. + {% if arguments %} + v8::Local<v8::Object> argument_creation_context = + CallbackRelevantScriptState()->GetContext()->Global(); + ALLOW_UNUSED_LOCAL(argument_creation_context); + {% set has_variadic_argument = arguments[-1].is_variadic %} + {% set non_variadic_arguments = arguments | rejectattr('is_variadic') | list %} + {% set variadic_argument = arguments[-1] if has_variadic_argument else None %} + {% set arguments_length = '%d + %s.size()' % (non_variadic_arguments|length, variadic_argument.name) if has_variadic_argument else non_variadic_arguments|length %} + {% for argument in non_variadic_arguments %} + v8::Local<v8::Value> {{argument.v8_name}} = {{argument.cpp_value_to_v8_value}}; + {% endfor %} + {% if has_variadic_argument %} + const int argc = {{arguments_length}}; + v8::Local<v8::Value> argv[argc]; + {% for argument in non_variadic_arguments %} + argv[{{loop.index0}}] = {{argument.v8_name}}; + {% endfor %} + for (wtf_size_t i = 0; i < {{variadic_argument.name}}.size(); ++i) { + argv[{{non_variadic_arguments|length}} + i] = ToV8({{variadic_argument.name}}[i], argument_creation_context, GetIsolate()); + } + {% else %}{# if has_variadic_argument #} + constexpr int argc = {{arguments_length}}; + v8::Local<v8::Value> argv[] = { {{non_variadic_arguments | join(', ', 'v8_name')}} }; + static_assert(static_cast<size_t>(argc) == base::size(argv), "size mismatch"); + {% endif %} + {% else %}{# if arguments #} + const int argc = 0; + {# Zero-length arrays are ill-formed in C++. #} + v8::Local<v8::Value> *argv = nullptr; + {% endif %} + + // step 10. Let callResult be Construct(F, esArgs). + v8::Local<v8::Value> call_result; + if (!V8ScriptRunner::CallAsConstructor( + GetIsolate(), + CallbackFunction(), + ExecutionContext::From(CallbackRelevantScriptState()), + argc, + argv).ToLocal(&call_result)) { + // step 11. If callResult is an abrupt completion, set completion to + // callResult and jump to the step labeled return. + return v8::Nothing<{{return_cpp_type}}>(); + } + + // step 12. Set completion to the result of converting callResult.[[Value]] to + // an IDL value of the same type as the operation's return type. + ExceptionState exceptionState(GetIsolate(), + ExceptionState::kExecutionContext, + "{{callback_function_name}}", + "construct"); + {{v8_value_to_local_cpp_value(return_value_conversion) | trim | indent(2)}} + return v8::Just<{{return_cpp_type}}>(native_result); +} +{% endif %} + {% if idl_type == 'void' or callback_function_name == 'Function' %} void {{cpp_class}}::InvokeAndReportException({{argument_declarations | join(', ')}}) { v8::TryCatch try_catch(GetIsolate());
diff --git a/third_party/blink/renderer/bindings/templates/callback_function.h.tmpl b/third_party/blink/renderer/bindings/templates/callback_function.h.tmpl index fdea79a..80dc70c 100644 --- a/third_party/blink/renderer/bindings/templates/callback_function.h.tmpl +++ b/third_party/blink/renderer/bindings/templates/callback_function.h.tmpl
@@ -30,6 +30,15 @@ // https://heycam.github.io/webidl/#es-invoking-callback-functions v8::Maybe<{{return_cpp_type}}> Invoke({{argument_declarations | join(', ')}}) WARN_UNUSED_RESULT; +{# Web IDL does not distinguish callback constructors from callback functions. + If the return type is 'any', then it\'s likely to be used as a callback + constructor. #} +{% if idl_type == 'any' %} + // Performs "construct". + // https://heycam.github.io/webidl/#construct-a-callback-function + v8::Maybe<{{return_cpp_type}}> Construct({{argument_declarations[1:] | join(', ')}}) WARN_UNUSED_RESULT; +{% endif %} + {# Type Function is often used as a sort of wild cards, and its return value is often discarded. So, this provides some convenience. #} {% if idl_type == 'void' or callback_function_name == 'Function' %}
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc index 8e197ed1..f917ea3 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc
@@ -108,6 +108,85 @@ } } +v8::Maybe<ScriptValue> V8AnyCallbackFunctionOptionalAnyArg::Construct(ScriptValue optionalAnyArg) { + // This function implements "construct" algorithm defined in + // "3.10. Invoking callback functions". + // https://heycam.github.io/webidl/#construct-a-callback-function + + if (!IsCallbackFunctionRunnable(CallbackRelevantScriptState(), + IncumbentScriptState())) { + // Wrapper-tracing for the callback function makes the function object and + // its creation context alive. Thus it's safe to use the creation context + // of the callback function here. + v8::HandleScope handle_scope(GetIsolate()); + CHECK(!CallbackFunction().IsEmpty()); + v8::Context::Scope context_scope(CallbackFunction()->CreationContext()); + V8ThrowException::ThrowError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "AnyCallbackFunctionOptionalAnyArg", + "The provided callback is no longer runnable.")); + return v8::Nothing<ScriptValue>(); + } + + // step 7. Prepare to run script with relevant settings. + ScriptState::Scope callback_relevant_context_scope( + CallbackRelevantScriptState()); + // step 8. Prepare to run a callback with stored settings. + v8::Context::BackupIncumbentScope backup_incumbent_scope( + IncumbentScriptState()->GetContext()); + + // step 3. If ! IsConstructor(F) is false, throw a TypeError exception. + // + // Note that step 7. and 8. are side effect free (except for a very rare + // exception due to no incumbent realm), so it's okay to put step 3. after + // step 7. and 8. + if (!CallbackFunction()->IsConstructor()) { + V8ThrowException::ThrowTypeError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "AnyCallbackFunctionOptionalAnyArg", + "The provided callback is not a constructor.")); + return v8::Nothing<ScriptValue>(); + } + + // step 9. Let esArgs be the result of converting args to an ECMAScript + // arguments list. If this throws an exception, set completion to the + // completion value representing the thrown exception and jump to the step + // labeled return. + v8::Local<v8::Object> argument_creation_context = + CallbackRelevantScriptState()->GetContext()->Global(); + ALLOW_UNUSED_LOCAL(argument_creation_context); + v8::Local<v8::Value> v8_optionalAnyArg = optionalAnyArg.V8Value(); + constexpr int argc = 1; + v8::Local<v8::Value> argv[] = { v8_optionalAnyArg }; + static_assert(static_cast<size_t>(argc) == base::size(argv), "size mismatch"); + + // step 10. Let callResult be Construct(F, esArgs). + v8::Local<v8::Value> call_result; + if (!V8ScriptRunner::CallAsConstructor( + GetIsolate(), + CallbackFunction(), + ExecutionContext::From(CallbackRelevantScriptState()), + argc, + argv).ToLocal(&call_result)) { + // step 11. If callResult is an abrupt completion, set completion to + // callResult and jump to the step labeled return. + return v8::Nothing<ScriptValue>(); + } + + // step 12. Set completion to the result of converting callResult.[[Value]] to + // an IDL value of the same type as the operation's return type. + ExceptionState exceptionState(GetIsolate(), + ExceptionState::kExecutionContext, + "AnyCallbackFunctionOptionalAnyArg", + "construct"); + ScriptValue native_result = ScriptValue(ScriptState::Current(GetIsolate()), call_result); + return v8::Just<ScriptValue>(native_result); +} + v8::Maybe<ScriptValue> V8PersistentCallbackFunction<V8AnyCallbackFunctionOptionalAnyArg>::Invoke(ScriptWrappable* callback_this_value, ScriptValue optionalAnyArg) { return Proxy()->Invoke( callback_this_value, optionalAnyArg);
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.h b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.h index ef4f353e..7289f9d 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.h +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.h
@@ -34,6 +34,10 @@ // https://heycam.github.io/webidl/#es-invoking-callback-functions v8::Maybe<ScriptValue> Invoke(ScriptWrappable* callback_this_value, ScriptValue optionalAnyArg) WARN_UNUSED_RESULT; + // Performs "construct". + // https://heycam.github.io/webidl/#construct-a-callback-function + v8::Maybe<ScriptValue> Construct(ScriptValue optionalAnyArg) WARN_UNUSED_RESULT; + private: explicit V8AnyCallbackFunctionOptionalAnyArg(v8::Local<v8::Function> callback_function) : CallbackFunctionBase(callback_function) {}
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc index 83940c5f..e17091c 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc
@@ -109,6 +109,86 @@ } } +v8::Maybe<ScriptValue> V8AnyCallbackFunctionVariadicAnyArgs::Construct(const Vector<ScriptValue>& arguments) { + // This function implements "construct" algorithm defined in + // "3.10. Invoking callback functions". + // https://heycam.github.io/webidl/#construct-a-callback-function + + if (!IsCallbackFunctionRunnable(CallbackRelevantScriptState(), + IncumbentScriptState())) { + // Wrapper-tracing for the callback function makes the function object and + // its creation context alive. Thus it's safe to use the creation context + // of the callback function here. + v8::HandleScope handle_scope(GetIsolate()); + CHECK(!CallbackFunction().IsEmpty()); + v8::Context::Scope context_scope(CallbackFunction()->CreationContext()); + V8ThrowException::ThrowError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "AnyCallbackFunctionVariadicAnyArgs", + "The provided callback is no longer runnable.")); + return v8::Nothing<ScriptValue>(); + } + + // step 7. Prepare to run script with relevant settings. + ScriptState::Scope callback_relevant_context_scope( + CallbackRelevantScriptState()); + // step 8. Prepare to run a callback with stored settings. + v8::Context::BackupIncumbentScope backup_incumbent_scope( + IncumbentScriptState()->GetContext()); + + // step 3. If ! IsConstructor(F) is false, throw a TypeError exception. + // + // Note that step 7. and 8. are side effect free (except for a very rare + // exception due to no incumbent realm), so it's okay to put step 3. after + // step 7. and 8. + if (!CallbackFunction()->IsConstructor()) { + V8ThrowException::ThrowTypeError( + GetIsolate(), + ExceptionMessages::FailedToExecute( + "construct", + "AnyCallbackFunctionVariadicAnyArgs", + "The provided callback is not a constructor.")); + return v8::Nothing<ScriptValue>(); + } + + // step 9. Let esArgs be the result of converting args to an ECMAScript + // arguments list. If this throws an exception, set completion to the + // completion value representing the thrown exception and jump to the step + // labeled return. + v8::Local<v8::Object> argument_creation_context = + CallbackRelevantScriptState()->GetContext()->Global(); + ALLOW_UNUSED_LOCAL(argument_creation_context); + const int argc = 0 + arguments.size(); + v8::Local<v8::Value> argv[argc]; + for (wtf_size_t i = 0; i < arguments.size(); ++i) { + argv[0 + i] = ToV8(arguments[i], argument_creation_context, GetIsolate()); + } + + // step 10. Let callResult be Construct(F, esArgs). + v8::Local<v8::Value> call_result; + if (!V8ScriptRunner::CallAsConstructor( + GetIsolate(), + CallbackFunction(), + ExecutionContext::From(CallbackRelevantScriptState()), + argc, + argv).ToLocal(&call_result)) { + // step 11. If callResult is an abrupt completion, set completion to + // callResult and jump to the step labeled return. + return v8::Nothing<ScriptValue>(); + } + + // step 12. Set completion to the result of converting callResult.[[Value]] to + // an IDL value of the same type as the operation's return type. + ExceptionState exceptionState(GetIsolate(), + ExceptionState::kExecutionContext, + "AnyCallbackFunctionVariadicAnyArgs", + "construct"); + ScriptValue native_result = ScriptValue(ScriptState::Current(GetIsolate()), call_result); + return v8::Just<ScriptValue>(native_result); +} + v8::Maybe<ScriptValue> V8PersistentCallbackFunction<V8AnyCallbackFunctionVariadicAnyArgs>::Invoke(ScriptWrappable* callback_this_value, const Vector<ScriptValue>& arguments) { return Proxy()->Invoke( callback_this_value, arguments);
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.h b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.h index b3d6bb9..7b0c18c5 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.h +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.h
@@ -34,6 +34,10 @@ // https://heycam.github.io/webidl/#es-invoking-callback-functions v8::Maybe<ScriptValue> Invoke(ScriptWrappable* callback_this_value, const Vector<ScriptValue>& arguments) WARN_UNUSED_RESULT; + // Performs "construct". + // https://heycam.github.io/webidl/#construct-a-callback-function + v8::Maybe<ScriptValue> Construct(const Vector<ScriptValue>& arguments) WARN_UNUSED_RESULT; + private: explicit V8AnyCallbackFunctionVariadicAnyArgs(v8::Local<v8::Function> callback_function) : CallbackFunctionBase(callback_function) {}
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.cc b/third_party/blink/renderer/core/css/css_style_sheet.cc index d4dbe6ad..a8c013f 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.cc +++ b/third_party/blink/renderer/core/css/css_style_sheet.cc
@@ -92,11 +92,6 @@ } CSSStyleSheet* CSSStyleSheet::Create(Document& document, - ExceptionState& exception_state) { - return CSSStyleSheet::Create(document, CSSStyleSheetInit(), exception_state); -} - -CSSStyleSheet* CSSStyleSheet::Create(Document& document, const CSSStyleSheetInit& options, ExceptionState& exception_state) { if (!RuntimeEnabledFeatures::ConstructableStylesheetsEnabled()) {
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.h b/third_party/blink/renderer/core/css/css_style_sheet.h index 2ee79dd..7dc0ace 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.h +++ b/third_party/blink/renderer/core/css/css_style_sheet.h
@@ -53,7 +53,6 @@ public: static const Document* SingleOwnerDocument(const CSSStyleSheet*); - static CSSStyleSheet* Create(Document&, ExceptionState&); static CSSStyleSheet* Create(Document&, const CSSStyleSheetInit&, ExceptionState&); @@ -196,6 +195,11 @@ FRIEND_TEST_ALL_PREFIXES( CSSStyleSheetTest, CSSStyleSheetConstructionWithNonEmptyCSSStyleSheetInit); + FRIEND_TEST_ALL_PREFIXES(CSSStyleSheetTest, + CreateEmptyCSSStyleSheetWithEmptyCSSStyleSheetInit); + FRIEND_TEST_ALL_PREFIXES( + CSSStyleSheetTest, + CreateEmptyCSSStyleSheetWithNonEmptyCSSStyleSheetInit); FRIEND_TEST_ALL_PREFIXES( CSSStyleSheetTest, CreateCSSStyleSheetWithEmptyCSSStyleSheetInitAndText);
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.idl b/third_party/blink/renderer/core/css/css_style_sheet.idl index b70b9fe6..1251d19 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.idl +++ b/third_party/blink/renderer/core/css/css_style_sheet.idl
@@ -21,9 +21,6 @@ // https://drafts.csswg.org/cssom/#the-cssstylesheet-interface [ - ConstructorCallWith=Document, - RaisesException=Constructor, - Constructor(optional CSSStyleSheetInit options), Exposed=Window ] interface CSSStyleSheet : StyleSheet { readonly attribute CSSRule? ownerRule;
diff --git a/third_party/blink/renderer/core/css/css_style_sheet_test.cc b/third_party/blink/renderer/core/css/css_style_sheet_test.cc index d4b1bf77..234c688 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet_test.cc +++ b/third_party/blink/renderer/core/css/css_style_sheet_test.cc
@@ -49,26 +49,12 @@ TEST_F(CSSStyleSheetTest, ConstructorWithoutRuntimeFlagThrowsException) { DummyExceptionStateForTesting exception_state; RuntimeEnabledFeatures::SetConstructableStylesheetsEnabled(false); - EXPECT_EQ(CSSStyleSheet::Create(GetDocument(), exception_state), nullptr); + EXPECT_EQ(CSSStyleSheet::Create(GetDocument(), CSSStyleSheetInit(), + exception_state), + nullptr); ASSERT_TRUE(exception_state.HadException()); } -TEST_F(CSSStyleSheetTest, CSSStyleSheetConstructionWithEmptyCSSStyleSheetInit) { - DummyExceptionStateForTesting exception_state; - CSSStyleSheet* sheet = CSSStyleSheet::Create(GetDocument(), exception_state); - ASSERT_FALSE(exception_state.HadException()); - EXPECT_TRUE(sheet->href().IsNull()); - EXPECT_EQ(sheet->parentStyleSheet(), nullptr); - EXPECT_EQ(sheet->ownerNode(), nullptr); - EXPECT_EQ(sheet->ownerRule(), nullptr); - EXPECT_EQ(sheet->media()->length(), 0U); - EXPECT_EQ(sheet->title(), StringImpl::empty_); - EXPECT_FALSE(sheet->AlternateFromConstructor()); - EXPECT_FALSE(sheet->disabled()); - EXPECT_EQ(sheet->cssRules(exception_state)->length(), 0U); - ASSERT_FALSE(exception_state.HadException()); -} - TEST_F(CSSStyleSheetTest, CSSStyleSheetConstructionWithNonEmptyCSSStyleSheetInit) { DummyExceptionStateForTesting exception_state; @@ -93,6 +79,48 @@ ASSERT_FALSE(exception_state.HadException()); } +TEST_F(CSSStyleSheetTest, CreateEmptyCSSStyleSheetWithEmptyCSSStyleSheetInit) { + V8TestingScope scope; + DummyExceptionStateForTesting exception_state; + CSSStyleSheet* sheet = GetDocument().createEmptyCSSStyleSheet( + scope.GetScriptState(), CSSStyleSheetInit(), exception_state); + ASSERT_FALSE(exception_state.HadException()); + EXPECT_TRUE(sheet->href().IsNull()); + EXPECT_EQ(sheet->parentStyleSheet(), nullptr); + EXPECT_EQ(sheet->ownerNode(), nullptr); + EXPECT_EQ(sheet->ownerRule(), nullptr); + EXPECT_EQ(sheet->media()->length(), 0U); + EXPECT_EQ(sheet->title(), StringImpl::empty_); + EXPECT_FALSE(sheet->AlternateFromConstructor()); + EXPECT_FALSE(sheet->disabled()); + EXPECT_EQ(sheet->cssRules(exception_state)->length(), 0U); + ASSERT_FALSE(exception_state.HadException()); +} + +TEST_F(CSSStyleSheetTest, + CreateEmptyCSSStyleSheetWithNonEmptyCSSStyleSheetInit) { + CSSStyleSheetInit init; + init.setMedia(MediaListOrString::FromString("screen, print")); + init.setTitle("test"); + init.setAlternate(true); + init.setDisabled(true); + V8TestingScope scope; + DummyExceptionStateForTesting exception_state; + CSSStyleSheet* sheet = GetDocument().createEmptyCSSStyleSheet( + scope.GetScriptState(), init, exception_state); + ASSERT_FALSE(exception_state.HadException()); + EXPECT_TRUE(sheet->href().IsNull()); + EXPECT_EQ(sheet->parentStyleSheet(), nullptr); + EXPECT_EQ(sheet->ownerNode(), nullptr); + EXPECT_EQ(sheet->ownerRule(), nullptr); + EXPECT_EQ(sheet->media()->length(), 2U); + EXPECT_EQ(sheet->media()->mediaText(), init.media().GetAsString()); + EXPECT_EQ(sheet->title(), init.title()); + EXPECT_TRUE(sheet->AlternateFromConstructor()); + EXPECT_TRUE(sheet->disabled()); + ASSERT_FALSE(exception_state.HadException()); +} + TEST_F(CSSStyleSheetTest, CreateCSSStyleSheetWithEmptyCSSStyleSheetInitAndText) { V8TestingScope scope;
diff --git a/third_party/blink/renderer/core/css/html.css b/third_party/blink/renderer/core/css/html.css index d5305dee..8318d47 100644 --- a/third_party/blink/renderer/core/css/html.css +++ b/third_party/blink/renderer/core/css/html.css
@@ -555,12 +555,6 @@ cursor: pointer; } -input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { - background-color: #FAFFBD !important; - background-image:none !important; - color: #000000 !important; -} - input[type="radio" i], input[type="checkbox" i] { margin: 3px 0.5ex; padding: initial;
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 6f7671b1..8c2bd4b 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -2271,7 +2271,16 @@ void Element::RecalcStyle(StyleRecalcChange change) { DCHECK(GetDocument().InStyleRecalc()); DCHECK(!GetDocument().Lifecycle().InDetach()); - DCHECK(!ParentOrShadowHostNode()->NeedsStyleRecalc()); + // If we are re-attaching in a Shadow DOM v0 tree, we recalc down to the + // distributed nodes to propagate kReattach down the flat tree (See + // V0InsertionPoint::DidRecalcStyle). That means we may have a shadow- + // including parent (V0InsertionPoint) with dirty recalc bit in the case where + // fallback content has been redistributed to a different insertion point. + // This will not happen for Shadow DOM v1 because we walk assigned nodes and + // slots themselves are assigned and part of the flat tree. + DCHECK( + !ParentOrShadowHostNode()->NeedsStyleRecalc() || + (ParentOrShadowHostNode()->IsV0InsertionPoint() && change == kReattach)); DCHECK(InActiveDocument()); if (HasCustomStyleCallbacks()) @@ -2320,6 +2329,8 @@ change = kReattach; if (change == kReattach) SetNeedsReattachLayoutTree(); + else if (GetStyleChangeType() == kSubtreeStyleChange) + change = kForce; } // Needed because the RebuildLayoutTree code needs to see what the @@ -2388,7 +2399,6 @@ StyleRecalcChange Element::RecalcOwnStyle(StyleRecalcChange change) { DCHECK(GetDocument().InStyleRecalc()); - DCHECK(!ParentOrShadowHostNode()->NeedsStyleRecalc()); DCHECK(change >= kIndependentInherit || NeedsStyleRecalc()); DCHECK(ParentComputedStyle()); DCHECK(!GetNonAttachedStyle()); @@ -4442,9 +4452,9 @@ DCHECK_NE(old_id, new_id); if (!old_id.IsEmpty()) - scope.RemoveElementById(old_id, this); + scope.RemoveElementById(old_id, *this); if (!new_id.IsEmpty()) - scope.AddElementById(new_id, this); + scope.AddElementById(new_id, *this); NamedItemType type = GetNamedItemType(); if (type == NamedItemType::kNameOrId ||
diff --git a/third_party/blink/renderer/core/dom/slot_assignment.cc b/third_party/blink/renderer/core/dom/slot_assignment.cc index a53e5b3..b1336cfe 100644 --- a/third_party/blink/renderer/core/dom/slot_assignment.cc +++ b/third_party/blink/renderer/core/dom/slot_assignment.cc
@@ -83,7 +83,7 @@ DCHECK(!old_active || old_active != slot); // This might invalidate the slot_map's cache. - slot_map_->Add(slot_name, &slot); + slot_map_->Add(slot_name, slot); // This also ensures that TreeOrderedMap has a cache for the first element. HTMLSlotElement* new_active = FindSlotByName(slot_name); @@ -130,7 +130,7 @@ HTMLSlotElement* old_active = GetCachedFirstSlotWithoutAccessingNodeTree(slot_name); DCHECK(old_active); - slot_map_->Remove(slot_name, &slot); + slot_map_->Remove(slot_name, slot); // This also ensures that TreeOrderedMap has a cache for the first element. HTMLSlotElement* new_active = FindSlotByName(slot_name); DCHECK(!new_active || new_active != slot); @@ -242,12 +242,7 @@ HTMLSlotElement* slot = nullptr; if (!is_user_agent) { if (owner_->IsManualSlotting()) { - for (auto candidate : Slots()) { - if (candidate->ContainsInAssignedNodesCandidates(child)) { - slot = candidate; - break; - } - } + slot = FindLastAssignedSlot(const_cast<Node&>(child)); } else { slot = FindSlotByName(child.SlotName()); } @@ -344,7 +339,9 @@ return nullptr; if (owner_->IsUserAgent()) return FindSlotInUserAgentShadow(node); - return FindSlotByName(node.SlotName()); + return owner_->IsManualSlotting() + ? FindLastAssignedSlot(const_cast<Node&>(node)) + : FindSlotByName(node.SlotName()); } HTMLSlotElement* SlotAssignment::FindSlotByName( @@ -363,6 +360,28 @@ return user_agent_default_slot; } +HTMLSlotElement* SlotAssignment::FindLastAssignedSlot(Node& node) const { + auto it = child_assigned_slot_history_.find(&node); + if (it == child_assigned_slot_history_.end()) + return nullptr; + return it.Get()->value.back(); +} + +void SlotAssignment::InsertSlotInChildSlotMap( + HTMLSlotElement& slot, + const HeapVector<Member<Node>>& nodes) { + for (Member<Node> child : nodes) { + auto it = child_assigned_slot_history_.find(child); + if (it == child_assigned_slot_history_.end()) { + HeapVector<Member<HTMLSlotElement>> tmp; + tmp.push_back(slot); + child_assigned_slot_history_.Set(child, tmp); + } else { + it.Get()->value.push_back(slot); + } + } +} + void SlotAssignment::CollectSlots() { DCHECK(needs_collect_slots_); slots_.clear(); @@ -389,6 +408,7 @@ visitor->Trace(slots_); visitor->Trace(slot_map_); visitor->Trace(owner_); + visitor->Trace(child_assigned_slot_history_); } } // namespace blink
diff --git a/third_party/blink/renderer/core/dom/slot_assignment.h b/third_party/blink/renderer/core/dom/slot_assignment.h index ff94d9c..831a6a4 100644 --- a/third_party/blink/renderer/core/dom/slot_assignment.h +++ b/third_party/blink/renderer/core/dom/slot_assignment.h
@@ -44,6 +44,9 @@ bool FindHostChildBySlotName(const AtomicString& slot_name) const; + void InsertSlotInChildSlotMap(HTMLSlotElement& slot, + const HeapVector<Member<Node>>& nodes); + void Trace(blink::Visitor*); // For Incremental Shadow DOM @@ -64,6 +67,8 @@ HTMLSlotElement* FindSlotInUserAgentShadow(const Node&) const; + HTMLSlotElement* FindLastAssignedSlot(Node&) const; + void CollectSlots(); HTMLSlotElement* GetCachedFirstSlotWithoutAccessingNodeTree( const AtomicString& slot_name); @@ -78,6 +83,8 @@ HeapVector<Member<HTMLSlotElement>> slots_; Member<TreeOrderedMap> slot_map_; + HeapHashMap<Member<Node>, HeapVector<Member<HTMLSlotElement>>> + child_assigned_slot_history_; WeakMember<ShadowRoot> owner_; unsigned needs_collect_slots_ : 1; unsigned needs_assignment_recalc_ : 1; // For Incremental Shadow DOM
diff --git a/third_party/blink/renderer/core/dom/tree_ordered_map.cc b/third_party/blink/renderer/core/dom/tree_ordered_map.cc index 00bf1d30..726880a 100644 --- a/third_party/blink/renderer/core/dom/tree_ordered_map.cc +++ b/third_party/blink/renderer/core/dom/tree_ordered_map.cc
@@ -76,9 +76,8 @@ ToHTMLSlotElement(element).GetName() == key; } -void TreeOrderedMap::Add(const AtomicString& key, Element* element) { +void TreeOrderedMap::Add(const AtomicString& key, Element& element) { DCHECK(key); - DCHECK(element); Map::AddResult add_result = map_.insert(key, new MapEntry(element)); if (add_result.is_new_entry) @@ -91,9 +90,8 @@ entry->ordered_list.clear(); } -void TreeOrderedMap::Remove(const AtomicString& key, Element* element) { +void TreeOrderedMap::Remove(const AtomicString& key, Element& element) { DCHECK(key); - DCHECK(element); Map::iterator it = map_.find(key); if (it == map_.end())
diff --git a/third_party/blink/renderer/core/dom/tree_ordered_map.h b/third_party/blink/renderer/core/dom/tree_ordered_map.h index 7598e47..8a5eba0d 100644 --- a/third_party/blink/renderer/core/dom/tree_ordered_map.h +++ b/third_party/blink/renderer/core/dom/tree_ordered_map.h
@@ -50,8 +50,8 @@ public: static TreeOrderedMap* Create(); - void Add(const AtomicString&, Element*); - void Remove(const AtomicString&, Element*); + void Add(const AtomicString&, Element&); + void Remove(const AtomicString&, Element&); bool Contains(const AtomicString&) const; bool ContainsMultiple(const AtomicString&) const; @@ -98,7 +98,7 @@ class MapEntry : public GarbageCollected<MapEntry> { public: - explicit MapEntry(Element* first_element) + explicit MapEntry(Element& first_element) : element(first_element), count(1) {} void Trace(blink::Visitor*);
diff --git a/third_party/blink/renderer/core/dom/tree_scope.cc b/third_party/blink/renderer/core/dom/tree_scope.cc index 05b1cd9..ab7a51a 100644 --- a/third_party/blink/renderer/core/dom/tree_scope.cc +++ b/third_party/blink/renderer/core/dom/tree_scope.cc
@@ -137,7 +137,7 @@ } void TreeScope::AddElementById(const AtomicString& element_id, - Element* element) { + Element& element) { if (!elements_by_id_) elements_by_id_ = TreeOrderedMap::Create(); elements_by_id_->Add(element_id, element); @@ -145,7 +145,7 @@ } void TreeScope::RemoveElementById(const AtomicString& element_id, - Element* element) { + Element& element) { if (!elements_by_id_) return; elements_by_id_->Remove(element_id, element); @@ -165,8 +165,8 @@ return nullptr; } -void TreeScope::AddImageMap(HTMLMapElement* image_map) { - const AtomicString& name = image_map->GetName(); +void TreeScope::AddImageMap(HTMLMapElement& image_map) { + const AtomicString& name = image_map.GetName(); if (!name) return; if (!image_maps_by_name_) @@ -174,10 +174,10 @@ image_maps_by_name_->Add(name, image_map); } -void TreeScope::RemoveImageMap(HTMLMapElement* image_map) { +void TreeScope::RemoveImageMap(HTMLMapElement& image_map) { if (!image_maps_by_name_) return; - const AtomicString& name = image_map->GetName(); + const AtomicString& name = image_map.GetName(); if (!name) return; image_maps_by_name_->Remove(name, image_map);
diff --git a/third_party/blink/renderer/core/dom/tree_scope.h b/third_party/blink/renderer/core/dom/tree_scope.h index 63d0cb9..4542fc7 100644 --- a/third_party/blink/renderer/core/dom/tree_scope.h +++ b/third_party/blink/renderer/core/dom/tree_scope.h
@@ -76,8 +76,8 @@ const AtomicString&) const; bool HasElementWithId(const AtomicString& id) const; bool ContainsMultipleElementsWithId(const AtomicString& id) const; - void AddElementById(const AtomicString& element_id, Element*); - void RemoveElementById(const AtomicString& element_id, Element*); + void AddElementById(const AtomicString& element_id, Element&); + void RemoveElementById(const AtomicString& element_id, Element&); Document& GetDocument() const { DCHECK(document_); @@ -86,8 +86,8 @@ Node* AncestorInThisScope(Node*) const; - void AddImageMap(HTMLMapElement*); - void RemoveImageMap(HTMLMapElement*); + void AddImageMap(HTMLMapElement&); + void RemoveImageMap(HTMLMapElement&); HTMLMapElement* GetImageMap(const String& url) const; Element* ElementFromPoint(double x, double y) const;
diff --git a/third_party/blink/renderer/core/dom/v0_insertion_point.cc b/third_party/blink/renderer/core/dom/v0_insertion_point.cc index 59f1a048c..60823c6 100644 --- a/third_party/blink/renderer/core/dom/v0_insertion_point.cc +++ b/third_party/blink/renderer/core/dom/v0_insertion_point.cc
@@ -138,18 +138,25 @@ } } -void V0InsertionPoint::WillRecalcStyle(StyleRecalcChange change) { - StyleChangeType style_change_type = kNoStyleChange; - - if (change > kInherit || GetStyleChangeType() > kLocalStyleChange) - style_change_type = kSubtreeStyleChange; - else if (change > kNoInherit) - style_change_type = kLocalStyleChange; - else +void V0InsertionPoint::DidRecalcStyle(StyleRecalcChange change) { + if (!HasDistribution() || DistributedNodeAt(0)->parentNode() == this) { + // We either do not have distributed children or the distributed children + // are the fallback children. Fallback children have already been + // recalculated in ContainerNode::RecalcDescendantStyles(). return; + } + + StyleChangeType style_change_type = + change == kForce ? kSubtreeStyleChange : kLocalStyleChange; for (size_t i = 0; i < distributed_nodes_.size(); ++i) { - distributed_nodes_.at(i)->SetNeedsStyleRecalc( + Node* node = distributed_nodes_.at(i); + if (change == kReattach && node->IsElementNode()) { + if (node->ShouldCallRecalcStyle(kReattach)) + ToElement(node)->RecalcStyle(kReattach); + continue; + } + node->SetNeedsStyleRecalc( style_change_type, StyleChangeReasonForTracing::Create( StyleChangeReason::kPropagateInheritChangeToDistributedNodes));
diff --git a/third_party/blink/renderer/core/dom/v0_insertion_point.h b/third_party/blink/renderer/core/dom/v0_insertion_point.h index 811fd7c..2238936 100644 --- a/third_party/blink/renderer/core/dom/v0_insertion_point.h +++ b/third_party/blink/renderer/core/dom/v0_insertion_point.h
@@ -83,7 +83,7 @@ void ChildrenChanged(const ChildrenChange&) override; InsertionNotificationRequest InsertedInto(ContainerNode*) override; void RemovedFrom(ContainerNode*) override; - void WillRecalcStyle(StyleRecalcChange) override; + void DidRecalcStyle(StyleRecalcChange) override; private: bool IsV0InsertionPoint() const =
diff --git a/third_party/blink/renderer/core/events/mouse_event.cc b/third_party/blink/renderer/core/events/mouse_event.cc index 8d32e856..47c4dc9b 100644 --- a/third_party/blink/renderer/core/events/mouse_event.cc +++ b/third_party/blink/renderer/core/events/mouse_event.cc
@@ -173,7 +173,6 @@ MouseEvent::MouseEvent() : position_type_(PositionType::kPosition), - has_cached_relative_position_(false), button_(0), buttons_(0), related_target_(nullptr), @@ -527,6 +526,7 @@ // TODO(mustaq): Remove the PointerEvent specific code when mouse has // fractional coordinates. See crbug.com/655786. + return IsPointerEvent() ? layer_location_.X() : static_cast<int>(layer_location_.X()); } @@ -537,24 +537,29 @@ // TODO(mustaq): Remove the PointerEvent specific code when mouse has // fractional coordinates. See crbug.com/655786. + return IsPointerEvent() ? layer_location_.Y() : static_cast<int>(layer_location_.Y()); } -int MouseEvent::offsetX() { +double MouseEvent::offsetX() { if (!HasPosition()) return 0; if (!has_cached_relative_position_) ComputeRelativePosition(); - return std::round(offset_location_.X()); + return (RuntimeEnabledFeatures::FractionalMouseEventEnabled()) + ? offset_location_.X() + : std::round(offset_location_.X()); } -int MouseEvent::offsetY() { +double MouseEvent::offsetY() { if (!HasPosition()) return 0; if (!has_cached_relative_position_) ComputeRelativePosition(); - return std::round(offset_location_.Y()); + return (RuntimeEnabledFeatures::FractionalMouseEventEnabled()) + ? offset_location_.Y() + : std::round(offset_location_.Y()); } } // namespace blink
diff --git a/third_party/blink/renderer/core/events/mouse_event.h b/third_party/blink/renderer/core/events/mouse_event.h index 2609d56..41182b0c 100644 --- a/third_party/blink/renderer/core/events/mouse_event.h +++ b/third_party/blink/renderer/core/events/mouse_event.h
@@ -159,8 +159,8 @@ int layerX(); int layerY(); - int offsetX(); - int offsetY(); + virtual double offsetX(); + virtual double offsetY(); virtual double pageX() const { return (RuntimeEnabledFeatures::FractionalMouseEventEnabled()) @@ -206,11 +206,16 @@ void ReceivedTarget() override; - // TODO(eirage): Move these coordinates back to private when MouseEvent - // fractional flag is removed. + // TODO(eirage): Move these coordinates related field back to private + // when MouseEvent fractional flag is removed. + void ComputeRelativePosition(); + DoublePoint screen_location_; DoublePoint client_location_; DoublePoint page_location_; // zoomed CSS pixels + DoublePoint offset_location_; // zoomed CSS pixels + + bool has_cached_relative_position_ = false; private: void InitMouseEventInternal(const AtomicString& type, @@ -231,15 +236,12 @@ void InitCoordinates(const double client_x, const double client_y); void ComputePageLocation(); - void ComputeRelativePosition(); DoublePoint movement_delta_; DoublePoint layer_location_; // zoomed CSS pixels - DoublePoint offset_location_; // zoomed CSS pixels DoublePoint absolute_location_; // (un-zoomed) FrameView content space PositionType position_type_; - bool has_cached_relative_position_; short button_; unsigned short buttons_; Member<EventTarget> related_target_;
diff --git a/third_party/blink/renderer/core/events/pointer_event.cc b/third_party/blink/renderer/core/events/pointer_event.cc index 171f511..88fdc4f 100644 --- a/third_party/blink/renderer/core/events/pointer_event.cc +++ b/third_party/blink/renderer/core/events/pointer_event.cc
@@ -99,6 +99,28 @@ : page_location_.Y(); } +double PointerEvent::offsetX() { + if (!HasPosition()) + return 0; + if (!has_cached_relative_position_) + ComputeRelativePosition(); + return (!RuntimeEnabledFeatures::FractionalMouseTypePointerEventEnabled() && + pointer_type_ == "mouse") + ? std::round(offset_location_.X()) + : offset_location_.X(); +} + +double PointerEvent::offsetY() { + if (!HasPosition()) + return 0; + if (!has_cached_relative_position_) + ComputeRelativePosition(); + return (!RuntimeEnabledFeatures::FractionalMouseTypePointerEventEnabled() && + pointer_type_ == "mouse") + ? std::round(offset_location_.Y()) + : offset_location_.Y(); +} + void PointerEvent::ReceivedTarget() { coalesced_events_targets_dirty_ = true; MouseEvent::ReceivedTarget();
diff --git a/third_party/blink/renderer/core/events/pointer_event.h b/third_party/blink/renderer/core/events/pointer_event.h index 1e3ea05..cdc4d8d 100644 --- a/third_party/blink/renderer/core/events/pointer_event.h +++ b/third_party/blink/renderer/core/events/pointer_event.h
@@ -48,6 +48,9 @@ double pageX() const override; double pageY() const override; + double offsetX() override; + double offsetY() override; + void ReceivedTarget() override; // Always return null for fromElement and toElement because these fields
diff --git a/third_party/blink/renderer/core/exported/web_security_policy.cc b/third_party/blink/renderer/core/exported/web_security_policy.cc index b49ba1e..591e376a 100644 --- a/third_party/blink/renderer/core/exported/web_security_policy.cc +++ b/third_party/blink/renderer/core/exported/web_security_policy.cc
@@ -75,16 +75,6 @@ destination_host, allow_destination_subdomains); } -void WebSecurityPolicy::RemoveOriginAccessWhitelistEntry( - const WebURL& source_origin, - const WebString& destination_protocol, - const WebString& destination_host, - bool allow_destination_subdomains) { - SecurityPolicy::RemoveOriginAccessWhitelistEntry( - *SecurityOrigin::Create(source_origin), destination_protocol, - destination_host, allow_destination_subdomains); -} - void WebSecurityPolicy::RemoveAllOriginAccessWhitelistEntriesForOrigin( const WebURL& source_origin) { SecurityPolicy::RemoveAllOriginAccessWhitelistEntriesForOrigin(
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc b/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc index b3654203..bd294a4 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc
@@ -435,9 +435,11 @@ TEST_F(CustomElementRegistryTest, defineCustomElementWithStyle) { RuntimeEnabledFeatures::SetConstructableStylesheetsEnabled(true); + V8TestingScope scope; NonThrowableExceptionState should_not_throw; ElementDefinitionOptions options; - CSSStyleSheet* sheet = CSSStyleSheet::Create(GetDocument(), should_not_throw); + CSSStyleSheet* sheet = GetDocument().createEmptyCSSStyleSheet( + scope.GetScriptState(), CSSStyleSheetInit(), should_not_throw); options.setStyle(sheet); TestCustomElementDefinitionBuilder builder(sheet); CustomElementDefinition* definition_a =
diff --git a/third_party/blink/renderer/core/html/html_map_element.cc b/third_party/blink/renderer/core/html/html_map_element.cc index 62a9a98..92a5b6da 100644 --- a/third_party/blink/renderer/core/html/html_map_element.cc +++ b/third_party/blink/renderer/core/html/html_map_element.cc
@@ -87,13 +87,13 @@ return; } if (isConnected()) - GetTreeScope().RemoveImageMap(this); + GetTreeScope().RemoveImageMap(*this); String map_name = params.new_value; if (map_name[0] == '#') map_name = map_name.Substring(1); name_ = AtomicString(map_name); if (isConnected()) - GetTreeScope().AddImageMap(this); + GetTreeScope().AddImageMap(*this); return; } @@ -108,13 +108,13 @@ Node::InsertionNotificationRequest HTMLMapElement::InsertedInto( ContainerNode* insertion_point) { if (insertion_point->isConnected()) - GetTreeScope().AddImageMap(this); + GetTreeScope().AddImageMap(*this); return HTMLElement::InsertedInto(insertion_point); } void HTMLMapElement::RemovedFrom(ContainerNode* insertion_point) { if (insertion_point->isConnected()) - GetTreeScope().RemoveImageMap(this); + GetTreeScope().RemoveImageMap(*this); HTMLElement::RemovedFrom(insertion_point); }
diff --git a/third_party/blink/renderer/core/html/html_slot_element.cc b/third_party/blink/renderer/core/html/html_slot_element.cc index 58b61b9..615a953 100644 --- a/third_party/blink/renderer/core/html/html_slot_element.cc +++ b/third_party/blink/renderer/core/html/html_slot_element.cc
@@ -190,6 +190,8 @@ } void HTMLSlotElement::assign(HeapVector<Member<Node>> nodes) { + ContainingShadowRoot()->GetSlotAssignment().InsertSlotInChildSlotMap(*this, + nodes); ContainingShadowRoot()->GetSlotAssignment().SetNeedsAssignmentRecalc(); assigned_nodes_candidates_.clear(); for (Member<Node> child : nodes) { @@ -502,6 +504,7 @@ return; for (auto& node : assigned_nodes_) { if (change == kReattach && node->IsElementNode()) { + DCHECK(node->ShouldCallRecalcStyle(kReattach)); ToElement(node)->RecalcStyle(kReattach); continue; }
diff --git a/third_party/blink/renderer/core/layout/jank_tracker.cc b/third_party/blink/renderer/core/layout/jank_tracker.cc index 24c209e..7322dac 100644 --- a/third_party/blink/renderer/core/layout/jank_tracker.cc +++ b/third_party/blink/renderer/core/layout/jank_tracker.cc
@@ -17,6 +17,7 @@ static constexpr TimeDelta kTimerDelay = TimeDelta::FromSeconds(3); static const float kRegionGranularitySteps = 60.0; +static const float kMovementThreshold = 3.0; // CSS pixels. static FloatPoint LogicalStart(const FloatRect& rect, const LayoutObject& object) { @@ -41,6 +42,21 @@ std::min(viewport.Height(), viewport.Width()); } +static bool EqualWithinMovementThreshold(const FloatPoint& a, + const FloatPoint& b, + const LayoutObject& object) { + float threshold_physical_px = + kMovementThreshold * object.StyleRef().EffectiveZoom(); + return fabs(a.X() - b.X()) < threshold_physical_px && + fabs(a.Y() - b.Y()) < threshold_physical_px; +} + +static bool SmallerThanRegionGranularity(const LayoutRect& rect, + float granularity_scale) { + return rect.Width().ToFloat() * granularity_scale < 0.5 || + rect.Height().ToFloat() * granularity_scale < 0.5; +} + JankTracker::JankTracker(LocalFrameView* frame_view) : frame_view_(frame_view), score_(0.0), @@ -60,8 +76,16 @@ if (old_visual_rect.IsEmpty() || new_visual_rect.IsEmpty()) return; - if (LogicalStart(FloatRect(old_visual_rect), object) == - LogicalStart(FloatRect(new_visual_rect), object)) + if (EqualWithinMovementThreshold( + LogicalStart(FloatRect(old_visual_rect), object), + LogicalStart(FloatRect(new_visual_rect), object), object)) + return; + + IntRect viewport = frame_view_->GetScrollableArea()->VisibleContentRect(); + float scale = RegionGranularityScale(viewport); + + if (SmallerThanRegionGranularity(old_visual_rect, scale) && + SmallerThanRegionGranularity(new_visual_rect, scale)) return; const auto* local_transform = painting_layer.GetLayoutObject() @@ -87,7 +111,6 @@ // a better idea of how to aggregate multiple scores for a page. // See review thread of http://crrev.com/c/1046155 for more details. - IntRect viewport = frame_view_->GetScrollableArea()->VisibleContentRect(); if (!old_visual_rect_abs.Intersects(viewport) && !new_visual_rect_abs.Intersects(viewport)) return; @@ -106,7 +129,6 @@ IntRect visible_new_visual_rect = RoundedIntRect(new_visual_rect_abs); visible_new_visual_rect.Intersect(viewport); - float scale = RegionGranularityScale(viewport); visible_old_visual_rect.Scale(scale); visible_new_visual_rect.Scale(scale);
diff --git a/third_party/blink/renderer/core/layout/jank_tracker_test.cc b/third_party/blink/renderer/core/layout/jank_tracker_test.cc index dcc0fcd..d4134b0 100644 --- a/third_party/blink/renderer/core/layout/jank_tracker_test.cc +++ b/third_party/blink/renderer/core/layout/jank_tracker_test.cc
@@ -79,4 +79,31 @@ EXPECT_FLOAT_EQ(20.0, GetJankTracker().MaxDistance()); } +TEST_F(JankTrackerTest, SmallMovementIgnored) { + SetBodyInnerHTML(R"HTML( + <style> + #j { position: relative; width: 300px; height: 100px; } + </style> + <div id='j'></div> + )HTML"); + GetDocument().getElementById("j")->setAttribute(HTMLNames::styleAttr, + AtomicString("top: 2px")); + GetFrameView().UpdateAllLifecyclePhases(); + EXPECT_EQ(0.0, GetJankTracker().Score()); +} + +TEST_F(JankTrackerTest, SmallMovementIgnoredWithZoom) { + GetDocument().GetFrame()->SetPageZoomFactor(2); + SetBodyInnerHTML(R"HTML( + <style> + #j { position: relative; width: 300px; height: 100px; } + </style> + <div id='j'></div> + )HTML"); + GetDocument().getElementById("j")->setAttribute(HTMLNames::styleAttr, + AtomicString("top: 2px")); + GetFrameView().UpdateAllLifecyclePhases(); + EXPECT_EQ(0.0, GetJankTracker().Score()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index 4bd730e..8416290 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -21,6 +21,11 @@ #include "third_party/blink/renderer/core/layout/layout_theme.h" +#include <string> + +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/web/blink.h" @@ -51,6 +56,7 @@ #include "third_party/blink/renderer/platform/file_metadata.h" #include "third_party/blink/renderer/platform/fonts/font_selector.h" #include "third_party/blink/renderer/platform/fonts/string_truncator.h" +#include "third_party/blink/renderer/platform/graphics/color.h" #include "third_party/blink/renderer/platform/graphics/touch_action.h" #include "third_party/blink/renderer/platform/layout_test_support.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" @@ -63,6 +69,36 @@ namespace blink { +namespace { + +void GetAutofillPreviewColorsFromFieldTrial(std::string* color, + std::string* background_color) { + constexpr char kAutofillDefaultBackgroundColor[] = "#FAFFBD"; + constexpr char kAutofillDefaultColor[] = "#000000"; + + if (base::FeatureList::IsEnabled(features::kAutofillPreviewStyleExperiment)) { + std::string bg_color_param = base::GetFieldTrialParamValueByFeature( + features::kAutofillPreviewStyleExperiment, + features::kAutofillPreviewStyleExperimentBgColorParameterName); + std::string color_param = base::GetFieldTrialParamValueByFeature( + features::kAutofillPreviewStyleExperiment, + features::kAutofillPreviewStyleExperimentColorParameterName); + if (Color().SetFromString(bg_color_param.c_str()) && + Color().SetFromString(color_param.c_str())) { + *background_color = bg_color_param; + *color = color_param; + return; + } + } + + // Fallback to the default colors if the experiment is not enabled or if a + // color param is invalid. + *background_color = std::string(kAutofillDefaultBackgroundColor); + *color = std::string(kAutofillDefaultColor); +} + +} // namespace + // Wrapper function defined in WebKit.h void SetMockThemeEnabledForTest(bool value) { LayoutTestSupport::SetMockThemeEnabledForTest(value); @@ -264,7 +300,16 @@ } String LayoutTheme::ExtraDefaultStyleSheet() { - return g_empty_string; + std::string color, background_color; + GetAutofillPreviewColorsFromFieldTrial(&color, &background_color); + constexpr char const format[] = + "input:-webkit-autofill, textarea:-webkit-autofill, " + "select:-webkit-autofill {" + " background-color: %s !important;" + " background-image:none !important;" + " color: %s !important;" + "}"; + return String::Format(format, background_color.c_str(), color.c_str()); } String LayoutTheme::ExtraQuirksStyleSheet() {
diff --git a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc index 81cbd3ab..37d5275 100644 --- a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc +++ b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
@@ -44,8 +44,7 @@ ModuleScriptCreationParams params( script_resource->GetResponse().Url(), script_resource->SourceText(), script_resource->GetResourceRequest().GetFetchCredentialsMode(), - script_resource->CalculateAccessControlStatus( - fetcher_->Context().GetSecurityOrigin())); + script_resource->CalculateAccessControlStatus()); client_->NotifyFetchFinished(params, error_messages); }
diff --git a/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc index 96fc360..092915a99 100644 --- a/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc +++ b/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc
@@ -99,8 +99,7 @@ ModuleScriptCreationParams params( script_resource->GetResponse().Url(), script_resource->SourceText(), script_resource->GetResourceRequest().GetFetchCredentialsMode(), - script_resource->CalculateAccessControlStatus( - global_scope_->EnsureFetcher()->Context().GetSecurityOrigin())); + script_resource->CalculateAccessControlStatus()); // Step 13.7. "Asynchronously complete the perform the fetch steps with // response." [spec text]
diff --git a/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc index 4edfaea..b14d8929 100644 --- a/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc +++ b/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc
@@ -51,8 +51,7 @@ params.emplace( script_resource->GetResponse().Url(), script_resource->SourceText(), script_resource->GetResourceRequest().GetFetchCredentialsMode(), - script_resource->CalculateAccessControlStatus( - fetcher_->Context().GetSecurityOrigin())); + script_resource->CalculateAccessControlStatus()); } // This will eventually notify |client| passed to
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource.cc b/third_party/blink/renderer/core/loader/resource/image_resource.cc index 654c50f..86c73da 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource.cc +++ b/third_party/blink/renderer/core/loader/resource/image_resource.cc
@@ -669,8 +669,7 @@ ImageResourceInfo::kHasSingleSecurityOrigin) return false; - DCHECK(security_origin); - if (PassesAccessControlCheck(*security_origin)) + if (IsSameOriginOrCORSSuccessful()) return true; return security_origin->CanReadContent(GetResponse().Url());
diff --git a/third_party/blink/renderer/core/loader/resource/script_resource.cc b/third_party/blink/renderer/core/loader/resource/script_resource.cc index 21f6686..1981686 100644 --- a/third_party/blink/renderer/core/loader/resource/script_resource.cc +++ b/third_party/blink/renderer/core/loader/resource/script_resource.cc
@@ -237,17 +237,12 @@ SetDecodedSize(0); } -AccessControlStatus ScriptResource::CalculateAccessControlStatus( - const SecurityOrigin* security_origin) const { - if (GetResponse().WasFetchedViaServiceWorker()) { - if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque) - return kOpaqueResource; - return kSharableCrossOrigin; - } +AccessControlStatus ScriptResource::CalculateAccessControlStatus() const { + if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque) + return kOpaqueResource; - if (security_origin && PassesAccessControlCheck(*security_origin)) + if (IsSameOriginOrCORSSuccessful()) return kSharableCrossOrigin; - return kNotSharableCrossOrigin; }
diff --git a/third_party/blink/renderer/core/loader/resource/script_resource.h b/third_party/blink/renderer/core/loader/resource/script_resource.h index 97dee5e8..27b0af4 100644 --- a/third_party/blink/renderer/core/loader/resource/script_resource.h +++ b/third_party/blink/renderer/core/loader/resource/script_resource.h
@@ -71,7 +71,7 @@ const MovableString& SourceText(); - AccessControlStatus CalculateAccessControlStatus(const SecurityOrigin*) const; + AccessControlStatus CalculateAccessControlStatus() const; SingleCachedMetadataHandler* CacheHandler();
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc index be304fa..650dd96 100644 --- a/third_party/blink/renderer/core/messaging/message_port.cc +++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -47,8 +47,12 @@ namespace blink { +// TODO(altimin): Remove these after per-task mojo dispatching. // The maximum number of MessageEvents to dispatch from one task. -static const int kMaximumMessagesPerTask = 200; +constexpr int kMaximumMessagesPerTask = 200; +// The threshold to stop processing new tasks. +constexpr base::TimeDelta kYieldThreshold = + base::TimeDelta::FromMilliseconds(50); MessagePort* MessagePort::Create(ExecutionContext& execution_context) { return new MessagePort(execution_context); @@ -257,17 +261,20 @@ } bool MessagePort::Accept(mojo::Message* mojo_message) { + TRACE_EVENT0("blink", "MessagePort::Accept"); + // Connector repeatedly calls Accept as long as any messages are available. To // avoid completely starving the event loop and give some time for other tasks // the connector is temporarily paused after |kMaximumMessagesPerTask| have // been received without other tasks having had a chance to run (in particular // the ResetMessageCount task posted here). + // TODO(altimin): Remove this after per-task mojo dispatching lands[1]. + // [1] https://chromium-review.googlesource.com/c/chromium/src/+/1145692 if (messages_in_current_task_ == 0) { task_runner_->PostTask(FROM_HERE, WTF::Bind(&MessagePort::ResetMessageCount, WrapWeakPersistent(this))); } - ++messages_in_current_task_; - if (messages_in_current_task_ > kMaximumMessagesPerTask) { + if (ShouldYieldAfterNewMessage()) { connector_->PauseIncomingMethodCallProcessing(); } @@ -308,9 +315,20 @@ void MessagePort::ResetMessageCount() { DCHECK_GT(messages_in_current_task_, 0); messages_in_current_task_ = 0; + task_start_time_ = base::nullopt; // No-op if not paused already. if (connector_) connector_->ResumeIncomingMethodCallProcessing(); } +bool MessagePort::ShouldYieldAfterNewMessage() { + ++messages_in_current_task_; + if (messages_in_current_task_ > kMaximumMessagesPerTask) + return true; + base::TimeTicks now = base::TimeTicks::Now(); + if (!task_start_time_) + task_start_time_ = now; + return now - task_start_time_.value() > kYieldThreshold; +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/messaging/message_port.h b/third_party/blink/renderer/core/messaging/message_port.h index 3ed4805b..4b981c4 100644 --- a/third_party/blink/renderer/core/messaging/message_port.h +++ b/third_party/blink/renderer/core/messaging/message_port.h
@@ -138,6 +138,7 @@ // mojo::MessageReceiver implementation. bool Accept(mojo::Message*) override; void ResetMessageCount(); + bool ShouldYieldAfterNewMessage(); std::unique_ptr<mojo::Connector> connector_; int messages_in_current_task_ = 0; @@ -145,6 +146,8 @@ bool started_ = false; bool closed_ = false; + base::Optional<base::TimeTicks> task_start_time_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; };
diff --git a/third_party/blink/renderer/core/scheduler/throttling_test.cc b/third_party/blink/renderer/core/scheduler/throttling_test.cc index 0dd5b4bb..4586d6f 100644 --- a/third_party/blink/renderer/core/scheduler/throttling_test.cc +++ b/third_party/blink/renderer/core/scheduler/throttling_test.cc
@@ -59,7 +59,8 @@ class BackgroundRendererThrottlingTest : public SimTest {}; -TEST_F(BackgroundRendererThrottlingTest, BackgroundRenderersAreThrottled) { +TEST_F(BackgroundRendererThrottlingTest, + DISABLED_BackgroundRenderersAreThrottled) { SimRequest main_resource("https://example.com/", "text/html"); LoadURL("https://example.com/");
diff --git a/third_party/blink/renderer/core/script/classic_pending_script.cc b/third_party/blink/renderer/core/script/classic_pending_script.cc index b34d5f65..75ff1b9 100644 --- a/third_party/blink/renderer/core/script/classic_pending_script.cc +++ b/third_party/blink/renderer/core/script/classic_pending_script.cc
@@ -399,10 +399,8 @@ // "the URL from which the script was obtained" [spec text] // https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-base-url const KURL& base_url = source_code.Url(); - return ClassicScript::Create( - source_code, base_url, options_, - resource->CalculateAccessControlStatus( - GetElement()->GetDocument().GetSecurityOrigin())); + return ClassicScript::Create(source_code, base_url, options_, + resource->CalculateAccessControlStatus()); } void ClassicPendingScript::SetStreamer(ScriptStreamer* streamer) {
diff --git a/third_party/blink/renderer/core/svg/animation/smil_time_container.cc b/third_party/blink/renderer/core/svg/animation/smil_time_container.cc index 31d6c3a..f53feeb 100644 --- a/third_party/blink/renderer/core/svg/animation/smil_time_container.cc +++ b/third_party/blink/renderer/core/svg/animation/smil_time_container.cc
@@ -79,14 +79,13 @@ DCHECK(!prevent_scheduled_animations_changes_); #endif - AttributeAnimationsMap& attribute_map = - scheduled_animations_.insert(target, AttributeAnimationsMap()) - .stored_value->value; - AnimationsLinkedHashSet& scheduled = - attribute_map.insert(attribute_name, AnimationsLinkedHashSet()) - .stored_value->value; - DCHECK(!scheduled.Contains(animation)); - scheduled.insert(animation); + ElementAttributePair key(target, attribute_name); + Member<AnimationsLinkedHashSet>& scheduled = + scheduled_animations_.insert(key, nullptr).stored_value->value; + if (!scheduled) + scheduled = new AnimationsLinkedHashSet; + DCHECK(!scheduled->Contains(animation)); + scheduled->insert(animation); SMILTime next_fire_time = animation->NextProgressTime(); if (next_fire_time.IsFinite()) @@ -102,20 +101,16 @@ DCHECK(!prevent_scheduled_animations_changes_); #endif - GroupedAnimationsMap::iterator it = scheduled_animations_.find(target); - CHECK(it != scheduled_animations_.end()); - AttributeAnimationsMap& attribute_map = it->value; - AttributeAnimationsMap::iterator attribute_map_it = - attribute_map.find(attribute_name); - DCHECK(attribute_map_it != attribute_map.end()); - AnimationsLinkedHashSet& scheduled = attribute_map_it->value; - AnimationsLinkedHashSet::iterator it_animation = scheduled.find(animation); - DCHECK(it_animation != scheduled.end()); - scheduled.erase(it_animation); + ElementAttributePair key(target, attribute_name); + GroupedAnimationsMap::iterator it = scheduled_animations_.find(key); + DCHECK_NE(it, scheduled_animations_.end()); + AnimationsLinkedHashSet* scheduled = it->value.Get(); + DCHECK(scheduled); + AnimationsLinkedHashSet::iterator it_animation = scheduled->find(animation); + DCHECK(it_animation != scheduled->end()); + scheduled->erase(it_animation); - if (scheduled.IsEmpty()) - attribute_map.erase(attribute_map_it); - if (attribute_map.IsEmpty()) + if (scheduled->IsEmpty()) scheduled_animations_.erase(it); } @@ -234,13 +229,13 @@ #if DCHECK_IS_ON() prevent_scheduled_animations_changes_ = true; #endif - for (const auto& attribute_entry : scheduled_animations_) { - for (const auto& entry : attribute_entry.value) { - const AnimationsLinkedHashSet& scheduled = entry.value; - for (SVGSMILElement* element : scheduled) { - element->Reset(); - } - } + for (const auto& entry : scheduled_animations_) { + if (!entry.key.first) + continue; + + AnimationsLinkedHashSet* scheduled = entry.value.Get(); + for (SVGSMILElement* element : *scheduled) + element->Reset(); } #if DCHECK_IS_ON() prevent_scheduled_animations_changes_ = false; @@ -433,65 +428,62 @@ if (document_order_indexes_dirty_) UpdateDocumentOrderIndexes(); + HeapHashSet<ElementAttributePair> invalid_keys; using AnimationsVector = HeapVector<Member<SVGSMILElement>>; AnimationsVector animations_to_apply; AnimationsVector scheduled_animations_in_same_group; - for (auto attribute_entry : scheduled_animations_) { - AttributeAnimationsMap attribute_map = attribute_entry.value; - Vector<QualifiedName> invalid_keys; - for (const auto& entry : attribute_map) { - if (entry.value.IsEmpty()) { - invalid_keys.push_back(entry.key); - continue; - } - - // Sort according to priority. Elements with later begin time have higher - // priority. In case of a tie, document order decides. - // FIXME: This should also consider timing relationships between the - // elements. Dependents have higher priority. - CopyToVector(entry.value, scheduled_animations_in_same_group); - std::sort(scheduled_animations_in_same_group.begin(), - scheduled_animations_in_same_group.end(), - PriorityCompare(elapsed)); - - AnimationsVector sandwich; - for (const auto& it_animation : scheduled_animations_in_same_group) { - SVGSMILElement* animation = it_animation.Get(); - DCHECK_EQ(animation->TimeContainer(), this); - DCHECK(animation->HasValidTarget()); - - // This will calculate the contribution from the animation and update - // timing. - if (animation->Progress(elapsed, seek_to_time)) { - sandwich.push_back(animation); - } else { - animation->ClearAnimatedType(); - } - - SMILTime next_fire_time = animation->NextProgressTime(); - if (next_fire_time.IsFinite()) - earliest_fire_time = std::min(next_fire_time, earliest_fire_time); - } - - if (!sandwich.IsEmpty()) { - // Results are accumulated to the first animation that animates and - // contributes to a particular element/attribute pair. - // Only reset the animated type to the base value once for - // the lowest priority animation that animates and - // contributes to a particular element/attribute pair. - SVGSMILElement* result_element = sandwich.front(); - result_element->ResetAnimatedType(); - - // Go through the sandwich from lowest prio to highest and generate - // the animated value (if any.) - for (const auto& animation : sandwich) - animation->UpdateAnimatedValue(result_element); - - animations_to_apply.push_back(result_element); - } + for (const auto& entry : scheduled_animations_) { + if (!entry.key.first || entry.value->IsEmpty()) { + invalid_keys.insert(entry.key); + continue; } - attribute_map.RemoveAll(invalid_keys); + + // Sort according to priority. Elements with later begin time have higher + // priority. In case of a tie, document order decides. + // FIXME: This should also consider timing relationships between the + // elements. Dependents have higher priority. + CopyToVector(*entry.value, scheduled_animations_in_same_group); + std::sort(scheduled_animations_in_same_group.begin(), + scheduled_animations_in_same_group.end(), + PriorityCompare(elapsed)); + + AnimationsVector sandwich; + for (const auto& it_animation : scheduled_animations_in_same_group) { + SVGSMILElement* animation = it_animation.Get(); + DCHECK_EQ(animation->TimeContainer(), this); + DCHECK(animation->HasValidTarget()); + + // This will calculate the contribution from the animation and update + // timing. + if (animation->Progress(elapsed, seek_to_time)) { + sandwich.push_back(animation); + } else { + animation->ClearAnimatedType(); + } + + SMILTime next_fire_time = animation->NextProgressTime(); + if (next_fire_time.IsFinite()) + earliest_fire_time = std::min(next_fire_time, earliest_fire_time); + } + + if (!sandwich.IsEmpty()) { + // Results are accumulated to the first animation that animates and + // contributes to a particular element/attribute pair. + // Only reset the animated type to the base value once for + // the lowest priority animation that animates and + // contributes to a particular element/attribute pair. + SVGSMILElement* result_element = sandwich.front(); + result_element->ResetAnimatedType(); + + // Go through the sandwich from lowest prio to highest and generate + // the animated value (if any.) + for (const auto& animation : sandwich) + animation->UpdateAnimatedValue(result_element); + + animations_to_apply.push_back(result_element); + } } + scheduled_animations_.RemoveAll(invalid_keys); if (animations_to_apply.IsEmpty()) { #if DCHECK_IS_ON()
diff --git a/third_party/blink/renderer/core/svg/animation/smil_time_container.h b/third_party/blink/renderer/core/svg/animation/smil_time_container.h index e9eed72..3927b28 100644 --- a/third_party/blink/renderer/core/svg/animation/smil_time_container.h +++ b/third_party/blink/renderer/core/svg/animation/smil_time_container.h
@@ -135,11 +135,10 @@ TaskRunnerTimer<SMILTimeContainer> wakeup_timer_; TaskRunnerTimer<SMILTimeContainer> animation_policy_once_timer_; + using ElementAttributePair = std::pair<WeakMember<SVGElement>, QualifiedName>; using AnimationsLinkedHashSet = HeapLinkedHashSet<WeakMember<SVGSMILElement>>; - using AttributeAnimationsMap = - HeapHashMap<QualifiedName, AnimationsLinkedHashSet>; using GroupedAnimationsMap = - HeapHashMap<WeakMember<SVGElement>, AttributeAnimationsMap>; + HeapHashMap<ElementAttributePair, Member<AnimationsLinkedHashSet>>; GroupedAnimationsMap scheduled_animations_; Member<SVGSVGElement> owner_svg_element_;
diff --git a/third_party/blink/renderer/devtools/front_end/sources/DebuggerPlugin.js b/third_party/blink/renderer/devtools/front_end/sources/DebuggerPlugin.js index 7065379..f89493f 100644 --- a/third_party/blink/renderer/devtools/front_end/sources/DebuggerPlugin.js +++ b/third_party/blink/renderer/devtools/front_end/sources/DebuggerPlugin.js
@@ -472,6 +472,8 @@ const tokenBefore = this._textEditor.tokenAtTextPosition(editorLineNumber, startHighlight - 2); if (!tokenBefore || !tokenBefore.type) return null; + if (tokenBefore.type === 'js-meta') + break; startHighlight = tokenBefore.startColumn; } }
diff --git a/third_party/blink/renderer/devtools/front_end/sources_test_runner/DebuggerTestRunner.js b/third_party/blink/renderer/devtools/front_end/sources_test_runner/DebuggerTestRunner.js index b52d660..3043215 100644 --- a/third_party/blink/renderer/devtools/front_end/sources_test_runner/DebuggerTestRunner.js +++ b/third_party/blink/renderer/devtools/front_end/sources_test_runner/DebuggerTestRunner.js
@@ -447,6 +447,14 @@ SourcesTestRunner.waitForScriptSource.bind(SourcesTestRunner, scriptName, callback)); }; +SourcesTestRunner.objectForPopover = function(sourceFrame, lineNumber, columnNumber) { + const debuggerPlugin = SourcesTestRunner.debuggerPlugin(sourceFrame); + const {x, y} = debuggerPlugin._textEditor.cursorPositionToCoordinates(lineNumber, columnNumber); + const promise = TestRunner.addSnifferPromise(ObjectUI.ObjectPopoverHelper, 'buildObjectPopover'); + debuggerPlugin._getPopoverRequest({x, y}).show(new UI.GlassPane()); + return promise; +}; + SourcesTestRunner.setBreakpoint = function(sourceFrame, lineNumber, condition, enabled) { const debuggerPlugin = SourcesTestRunner.debuggerPlugin(sourceFrame); if (!debuggerPlugin._muted)
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc index 876f3443..7dca85c 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -2395,6 +2395,10 @@ if (!CanHaveChildren() || cached_is_descendant_of_leaf_node_) return; + // Calling CanHaveChildren(), above, can occasionally detach |this|. + if (IsDetached()) + return; + AXObjectCache().PostNotification(this, AXObjectCacheImpl::kAXChildrenChanged); // Go up the accessibility parent chain, but only if the element already
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.cc index 0264130..781dc5a 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.cc +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.cc
@@ -20,13 +20,15 @@ unsigned long long upload_total, unsigned long long uploaded, unsigned long long download_total, - unsigned long long downloaded) + unsigned long long downloaded, + blink::mojom::BackgroundFetchState state) : developer_id_(developer_id), unique_id_(unique_id), upload_total_(upload_total), uploaded_(uploaded), download_total_(download_total), downloaded_(downloaded), + state_(state), observer_binding_(this) {} BackgroundFetchRegistration::~BackgroundFetchRegistration() = default; @@ -129,6 +131,18 @@ NOTREACHED(); } +const String BackgroundFetchRegistration::state() const { + switch (state_) { + case blink::mojom::BackgroundFetchState::SUCCESS: + return "success"; + case blink::mojom::BackgroundFetchState::FAILURE: + return "failure"; + case blink::mojom::BackgroundFetchState::PENDING: + return "pending"; + } + NOTREACHED(); +} + void BackgroundFetchRegistration::Dispose() { observer_binding_.Close(); }
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.h b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.h index 411f3416..189643d 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.h +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.h
@@ -34,7 +34,8 @@ unsigned long long upload_total, unsigned long long uploaded, unsigned long long download_total, - unsigned long long downloaded); + unsigned long long downloaded, + mojom::BackgroundFetchState state); ~BackgroundFetchRegistration() override; // Initializes the BackgroundFetchRegistration to be associated with the given @@ -66,6 +67,7 @@ ExecutionContext* GetExecutionContext() const override; const String& unique_id() const { return unique_id_; } + const String state() const; void Dispose(); @@ -90,6 +92,7 @@ unsigned long long uploaded_; unsigned long long download_total_; unsigned long long downloaded_; + mojom::BackgroundFetchState state_; mojo::Binding<blink::mojom::blink::BackgroundFetchRegistrationObserver> observer_binding_;
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.idl b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.idl index 5c57e94..d05af444 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.idl +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_registration.idl
@@ -3,6 +3,7 @@ // found in the LICENSE file. // https://wicg.github.io/background-fetch/#background-fetch-registration +enum BackgroundFetchState { "pending", "success", "failure" }; [ Exposed=(Window,Worker), @@ -13,10 +14,11 @@ readonly attribute unsigned long long uploaded; readonly attribute unsigned long long downloadTotal; readonly attribute unsigned long long downloaded; + readonly attribute BackgroundFetchState state; // TODO(crbug.com/699957): Implement the `activeFetches` attribute. attribute EventHandler onprogress; [CallWith=ScriptState] Promise<boolean> abort(); // TODO(crbug.com/863016): Add match() and matchAll(). -}; +}; \ No newline at end of file
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_type_converters.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_type_converters.cc index 42850b0..b4b7d6d 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_type_converters.cc +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_type_converters.cc
@@ -22,7 +22,8 @@ return new blink::BackgroundFetchRegistration( mojo_registration->developer_id, mojo_registration->unique_id, mojo_registration->upload_total, mojo_registration->uploaded, - mojo_registration->download_total, mojo_registration->downloaded); + mojo_registration->download_total, mojo_registration->downloaded, + blink::mojom::BackgroundFetchState::PENDING); } blink::mojom::blink::BackgroundFetchOptionsPtr TypeConverter<
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc index ac8099a..e6a4a40 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.cc
@@ -118,7 +118,8 @@ void ServiceWorkerGlobalScopeProxy::DispatchBackgroundFetchAbortEvent( int event_id, const WebString& developer_id, - const WebString& unique_id) { + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) { DCHECK(WorkerGlobalScope()->IsContextThread()); WaitUntilObserver* observer = WaitUntilObserver::Create( WorkerGlobalScope(), WaitUntilObserver::kBackgroundFetchAbort, event_id); @@ -134,7 +135,7 @@ // object, or all information required to build one. BackgroundFetchRegistration* registration = new BackgroundFetchRegistration( developer_id, unique_id, 0 /* upload_total */, 0 /* uploaded */, - 0 /* download_total */, 0 /* downloaded */); + 0 /* download_total */, 0 /* downloaded */, state); BackgroundFetchEventInit init; init.setRegistration(registration); @@ -147,7 +148,8 @@ void ServiceWorkerGlobalScopeProxy::DispatchBackgroundFetchClickEvent( int event_id, const WebString& developer_id, - const WebString& unique_id) { + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) { DCHECK(WorkerGlobalScope()->IsContextThread()); WaitUntilObserver* observer = WaitUntilObserver::Create( WorkerGlobalScope(), WaitUntilObserver::kBackgroundFetchClick, event_id); @@ -156,7 +158,7 @@ // object, or all information required to build one. BackgroundFetchRegistration* registration = new BackgroundFetchRegistration( developer_id, unique_id, 0 /* upload_total */, 0 /* uploaded */, - 0 /* download_total */, 0 /* downloaded */); + 0 /* download_total */, 0 /* downloaded */, state); BackgroundFetchEventInit init; init.setRegistration(registration); @@ -170,6 +172,7 @@ int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) { DCHECK(WorkerGlobalScope()->IsContextThread()); WaitUntilObserver* observer = WaitUntilObserver::Create( @@ -186,7 +189,7 @@ // object, or all information required to build one. BackgroundFetchRegistration* registration = new BackgroundFetchRegistration( developer_id, unique_id, 0 /* upload_total */, 0 /* uploaded */, - 0 /* download_total */, 0 /* downloaded */); + 0 /* download_total */, 0 /* downloaded */, state); BackgroundFetchEventInit init; init.setRegistration(registration); @@ -203,6 +206,7 @@ int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) { DCHECK(WorkerGlobalScope()->IsContextThread()); WaitUntilObserver* observer = WaitUntilObserver::Create( @@ -220,7 +224,7 @@ // object, or all information required to build one. BackgroundFetchRegistration* registration = new BackgroundFetchRegistration( developer_id, unique_id, 0 /* upload_total */, 0 /* uploaded */, - 0 /* download_total */, 0 /* downloaded */); + 0 /* download_total */, 0 /* downloaded */, state); BackgroundFetchEventInit init; init.setRegistration(registration);
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h index b6992ec5..22509a6d 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h +++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h
@@ -81,21 +81,27 @@ void SetRegistration( std::unique_ptr<WebServiceWorkerRegistration::Handle>) override; void DispatchActivateEvent(int) override; - void DispatchBackgroundFetchAbortEvent(int event_id, - const WebString& developer_id, - const WebString& unique_id) override; - void DispatchBackgroundFetchClickEvent(int event_id, - const WebString& developer_id, - const WebString& unique_id) override; + void DispatchBackgroundFetchAbortEvent( + int event_id, + const WebString& developer_id, + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) override; + void DispatchBackgroundFetchClickEvent( + int event_id, + const WebString& developer_id, + const WebString& unique_id, + blink::mojom::BackgroundFetchState state) override; void DispatchBackgroundFetchFailEvent( int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) override; void DispatchBackgroundFetchSuccessEvent( int event_id, const WebString& developer_id, const WebString& unique_id, + blink::mojom::BackgroundFetchState state, const WebVector<WebBackgroundFetchSettledFetch>& fetches) override; void DispatchCookieChangeEvent( int event_id,
diff --git a/third_party/blink/renderer/platform/bindings/callback_function_base.h b/third_party/blink/renderer/platform/bindings/callback_function_base.h index d96e431..4acb4fd5 100644 --- a/third_party/blink/renderer/platform/bindings/callback_function_base.h +++ b/third_party/blink/renderer/platform/bindings/callback_function_base.h
@@ -38,6 +38,9 @@ return callback_relevant_script_state_; } + // Returns true if the ES function has a [[Construct]] internal method. + bool IsConstructor() const { return CallbackFunction()->IsConstructor(); } + protected: explicit CallbackFunctionBase(v8::Local<v8::Function>);
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.cc b/third_party/blink/renderer/platform/loader/fetch/resource.cc index bcdcf63..cd9632b6 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource.cc
@@ -403,16 +403,6 @@ return GetResponse().HttpContentType(); } -bool Resource::PassesAccessControlCheck( - const SecurityOrigin& security_origin) const { - base::Optional<network::CORSErrorStatus> cors_status = CORS::CheckAccess( - GetResponse().Url(), GetResponse().HttpStatusCode(), - GetResponse().HttpHeaderFields(), - LastResourceRequest().GetFetchCredentialsMode(), security_origin); - - return !cors_status; -} - bool Resource::MustRefetchDueToIntegrityMetadata( const FetchParameters& params) const { if (params.IntegrityMetadata().IsEmpty())
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.h b/third_party/blink/renderer/platform/loader/fetch/resource.h index 5a0931a..be674e93 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource.h
@@ -215,8 +215,6 @@ virtual void Finish(TimeTicks finish_time, base::SingleThreadTaskRunner*); void FinishForTest() { Finish(TimeTicks(), nullptr); } - bool PassesAccessControlCheck(const SecurityOrigin&) const; - virtual scoped_refptr<const SharedBuffer> ResourceBuffer() const { return data_; }
diff --git a/third_party/feed/README.chromium b/third_party/feed/README.chromium index e659233..434cdf7f 100644 --- a/third_party/feed/README.chromium +++ b/third_party/feed/README.chromium
@@ -2,7 +2,7 @@ Short name: feed URL: https://chromium.googlesource.com/feed Version: 0 -Revision: 75614b922b359cc739614fb53b34817cabd69d82 +Revision: a4e91c7238e329ad11e48b068fe3b1e935c0de9b License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/feed/java_sources.gni b/third_party/feed/java_sources.gni index 7b42c08c..bb0fdf11 100644 --- a/third_party/feed/java_sources.gni +++ b/third_party/feed/java_sources.gni
@@ -42,6 +42,8 @@ "src/src/main/java/com/google/android/libraries/feed/api/store/Store.java", "src/src/main/java/com/google/android/libraries/feed/api/store/StoreListener.java", "src/src/main/java/com/google/android/libraries/feed/api/stream/ContentChangedListener.java", + "src/src/main/java/com/google/android/libraries/feed/api/stream/Header.java", + "src/src/main/java/com/google/android/libraries/feed/api/stream/NonDismissibleHeader.java", "src/src/main/java/com/google/android/libraries/feed/api/stream/ScrollListener.java", "src/src/main/java/com/google/android/libraries/feed/api/stream/Stream.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/BasicStream.java", @@ -57,6 +59,7 @@ "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/ContentDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/ContinuationDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/FeatureDriver.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/HeaderDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/LeafFeatureDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/NoContentDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/StreamDriver.java", @@ -214,6 +217,7 @@ "src/src/main/java/com/google/android/libraries/feed/piet/ui/RoundedCornerColorDrawable.java", "src/src/main/java/com/google/android/libraries/feed/piet/ui/RoundedCornerImageView.java", "src/src/main/java/com/google/android/libraries/feed/piet/ui/RoundedCornerViewHelper.java", + "src/src/main/java/com/google/android/libraries/feed/sharedstream/offlinemonitor/StreamOfflineMonitor.java", "src/src/main/java/com/google/android/libraries/feed/sharedstream/piet/PietAssetProvider.java", "src/src/main/java/com/google/android/libraries/feed/sharedstream/piet/PietCustomElementProvider.java", "src/src/main/java/com/google/android/libraries/feed/sharedstream/piet/PietHostBindingProvider.java",
diff --git a/third_party/feed/proto_sources.gni b/third_party/feed/proto_sources.gni index dda55f9..b5c4743 100644 --- a/third_party/feed/proto_sources.gni +++ b/third_party/feed/proto_sources.gni
@@ -15,6 +15,7 @@ "src/src/main/proto/search/now/ui/piet/form_fields.proto", "src/src/main/proto/search/now/ui/piet/gradients.proto", "src/src/main/proto/search/now/ui/piet/images.proto", + "src/src/main/proto/search/now/ui/piet/media_queries.proto", "src/src/main/proto/search/now/ui/piet/piet.proto", "src/src/main/proto/search/now/ui/piet/piet_android_support.proto", "src/src/main/proto/search/now/ui/piet/rounded_corners.proto",
diff --git a/third_party/gvr-android-keyboard/README.chromium b/third_party/gvr-android-keyboard/README.chromium index 796abbb4..de3e709 100644 --- a/third_party/gvr-android-keyboard/README.chromium +++ b/third_party/gvr-android-keyboard/README.chromium
@@ -1,7 +1,7 @@ Name: GVR Keyboard Short Name: gvr-android-keyboard URL: NA -Version: 2 +Version: 3 Date: 2017-11-14 License: Apache 2.0 License File: LICENSE
diff --git a/third_party/gvr-android-keyboard/src/libraries/headers/vr/gvr/capi/include/gvr_keyboard.h b/third_party/gvr-android-keyboard/src/libraries/headers/vr/gvr/capi/include/gvr_keyboard.h index e30ebab..93fd00c 100644 --- a/third_party/gvr-android-keyboard/src/libraries/headers/vr/gvr/capi/include/gvr_keyboard.h +++ b/third_party/gvr-android-keyboard/src/libraries/headers/vr/gvr/capi/include/gvr_keyboard.h
@@ -82,6 +82,8 @@ GVR_KEYBOARD_TEXT_UPDATED = 6, /// Text has been committed. GVR_KEYBOARD_TEXT_COMMITTED = 7, + /// Audio record permission is not granted when starting voice input. + GVR_KEYBOARD_ERROR_NO_VOICE_PERMISSION = 8, } gvr_keyboard_event; /// The input mode of the keyboard. @@ -119,6 +121,34 @@ jobject class_loader); #endif +/// Sets anti-aliasing. This method must be called before creating keyboard. +/// +/// @param enabled whether to enable anti-aliasing. +/// @return true if anti-aliasing is set successfully. +bool gvr_keyboard_set_anti_alias_enabled(bool enabled); + +/// Sets voice input. This method must be called before creating keyboard. +/// +/// @param enabled whether to enable voice input. +/// @return true if voice input is set successfully. +bool gvr_keyboard_set_voice_input_enabled(bool enabled); + +/// Sets callback for requesting voice input permission. This method must be +/// called before creating keyboard. +/// +/// @param enabled whether to enable the callback. +/// @return true if the callback is enabled successfully. +bool gvr_keyboard_set_voice_permission_callback_enabled(bool enabled); + +/// Sets stereo multiview rendering. This method must be called on OpenGL ES 3.0 +/// or above context. If enabled, callers should use +/// gvr_keyboard_multiview_set_viewport in place of gvr_keyboard_set_viewport +/// and gvr_keyboard_multiview_render in place of gvr_keyboard_render. +/// +/// @param enabled whether to enable stereo multiview rendering. +/// @return true if multiview is set successfully. +bool gvr_keyboard_set_multiview_enabled(bool enabled); + /// Creates a keyboard and connects to to the Keyboard Service. /// /// @param closure Custom closure pointer, passed to all the callbacks. @@ -127,6 +157,12 @@ gvr_keyboard_context* gvr_keyboard_create(void* closure, gvr_keyboard_callback callback); +/// Requests permission for voice input. +/// +/// @param context A pointer to the keyboard's context. +/// @return Whether the request is sent successfully. +bool gvr_keyboard_request_voice_permission(gvr_keyboard_context* context); + /// Gets the current input mode. /// /// @param context A pointer to the keyboard's context. @@ -150,8 +186,8 @@ float distance_from_eye, gvr_mat4f* matrix); -/// Shows the keyboard, as specified by `keyboard_matrix`. The matrix should -/// generally be filled using `gvr_keyboard_get_recommended_matrix()`. +/// Shows the keyboard, as specified by `keyboard_matrix`. The matrix can be +/// generated by `gvr_keyboard_get_recommended_world_from_keyboard_matrix()`. /// /// @param context A pointer to the keyboard's context. /// @param keyboard_matrix A transformation matrix defining where and how to @@ -186,6 +222,14 @@ const gvr_vec3f* end, gvr_vec3f* hit); +/// Gets the normal of the hit position on the keyboard. This API must be called +/// after gvr_keyboard_update_controller_ray in the same frame. +/// @param context A pointer to the keyboard's context. +/// @param normal Normal of the hit position. +/// @return true if the ray hits the keyboard. +bool gvr_keyboard_get_hit_normal(gvr_keyboard_context* context, + gvr_vec3f* normal); + /// Updates the touch state of the controller. /// /// @param context A pointer to the keyboard's context. @@ -277,6 +321,15 @@ int32_t eye_type, const gvr_recti* viewport); +/// Sets viewport when stereo multiview rendering is enabled. This function +/// should only be used if gvr_keyboard_set_stereo_multiview_enabled(true) is +/// called and returns true before creating the gvr_keyboard_context. +/// +/// @param context A pointer to the keyboard's context. +/// @param viewport The camera's viewport. +void gvr_keyboard_multiview_set_viewport(gvr_keyboard_context* context, + const gvr_recti* viewport); + /// Handles the new frame. This should be called once from the GL thread on /// every frame after the keyboard context is created and before calling /// `gvr_keyboard_render`. @@ -290,6 +343,12 @@ /// @param eye_type gvr eye type. void gvr_keyboard_render(gvr_keyboard_context* context, int32_t eye_type); +/// Renders the keyboard when stereo multiview rendering is enabled. This should +/// be called from the GL thread. This function should only be used if +/// gvr_keyboard_set_stereo_multiview_enabled(true) is called and returns true +/// before creating the gvr_keyboard_context. +void gvr_keyboard_multiview_render(gvr_keyboard_context* context); + /// Hides the keyboard. /// /// @param context A pointer to the keyboard's context.
diff --git a/third_party/libaom/cmake_update.sh b/third_party/libaom/cmake_update.sh index 8d8a25c0..c5cfb8b 100755 --- a/third_party/libaom/cmake_update.sh +++ b/third_party/libaom/cmake_update.sh
@@ -84,7 +84,7 @@ local IFS=$'\n' # Split git log output '<date>\n<commit hash>' on the newline to produce 2 # array entries. - local vals=($(git --no-pager log -1 --format="%cd%n%H" \ + local vals=($(git -C "${SRC}" --no-pager log -1 --format="%cd%n%H" \ --date=format:"%A %B %d %Y")) sed -E -i.bak \ -e "s/^(Date:)[[:space:]]+.*$/\1 ${vals[0]}/" \ @@ -175,9 +175,9 @@ gen_config_files linux/arm64 "${toolchain}/arm64-linux-gcc.cmake ${all_platforms}" ) -cd "${SRC}" update_readme -git cl format &> /dev/null || echo "ERROR: Run 'git cl format' manually." +git cl format > /dev/null \ + || echo "ERROR: 'git cl format' failed. Please run 'git cl format' manually." clean
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index f907cd79..fa5952e8 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -23352,6 +23352,15 @@ <int value="3" label="active, was active"/> </enum> +<enum name="GpuTerminationOrigin"> + <summary> + Return status re-encoded values from GpuTerminationOrigin as defined in + content/browser/gpu/gpu_process_host.h enum GpuTerminationOrigin. + </summary> + <int value="0" label="Unknown Origin">UNKNOWN_ORIGIN</int> + <int value="1" label="Ozone Wayland Proxy">OZONE_WAYLAND_PROXY</int> +</enum> + <enum name="GpuTerminationStatus"> <summary> Return status re-encoded values from GetTerminationStatus as defined in @@ -28321,6 +28330,7 @@ <int value="-844537521" label="HttpFormWarning:disabled"/> <int value="-844381918" label="ArcNativeBridgeExperiment:disabled"/> <int value="-842438090" label="enable-md-feedback"/> + <int value="-841849040" label="AutofillPreviewStyleExperiment:enabled"/> <int value="-839664591" label="enable-web-authentication-testing-api"/> <int value="-836123854" label="wallet-service-use-sandbox"/> <int value="-835672415" label="PointerEventV1SpecCapturing:disabled"/> @@ -28736,6 +28746,7 @@ <int value="36422284" label="AutofillSaveCardDialogUnlabeledExpirationDate:enabled"/> <int value="37024318" label="disable-affiliation-based-matching"/> + <int value="37045987" label="AutofillPreviewStyleExperiment:disabled"/> <int value="44088203" label="ExpensiveBackgroundTimerThrottling:enabled"/> <int value="48159177" label="reduced-referrer-granularity"/> <int value="48223610" label="SiteSettings:disabled"/> @@ -28912,6 +28923,7 @@ <int value="430959979" label="SyncStandaloneTransport:disabled"/> <int value="431691805" label="MediaDocumentDownloadButton:enabled"/> <int value="434033638" label="PwaPersistentNotification:disabled"/> + <int value="438048339" label="WarnBeforeQuitting:disabled"/> <int value="446316019" label="enable-threaded-compositing"/> <int value="451196246" label="disable-impl-side-painting"/> <int value="452139294" label="VrShellExperimentalRendering:enabled"/> @@ -28954,6 +28966,7 @@ <int value="513356954" label="InstantTethering:disabled"/> <int value="513372959" label="ViewsProfileChooser:enabled"/> <int value="517568645" label="AnimatedAppMenuIcon:disabled"/> + <int value="530158943" label="WarnBeforeQuitting:enabled"/> <int value="535131384" label="OmniboxTailSuggestions:enabled"/> <int value="535976218" label="enable-plugin-power-saver"/> <int value="538468149" label="OfflinePagesCT:enabled"/> @@ -44188,7 +44201,8 @@ <int value="24" label="MISSING_FILES_NO_SD_CARD"/> <int value="25" label="OFFLINE_INDICATOR"/> <int value="26" label="FEED_NTP_STREAM"/> - <int value="27" label="WEBAPK_TWA_PRIVACY_DISCLOSURE"/> + <int value="27" label="UMA_WEBAPK_PRIVACY_DISCLOSURE"/> + <int value="28" label="UMA_TWA_PRIVACY_DISCLOSURE"/> </enum> <enum name="SnippetOpenMethod">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index f372a443..ab48fdd 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -33348,6 +33348,19 @@ </summary> </histogram> +<histogram name="GPU.GPUProcessTerminationOrigin" enum="GpuTerminationOrigin" + expires_after="2019-08-14"> + <owner>rjkroege@chromium.org</owner> + <owner>msisov@igalia.com</owner> + <summary> + The reason a GPU process is terminated. It works only when + TERMINATION_STATUS_PROCESS_WAS_KILLED TerminationStatus is set. The goal of + this histogram is to get spikes of the above mentioned case when + Ozone/Wayland terminates the GPU process due to invalid data it received if + any. + </summary> +</histogram> + <histogram name="GPU.GPUProcessTerminationStatus" enum="TerminationStatus"> <obsolete> Deprecated April 2018. Replaced by GPU.GPUProcessTerminationStatus2. @@ -113394,46 +113407,90 @@ </summary> </histogram> +<histogram name="WebRTC.Audio.Agc.DigitalGainApplied" units="dB" + expires_after="2019-03-01"> + <owner>aleloi@chromium.org</owner> + <summary> + Logs adaptive digital compression gain that is applied by AgcManagerDirect. + A log call is made once per second. The compression gain is applied to the + microphone signal at the end of the processing chain. + </summary> +</histogram> + +<histogram name="WebRTC.Audio.Agc.DigitalGainUpdated" units="dB" + expires_after="2019-03-01"> + <owner>aleloi@chromium.org</owner> + <summary> + Logs adaptive digital compression gain that is applied by AgcManagerDirect. + A log call is made every time the gain changes. The compression gain is + applied to the microphone signal at the end of the processing chain. + </summary> +</histogram> + +<histogram name="WebRTC.Audio.Agc2.DigitalGainApplied" units="dB" + expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + Logs adaptive digital compression gain that is applied by + AdaptiveDigitalGainApplier in GainController2. A log call is made once per + second. The compression gain is applied to the microphone signal at the end + of the processing chain. + </summary> +</histogram> + +<histogram name="WebRTC.Audio.Agc2.EstimatedNoiseLevel" units="dB" + expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + This histogram reports the noise level estimation done in GainController2. A + value is reported every second. + </summary> +</histogram> + <histogram name="WebRTC.Audio.Agc2.FixedDigitalGainCurveRegion.Identity" - units="seconds"> + units="seconds" expires_after="2019-09-01"> <owner>aleloi@chromium.org</owner> <summary> The Fixed-Digital part of the AGC protects from saturation by reducing the level of too loud signals. This metric shows how long the level estimate - stays in the 'Identity' region. In this region no attanuating gain is - applied. + stays in the 'Identity' region. In this region no attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in + GainController2. </summary> </histogram> <histogram name="WebRTC.Audio.Agc2.FixedDigitalGainCurveRegion.Knee" - units="seconds"> + units="seconds" expires_after="2019-09-01"> <owner>aleloi@chromium.org</owner> <summary> The Fixed-Digital part of the AGC protects from saturation by reducing the level of too loud signals. This metric shows how long the level estimate - stays in the 'Knee' region. In this region some attanuating gain is applied. + stays in the 'Knee' region. In this region some attenuating gain is applied. + This metric is logged from the Fixed Digital limiter in GainController2. </summary> </histogram> <histogram name="WebRTC.Audio.Agc2.FixedDigitalGainCurveRegion.Limiter" - units="seconds"> + units="seconds" expires_after="2019-09-01"> <owner>aleloi@chromium.org</owner> <summary> The Fixed-Digital part of the AGC protects from saturation by reducing the level of too loud signals. This metric shows how long the level estimate - stays in the 'Limiter' region. In this region some more attanuating gain is - applied. + stays in the 'Limiter' region. In this region some more attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in + GainController2. </summary> </histogram> <histogram name="WebRTC.Audio.Agc2.FixedDigitalGainCurveRegion.Saturation" - units="seconds"> + units="seconds" expires_after="2019-09-01"> <owner>aleloi@chromium.org</owner> <summary> The Fixed-Digital part of the AGC protects from saturation by reducing the level of too loud signals. This metric shows how long the level estimate - stays in the 'Saturation' region. In this region much attanuating gain is - applied. + stays in the 'Saturation' region. In this region much attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in + GainController2. </summary> </histogram> @@ -113507,6 +113564,54 @@ </summary> </histogram> +<histogram name="WebRTC.Audio.AudioMixer.FixedDigitalGainCurveRegion.Identity" + units="seconds" expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + The Fixed-Digital part of the AGC protects from saturation by reducing the + level of too loud signals. This metric shows how long the level estimate + stays in the 'Identity' region. In this region no attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in the Audio + Mixer. + </summary> +</histogram> + +<histogram name="WebRTC.Audio.AudioMixer.FixedDigitalGainCurveRegion.Knee" + units="seconds" expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + The Fixed-Digital part of the AGC protects from saturation by reducing the + level of too loud signals. This metric shows how long the level estimate + stays in the 'Knee' region. In this region some attenuating gain is applied. + This metric is logged from the Fixed Digital limiter in the Audio Mixer. + </summary> +</histogram> + +<histogram name="WebRTC.Audio.AudioMixer.FixedDigitalGainCurveRegion.Limiter" + units="seconds" expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + The Fixed-Digital part of the AGC protects from saturation by reducing the + level of too loud signals. This metric shows how long the level estimate + stays in the 'Limiter' region. In this region some more attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in the Audio + Mixer. + </summary> +</histogram> + +<histogram + name="WebRTC.Audio.AudioMixer.FixedDigitalGainCurveRegion.Saturation" + units="seconds" expires_after="2019-09-01"> + <owner>aleloi@chromium.org</owner> + <summary> + The Fixed-Digital part of the AGC protects from saturation by reducing the + level of too loud signals. This metric shows how long the level estimate + stays in the 'Saturation' region. In this region much attenuating gain is + applied. This metric is logged from the Fixed Digital limiter in the Audio + Mixer. + </summary> +</histogram> + <histogram name="WebRTC.Audio.AudioMixer.MixingRate" enum="WebRtcNativeRate"> <owner>aleloi@chromium.org</owner> <summary>
diff --git a/tools/perf/core/bot_platforms.py b/tools/perf/core/bot_platforms.py index c0b086ec..9fd7fbf 100644 --- a/tools/perf/core/bot_platforms.py +++ b/tools/perf/core/bot_platforms.py
@@ -6,37 +6,69 @@ class PerfPlatform(object): - def __init__(self, name, is_fyi=False): + def __init__(self, name, description, is_fyi=False): self._name = name + self._description = description + # For sorting ignore case and "segments" in the bot name. + self._sort_key = name.lower().replace('-', ' ') self._is_fyi = is_fyi + def __lt__(self, other): + if not isinstance(other, type(self)): + return NotImplemented + # pylint: disable=protected-access + return self._sort_key < other._sort_key + @property def name(self): return self._name @property + def description(self): + return self._description + + @property + def platform(self): + value = self._sort_key.split(' ', 1)[0] + return 'windows' if value == 'win' else value + + @property + def is_fyi(self): + return self._is_fyi + + @property def buildbot_url(self): return ('https://ci.chromium.org/buildbot/chromium.perf/%s/' % urllib.quote(self._name)) # Linux -LINUX = PerfPlatform('linux-perf') +LINUX = PerfPlatform( + 'linux-perf', 'Ubuntu-14.04, 8 core, NVIDIA Quadro P400') # Mac -MAC_HIGH_END = PerfPlatform('mac-10_13_laptop_high_end-perf') -MAC_LOW_END = PerfPlatform('mac-10_12_laptop_low_end-perf') +MAC_HIGH_END = PerfPlatform( + 'mac-10_13_laptop_high_end-perf', + 'MacBook Pro, Core i7 2.8 GHz, 16GB RAM, 256GB SSD, Radeon 55') +MAC_LOW_END = PerfPlatform( + 'mac-10_12_laptop_low_end-perf', + 'MacBook Air, Core i5 1.8 GHz, 8GB RAM, 128GB SSD, HD Graphics') # Win -WIN_10 = PerfPlatform('win-10-perf') -WIN_7 = PerfPlatform('Win 7 Perf') -WIN_7_GPU = PerfPlatform('Win 7 Nvidia GPU Perf') +WIN_10 = PerfPlatform( + 'win-10-perf', + 'Windows Intel HD 630 towers, Core i7-7700 3.6 GHz, 16GB RAM,' + ' Intel Kaby Lake HD Graphics 630') +WIN_7 = PerfPlatform('Win 7 Perf', 'N/A') +WIN_7_GPU = PerfPlatform('Win 7 Nvidia GPU Perf', 'N/A') # Android -ANDROID_GO = PerfPlatform('android-go-perf') -ANDROID_NEXUS_5 = PerfPlatform('Android Nexus5 Perf') -ANDROID_NEXUS_5X = PerfPlatform('android-nexus5x-perf') -ANDROID_NEXUS_5X_WEBVIEW = PerfPlatform('Android Nexus5X WebView Perf') -ANDROID_NEXUS_6_WEBVIEW = PerfPlatform('Android Nexus6 WebView Perf') +ANDROID_GO = PerfPlatform('android-go-perf', 'Android O') +ANDROID_NEXUS_5 = PerfPlatform('Android Nexus5 Perf', 'Android KOT49H') +ANDROID_NEXUS_5X = PerfPlatform('android-nexus5x-perf', 'Android MMB29Q') +ANDROID_NEXUS_5X_WEBVIEW = PerfPlatform( + 'Android Nexus5X WebView Perf', 'Android AOSP MOB30K') +ANDROID_NEXUS_6_WEBVIEW = PerfPlatform( + 'Android Nexus6 WebView Perf', 'Android AOSP MOB30K') ALL_PLATFORMS = { p for p in locals().values() if isinstance(p, PerfPlatform)
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index a99b6cf..943ef7a 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -23,6 +23,7 @@ import tempfile +from core import bot_platforms from core import path_util from core import undocumented_benchmarks as ub_module path_util.AddTelemetryToPath() @@ -806,11 +807,35 @@ writer.writerows(csv_data) -def validate_tests(waterfall, waterfall_file, benchmark_file): +def update_labs_docs_md(filepath): + configs = collections.defaultdict(list) + for tester in bot_platforms.ALL_PLATFORMS: + if not tester.is_fyi: + configs[tester.platform].append(tester) + + with open(filepath, 'w') as f: + f.write(""" +[comment]: # (AUTOGENERATED FILE DO NOT EDIT) +[comment]: # (See //tools/perf/generate_perf_data to make changes) + +# Platforms tested in the Performance Lab + +""") + for platform, testers in sorted(configs.iteritems()): + f.write('## %s\n\n' % platform.title()) + testers.sort() + for tester in testers: + f.write(' * [{0.name}]({0.buildbot_url}): {0.description}.\n'.format( + tester)) + f.write('\n') + + +def validate_tests(waterfall, waterfall_file, benchmark_file, labs_docs_file): up_to_date = True waterfall_tempfile = tempfile.NamedTemporaryFile(delete=False).name benchmark_tempfile = tempfile.NamedTemporaryFile(delete=False).name + labs_docs_tempfile = tempfile.NamedTemporaryFile(delete=False).name try: update_all_tests(waterfall, waterfall_tempfile) @@ -818,9 +843,13 @@ update_benchmark_csv(benchmark_tempfile) up_to_date &= filecmp.cmp(benchmark_file, benchmark_tempfile) + + update_labs_docs_md(labs_docs_tempfile) + up_to_date &= filecmp.cmp(labs_docs_file, labs_docs_tempfile) finally: os.remove(waterfall_tempfile) os.remove(benchmark_tempfile) + os.remove(labs_docs_tempfile) return up_to_date @@ -988,18 +1017,21 @@ benchmark_file = os.path.join( path_util.GetChromiumSrcDir(), 'tools', 'perf', 'benchmark.csv') + labs_docs_file = os.path.join( + path_util.GetChromiumSrcDir(), 'docs', 'speed', 'perf_lab_platforms.md') + if options.validate_only: if validate_tests(get_waterfall_builder_config(), - waterfall_file, benchmark_file): - print 'All the perf JSON config files are up-to-date. \\o/' + waterfall_file, benchmark_file, labs_docs_file): + print 'All the perf config files are up-to-date. \\o/' return 0 else: - print ('The perf JSON config files are not up-to-date. Please run %s ' - 'without --validate-only flag to update the perf JSON ' - 'configs and benchmark.csv.') % sys.argv[0] + print ('Not all perf config files are up-to-date. Please run %s ' + 'to update them.') % sys.argv[0] return 1 else: load_and_update_fyi_json(fyi_waterfall_file) update_all_tests(get_waterfall_builder_config(), waterfall_file) update_benchmark_csv(benchmark_file) + update_labs_docs_md(labs_docs_file) return 0
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index f690378..efd02728 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -6,13 +6,7 @@ # tags: Android_Webview Android_but_not_webview Mac Win Linux # tags: ChromeOS Android Desktop Nexus_5 Nexus_5X Nexus_6P # tags: Nexus_7 Mac_10.11 Mac_10.12 Nexus6_Webview Nexus5X_Webview - -# Benchmark: blink_perf.bindings -crbug.com/764868 [ Android_One ] blink_perf.bindings/structured-clone-long-string-deserialize.html [ Skip ] -crbug.com/764868 [ Android_One ] blink_perf.bindings/structured-clone-json-serialize.html [ Skip ] -crbug.com/764868 [ Android_One ] blink_perf.bindings/structured-clone-long-string-serialize.html [ Skip ] -crbug.com/764868 [ Android_One ] blink_perf.bindings/structured-clone-json-deserialize.html [ Skip ] -crbug.com/764868 [ Android_One ] blink_perf.bindings/worker-structured-clone-json-serialize.html [ Skip ] +# tags: Win_7 Win_10 # Benchmark: blink_perf.canvas crbug.com/593973 [ Android_Svelte ] blink_perf.canvas/* [ Skip ] @@ -24,30 +18,18 @@ crbug.com/853738 [ Android_Webview ] blink_perf.canvas/upload-video-to-sub-texture.html [ Skip ] crbug.com/853738 [ Android_Webview ] blink_perf.canvas/upload-video-to-texture.html [ Skip ] -# Benchmark: blink_perf.events -crbug.com/799184 [ Android_One ] blink_perf.events/EventsDispatchingInShadowTrees.html [ Skip ] - # Benchmark: blink_perf.layout crbug.com/551950 [ Android_Svelte ] blink_perf.layout/* [ Skip ] crbug.com/832686 [ Nexus_5 ] blink_perf.layout/subtree-detaching.html [ Skip ] -crbug.com/832686 [ Nexus_7 ] blink_perf.layout/subtree-detaching.html [ Skip ] -crbug.com/839494 [ Android_One ] blink_perf.layout/subtree-detaching.html [ Skip ] # Benchmark: blink_perf.paint crbug.com/574483 [ Android_Svelte ] blink_perf.paint/* [ Skip ] crbug.com/799540 [ Nexus_5 ] blink_perf.paint/* [ Skip ] -crbug.com/799540 [ Nexus_7 ] blink_perf.paint/* [ Skip ] crbug.com/859979 [ Android_Webview ] blink_perf.paint/paint-offset-changes.html [ Skip ] -# Benchmark: blink_perf.parser -crbug.com/796115 [ Android_One ] blink_perf.parser/html5-full-render.html [ Skip ] - # Benchmark: blink_perf.shadow_dom crbug.com/702319 [ Nexus_5X ] blink_perf.shadow_dom/* [ Skip ] -# Benchmark: dromaeo -crbug.com/844541 [ Android_One ] dromaeo/http://dromaeo.com?dom-modify [ Skip ] -# # Benchmark: dummy_benchmark crbug.com/848900 [ Win ] dummy_benchmark.histogram_benchmark_1/dummy_page.html [ Skip ] crbug.com/848900 [ Win ] dummy_benchmark.stable_benchmark_1/dummy_page.html [ Skip ] @@ -60,7 +42,6 @@ crbug.com/736817 [ Nexus_5X ] blink_perf.svg/Worldcup.html [ Skip ] crbug.com/736817 [ Nexus_5X ] blink_perf.svg/FlowerFromMyGarden.html [ Skip ] crbug.com/736817 [ Nexus_5X ] blink_perf.svg/SvgNestedUse.html [ Skip ] -crbug.com/832806 [ Android_One ] blink_perf.svg/SierpinskiCarpet.html [ Skip ] crbug.com/846061 [ Win Mac ] blink_perf.svg/SierpinskiCarpet.html [ Skip ] crbug.com/850293 [ All ] blink_perf.svg/Cowboy_transform.html [ Skip ] @@ -75,12 +56,10 @@ crbug.com/867836 [ All ] loading.desktop/Elmundo_warm [ Skip ] # Benchmark: loading.mobile -crbug.com/776092 [ Android_One ] loading.mobile/GoogleRedirectToGoogleJapan [ Skip ] crbug.com/656861 [ All ] loading.mobile/G1 [ Skip ] crbug.com/857108 [ Nexus_5 ] loading.mobile/G1_3g [ Skip ] [ Nexus_5X ] loading.mobile/Hongkiat [ Skip ] [ Nexus_5X ] loading.mobile/Dramaq [ Skip ] -[ Nexus_7 ] loading.mobile/Facebook [ Skip ] crbug.com/859597 [ All ] loading.mobile/Bradesco_3g [ Skip ] crbug.com/859597 [ All ] loading.mobile/Dailymotion_3g [ Skip ] crbug.com/859597 [ All ] loading.mobile/Dawn_3g [ Skip ] @@ -95,7 +74,6 @@ crbug.com/859597 [ All ] loading.mobile/TheStar_3g [ Skip ] crbug.com/859597 [ All ] loading.mobile/YahooNews_3g [ Skip ] crbug.com/859597 [ Nexus_5 ] loading.mobile/FlipBoard_cold_3g [ Skip ] -crbug.com/867066 [ Android_One ] loading.mobile/FlipBoard_cold_3g [ Skip ] crbug.com/862663 [ Nexus_5 ] loading.mobile/GoogleBrazil_3g [ Skip ] crbug.com/862663 [ Nexus_5 ] loading.mobile/GoogleIndonesia_3g [ Skip ] crbug.com/862663 [ Nexus_5 ] loading.mobile/GoogleRedirectToGoogleJapan_3g [ Skip ] @@ -105,13 +83,11 @@ crbug.com/859597 [ Nexus5X_Webview ] loading.mobile/Hongkiat_3g [ Skip ] crbug.com/859597 [ Nexus_5X ] loading.mobile/TribunNews_3g [ Skip ] crbug.com/859597 [ Nexus5X_Webview ] loading.mobile/TribunNews_3g [ Skip ] -crbug.com/859597 [ Android_One ] loading.mobile/Facebook_3g [ Skip ] crbug.com/859597 [ Nexus_5X ] loading.mobile/GoogleIndonesia_3g [ Skip ] crbug.com/859597 [ Nexus_5X ] loading.mobile/QQNews_3g [ Skip ] crbug.com/859597 [ Nexus_5X ] loading.mobile/Youtube_3g [ Skip ] crbug.com/859597 [ Nexus5X_Webview ] loading.mobile/GoogleBrazil_3g [ Skip ] crbug.com/867103 [ Nexus5X_Webview ] loading.mobile/FlipBoard_warm_3g [ Skip ] -crbug.com/871421 [ Android_One ] loading.mobile/Dramaq_3g [ Skip ] crbug.com/873032 [ Android_Webview ] loading.mobile/GoogleRedirectToGoogleJapan_3g [ Skip ] crbug.com/873033 [ Android_but_not_webview ] loading.mobile/FlipKart_warm_3g [ Skip ] crbug.com/676612 [ Nexus6_Webview ] loading.mobile/FlipBoard_cold_3g [ Skip ] @@ -127,9 +103,6 @@ # Benchmark: memory.long_running_idle_gmail_background_tbmv2 crbug.com/611167 [ Android_Svelte ] memory.long_running_idle_gmail_background_tbmv2/* [ Skip ] -# Benchmark: octane -crbug.com/764875 [ Android_One ] octane/http://chromium.github.io/octane/index.html?auto=1 [ Skip ] - # Benchmark: oilpan_gc_times.key_silk_cases crbug.com/446332 [ All ] oilpan_gc_times.key_silk_cases/slide_drawer [ Skip ] crbug.com/507865 [ All ] oilpan_gc_times.key_silk_cases/polymer_topeka [ Skip ] @@ -148,15 +121,12 @@ # Benchmark: rendering.mobile crbug.com/785485 [ Android_Webview ] rendering.mobile/kevs_3d [ Skip ] -crbug.com/755657 [ Android_One ] rendering.mobile/canvas_to_blob [ Skip ] crbug.com/785286 [ Android_Webview ] rendering.mobile/smash_cat [ Skip ] crbug.com/785286 [ Android_Webview ] rendering.mobile/effect_games [ Skip ] crbug.com/364248 [ Nexus_5 ] rendering.mobile/geo_apis [ Skip ] crbug.com/825234 [ Android_Webview ] rendering.mobile/bouncing_balls_shadow [ Skip ] crbug.com/350692 [ All ] rendering.mobile/microsoft_performance [ Skip ] crbug.com/755556 [ Android ] rendering.mobile/balls_css_key_frame_animations_composited_transform [ Skip ] -crbug.com/829499 [ Android_One ] rendering.mobile/css_animations_many_keyframes [ Skip ] -crbug.com/829499 [ Android_One ] rendering.mobile/web_animations_many_keyframes [ Skip ] crbug.com/840964 [ Nexus_5X ] rendering.mobile/web_animations_many_keyframes [ Skip ] crbug.com/653993 [ Android_Webview ] rendering.mobile/maps_perf_test [ Skip ] [ All ] rendering.mobile/core_scroll_header_panel [ Skip ] # Polymer test, needs to be modernized. @@ -179,7 +149,6 @@ crbug.com/785473 [ Android_Webview ] rendering.mobile/canvas_60000_pixels_per_second [ Skip ] crbug.com/785473 [ Android_Webview ] rendering.mobile/canvas_90000_pixels_per_second [ Skip ] crbug.com/850295 [ All ] rendering.mobile/aquarium_20k [ Skip ] -crbug.com/795060 [ Android_One ] rendering.mobile/extra_large_texture_uploads [ Skip ] crbug.com/780525 [ All ] rendering.mobile/polymer_topeka [ Skip ] crbug.com/461127 [ All ] rendering.mobile/famo_us_twitter_demo [ Skip ] crbug.com/850295 [ All ] rendering.mobile/aquarium_20k [ Skip ] @@ -189,16 +158,12 @@ crbug.com/764825 [ All ] rendering.mobile/masonry [ Skip ] crbug.com/338838 [ All ] rendering.mobile/basic_stream [ Skip ] crbug.com/338838 [ All ] rendering.mobile/basic_stream [ Skip ] -crbug.com/867072 [ Android_One ] rendering.mobile/microsoft_fireflies [ Skip ] -crbug.com/867075 [ Android_One ] rendering.mobile/microsoft_snow [ Skip ] crbug.com/873013 [ Android_Webview ] rendering.mobile/yahoo_answers_mobile_2018 [ Skip ] crbug.com/873014 [ Android_Webview ] rendering.mobile/yahoo_answers_mobile_sync_scroll_2018 [ Skip ] # Benchmark: rasterize_and_record_micro.top_25 -crbug.com/768010 [ Android_One ] rasterize_and_record_micro.top_25/file://static_top_25/yahoonews.html [ Skip ] crbug.com/764543 [ All ] rasterize_and_record_micro.top_25/file://static_top_25/wikipedia.html [ Skip ] crbug.com/815193 [ Android ] rasterize_and_record_micro.top_25/file://static_top_25/wikipedia.html [ Skip ] -crbug.com/842175 [ Android_One ] rasterize_and_record_micro.top_25/file://static_top_25/espn.html [ Skip ] crbug.com/873011 [ Android_Webview ] rasterize_and_record_micro.top_25/file://static_top_25/yahoonews.html [ Skip ] @@ -209,14 +174,10 @@ crbug.com/846022 [ Linux ] system_health.common_desktop/browse:social:twitter_infinite_scroll [ Skip ] # Benchmark: system_health.common_mobile -crbug.com/865464 [ Android_Webview ] system_health.common_mobile/browse:chrome:omnibox [ Skip ] crbug.com/714650 [ Android ] system_health.common_mobile/browse:news:globo [ Skip ] -crbug.com/865466 [ Android_Webview ] system_health.common_mobile/long_running:tools:gmail-background [ Skip ] crbug.com/708300 [ Android ] system_health.common_mobile/browse:shopping:flipkart [ Skip ] -crbug.com/865471 [ Android_Webview ] system_health.common_mobile/browse:chrome:newtab [ Skip ] crbug.com/738854 [ Nexus_5X ] system_health.common_mobile/load:tools:drive [ Skip ] crbug.com/738854 [ Android_Webview ] system_health.common_mobile/load:tools:drive [ Skip ] -crbug.com/867079 [ Android_One ] system_health.common_mobile/browse:news:toi [ Skip ] # Benchmark: system_health.memory_desktop crbug.com/728576 [ Mac ] system_health.memory_desktop/browse:news:cnn [ Skip ] @@ -270,7 +231,6 @@ # Benchmark: media.mobile crbug.com/859175 [ Android ] media.mobile/video.html?src=tulip2.vp9.webm_Regular-3G [ Skip ] -crbug.com/867068 [ Android_One ] media.mobile/video.html?src=tulip2.vp9.webm&background [ Skip ] # Benchmark: v8.browsing_desktop crbug.com/773084 [ Mac ] v8.browsing_desktop/browse:tools:maps [ Skip ] @@ -307,14 +267,6 @@ crbug.com/714650 [ Android ] v8.browsing_mobile/browse:news:globo [ Skip ] crbug.com/767970 [ Android ] v8.browsing_mobile/browse:shopping:flipkart [ Skip ] crbug.com/708300 [ Android ] v8.browsing_mobile/browse:shopping:flipkart [ Skip ] -crbug.com/788797 [ Android_One ] v8.browsing_mobile/browse:social:facebook_infinite_scroll [ Skip ] -crbug.com/788797 [ Android_One ] v8.browsing_mobile/browse:social:pinterest_infinite_scroll [ Skip ] -crbug.com/803870 [ Android_One ] v8.browsing_mobile/browse:social:tumblr_infinite_scroll [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile/browse:tech:discourse_infinite_scroll [ Skip ] -crbug.com/768472 [ Android_One ] v8.browsing_mobile/browse:shopping:lazada [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile/browse:shopping:avito [ Skip ] -crbug.com/803870 [ Android_One ] v8.browsing_mobile/browse:media:youtube [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile/browse:news:cnn [ Skip ] [ Android_Webview ] v8.browsing_mobile/browse:chrome:omnibox [ Skip ] [ Android_Webview ] v8.browsing_mobile/browse:chrome:newtab [ Skip ] crbug.com/815175 [ Nexus_5 ] v8.browsing_mobile/browse:chrome:newtab [ Skip ] @@ -325,21 +277,11 @@ crbug.com/714650 [ Android ] v8.browsing_mobile-future/browse:news:globo [ Skip ] crbug.com/767970 [ Android ] v8.browsing_mobile-future/browse:shopping:flipkart [ Skip ] crbug.com/708300 [ Android ] v8.browsing_mobile-future/browse:shopping:flipkart [ Skip ] -crbug.com/788797 [ Android_One ] v8.browsing_mobile-future/browse:social:facebook_infinite_scroll [ Skip ] -crbug.com/788797 [ Android_One ] v8.browsing_mobile-future/browse:social:pinterest_infinite_scroll [ Skip ] -crbug.com/816486 [ Android_One ] v8.browsing_mobile-future/browse:social:tumblr_infinite_scroll [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile-future/browse:tech:discourse_infinite_scroll [ Skip ] -crbug.com/768472 [ Android_One ] v8.browsing_mobile-future/browse:shopping:lazada [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile-future/browse:shopping:avito [ Skip ] -crbug.com/803870 [ Android_One ] v8.browsing_mobile-future/browse:media:youtube [ Skip ] -crbug.com/767970 [ Android_One ] v8.browsing_mobile-future/browse:news:cnn [ Skip ] [ Android_Webview ] v8.browsing_mobile-future/browse:chrome:omnibox [ Skip ] [ Android_Webview ] v8.browsing_mobile-future/browse:chrome:newtab [ Skip ] crbug.com/803465 [ Nexus_5 ] v8.browsing_mobile-future/browse:chrome:newtab [ Skip ] crbug.com/799080 [ Nexus_5X Android_Webview ] v8.browsing_mobile-future/browse:social:facebook [ Skip ] -crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:news:cnn [ Skip ] crbug.com/799080 [ Nexus_5X Android_Webview ] v8.browsing_mobile-future/browse:social:facebook [ Skip ] -crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:news:cnn [ Skip ] # Benchmark: v8.detached_context_age_in_gc crbug.com/770982 [ Win ] v8.detached_context_age_in_gc/Docs_(1_open_document_tab) [ Skip ] @@ -349,7 +291,6 @@ crbug.com/664318 [ Android ] v8.runtime_stats.top_25/* [ Skip ] # Benchmark: wasm -[ Android_One ] wasm/WasmSpaceBuggy [ Skip ] crbug.com/814012 [ Mac ] wasm/AsmJsZenGarden [ Skip ] crbug.com/814012 [ Win ] wasm/AsmJsZenGarden [ Skip ] crbug.com/860570 [ Mac ] wasm/WasmStylizedRenderer [ Skip ]
diff --git a/tools/perf/page_sets/system_health/chrome_stories.py b/tools/perf/page_sets/system_health/chrome_stories.py index 0fdb5ca..5d29e7d7 100644 --- a/tools/perf/page_sets/system_health/chrome_stories.py +++ b/tools/perf/page_sets/system_health/chrome_stories.py
@@ -38,6 +38,8 @@ URL = 'https://www.google.co.in' SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY TAGS = [story_tags.EMERGING_MARKET] + # WebView has no omnibox, so not supported. + WEBVIEW_NOT_SUPPORTED = True def _DidLoadDocument(self, action_runner): app_ui = action_runner.tab.browser.GetAppUi() @@ -72,6 +74,8 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY TAGS = [story_tags.EMERGING_MARKET] + # WebView has no tabs, so this story is not supported there. + WEBVIEW_NOT_SUPPORTED = True def _DidLoadDocument(self, action_runner): app_ui = action_runner.tab.browser.GetAppUi()
diff --git a/tools/perf/page_sets/system_health/long_running_stories.py b/tools/perf/page_sets/system_health/long_running_stories.py index 3e4490d3..fb49fdf3 100644 --- a/tools/perf/page_sets/system_health/long_running_stories.py +++ b/tools/perf/page_sets/system_health/long_running_stories.py
@@ -97,6 +97,9 @@ class LongRunningGmailMobileBackgroundStory(_LongRunningGmailMobileBase): BACKGROUND = True NAME = 'long_running:tools:gmail-background' + # This runs a gmail story in a background tab, and tabs aren't supported + # on WebView. + WEBVIEW_NOT_SUPPORTED = True class LongRunningGmailDesktopBackgroundStory(_LongRunningGmailDesktopBase):
diff --git a/tools/perf/page_sets/system_health/system_health_story.py b/tools/perf/page_sets/system_health/system_health_story.py index 83656f58..2c2ad2c 100644 --- a/tools/perf/page_sets/system_health/system_health_story.py +++ b/tools/perf/page_sets/system_health/system_health_story.py
@@ -22,6 +22,10 @@ """ def CanRunOnBrowser(self, browser_info, story): + if (browser_info.browser_type.startswith('android-webview') and + story.WEBVIEW_NOT_SUPPORTED): + return False + if story.TAGS and story_tags.WEBGL in story.TAGS: return browser_info.HasWebGLSupport() return True @@ -56,6 +60,7 @@ SUPPORTED_PLATFORMS = platforms.ALL_PLATFORMS TAGS = [] PLATFORM_SPECIFIC = False + WEBVIEW_NOT_SUPPORTED = False def __init__(self, story_set, take_memory_measurement, extra_browser_args=None): @@ -108,3 +113,4 @@ action_runner.tab.WaitForDocumentReadyStateToBeComplete() self._DidLoadDocument(action_runner) self._Measure(action_runner) +
diff --git a/ui/android/java/res/color/blue_when_enabled.xml b/ui/android/java/res/color/blue_when_enabled.xml new file mode 100644 index 0000000..dfd59b0 --- /dev/null +++ b/ui/android/java/res/color/blue_when_enabled.xml
@@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2018 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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_enabled="false" android:color="@color/black_alpha_38" /> + <item android:color="@color/modern_blue_600"/> +</selector>
diff --git a/ui/android/java/res/values-v17/styles.xml b/ui/android/java/res/values-v17/styles.xml index 67540bf..37a18b3e 100644 --- a/ui/android/java/res/values-v17/styles.xml +++ b/ui/android/java/res/values-v17/styles.xml
@@ -154,7 +154,7 @@ <item name="android:textAllCaps">true</item> </style> <style name="BlueButtonText2" parent="RobotoMediumStyle" tools:ignore="UnusedResources"> - <item name="android:textColor">@color/modern_blue_600</item> + <item name="android:textColor">@color/blue_when_enabled</item> <item name="android:textSize">@dimen/text_size_medium</item> <item name="android:textAllCaps">true</item> </style>
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 0337a03..a7bf215 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -246,9 +246,6 @@ // Use the new contacts picker, if available. if (shouldUseContactsPicker() && UiUtils.showContactsPicker(activity, this, mAllowMultiple, mFileTypes)) { - // Since the dialog is not implemented, cancel the request so we can serve others. - // This will be removed once the select/cancel actions are implemented. - onFileNotSelected(); return; }
diff --git a/ui/aura/local/window_port_local.cc b/ui/aura/local/window_port_local.cc index 50d6b04..56c7db03 100644 --- a/ui/aura/local/window_port_local.cc +++ b/ui/aura/local/window_port_local.cc
@@ -67,8 +67,7 @@ WindowPortLocal::~WindowPortLocal() { if (frame_sink_id_.is_valid()) { - auto* context_factory_private = - aura::Env::GetInstance()->context_factory_private(); + auto* context_factory_private = window_->env()->context_factory_private(); auto* host_frame_sink_manager = context_factory_private->GetHostFrameSinkManager(); host_frame_sink_manager->InvalidateFrameSinkId(frame_sink_id_);
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 36b7c9b..043590a9 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc
@@ -1197,6 +1197,12 @@ observer.OnWindowOpacitySet(this, reason); } +void Window::OnLayerAlphaShapeChanged() { + WindowOcclusionTracker::ScopedPauseOcclusionTracking pause_occlusion_tracking; + for (WindowObserver& observer : observers_) + observer.OnWindowAlphaShapeSet(this); +} + void Window::OnLayerTransformed(const gfx::Transform& old_transform, ui::PropertyChangeReason reason) { port_->OnDidChangeTransform(old_transform, layer()->transform());
diff --git a/ui/aura/window.h b/ui/aura/window.h index 080eb1a..f61dcab 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h
@@ -553,6 +553,7 @@ void OnLayerTransformed(const gfx::Transform& old_transform, ui::PropertyChangeReason reason) override; void OnLayerOpacityChanged(ui::PropertyChangeReason reason) override; + void OnLayerAlphaShapeChanged() override; // Overridden from ui::EventTarget: bool CanAcceptEvent(const ui::Event& event) override;
diff --git a/ui/aura/window_observer.h b/ui/aura/window_observer.h index 2cd3271..65e10f9 100644 --- a/ui/aura/window_observer.h +++ b/ui/aura/window_observer.h
@@ -91,17 +91,6 @@ const gfx::Rect& new_bounds, ui::PropertyChangeReason reason) {} - // Invoked when the opacity of the |window|'s layer is set (even if it didn't - // change). |reason| indicates whether the opacity was set directly or by an - // animation. This won't necessarily be called at every step of an animation. - // However, it will always be called before the first frame of the animation - // is rendered and when the animation ends. The client can determine whether - // the animation is ending by calling - // window->layer()->GetAnimator()->IsAnimatingProperty( - // ui::LayerAnimationElement::OPACITY). - virtual void OnWindowOpacitySet(Window* window, - ui::PropertyChangeReason reason) {} - // Invoked before Window::SetTransform() sets the transform of a window. virtual void OnWindowTargetTransformChanging( Window* window, @@ -118,6 +107,20 @@ virtual void OnWindowTransformed(Window* window, ui::PropertyChangeReason reason) {} + // Invoked when the opacity of the |window|'s layer is set (even if it didn't + // change). |reason| indicates whether the opacity was set directly or by an + // animation. This won't necessarily be called at every step of an animation. + // However, it will always be called before the first frame of the animation + // is rendered and when the animation ends. The client can determine whether + // the animation is ending by calling + // window->layer()->GetAnimator()->IsAnimatingProperty( + // ui::LayerAnimationElement::OPACITY). + virtual void OnWindowOpacitySet(Window* window, + ui::PropertyChangeReason reason) {} + + // Invoked when the alpha shape of the |window|'s layer is set. + virtual void OnWindowAlphaShapeSet(Window* window) {} + // Invoked when |window|'s position among its siblings in the stacking order // has changed. virtual void OnWindowStackingChanged(Window* window) {}
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 602d4fc..40bb14c5 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc
@@ -1795,7 +1795,7 @@ ui::PropertyChangeReason::NOT_FROM_ANIMATION; }; - struct LayerRecreatedInfo { + struct CountAndWindow { int count = 0; Window* window = nullptr; }; @@ -1815,6 +1815,8 @@ return window_opacity_info_; } + const CountAndWindow& alpha_shape_info() const { return alpha_shape_info_; } + const WindowTargetTransformChangingInfo& window_target_transform_changing_info() const { return window_target_transform_changing_info_; @@ -1824,7 +1826,7 @@ return window_transformed_info_; } - const LayerRecreatedInfo& layer_recreated_info() const { + const CountAndWindow& layer_recreated_info() const { return layer_recreated_info_; } @@ -1900,6 +1902,11 @@ window_opacity_info_.reason = reason; } + void OnWindowAlphaShapeSet(Window* window) override { + ++alpha_shape_info_.count; + alpha_shape_info_.window = window; + } + void OnWindowTargetTransformChanging( Window* window, const gfx::Transform& new_transform) override { @@ -1931,7 +1938,8 @@ WindowOpacityInfo window_opacity_info_; WindowTargetTransformChangingInfo window_target_transform_changing_info_; WindowTransformedInfo window_transformed_info_; - LayerRecreatedInfo layer_recreated_info_; + CountAndWindow alpha_shape_info_; + CountAndWindow layer_recreated_info_; DISALLOW_COPY_AND_ASSIGN(WindowObserverTest); }; @@ -2146,6 +2154,22 @@ window_opacity_info().reason); } +// Verify that WindowObserver::OnWindowAlphaShapeSet() is notified when an alpha +// shape is set for a window. +TEST_P(WindowObserverTest, WindowAlphaShapeChanged) { + std::unique_ptr<Window> window(CreateTestWindowWithId(1, root_window())); + window->AddObserver(this); + + auto shape = std::make_unique<ui::Layer::ShapeRects>(); + shape->emplace_back(0, 0, 10, 20); + + EXPECT_EQ(0, alpha_shape_info().count); + EXPECT_EQ(nullptr, alpha_shape_info().window); + window->layer()->SetAlphaShape(std::move(shape)); + EXPECT_EQ(1, alpha_shape_info().count); + EXPECT_EQ(window.get(), alpha_shape_info().window); +} + // Verify that WindowObserver::OnWindow(TargetTransformChanging|Transformed)() // are notified when SetTransform() is called and there is no animation. TEST_P(WindowObserverTest, SetTransform) {
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index 9a6e9b7..22c2dfe 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc
@@ -480,6 +480,9 @@ alpha_shape_ = std::move(shape); SetLayerFilters(); + + if (delegate_) + delegate_->OnLayerAlphaShapeChanged(); } void Layer::SetLayerFilters() {
diff --git a/ui/compositor/layer_delegate.cc b/ui/compositor/layer_delegate.cc index 153c7f5c..b046c4e7 100644 --- a/ui/compositor/layer_delegate.cc +++ b/ui/compositor/layer_delegate.cc
@@ -14,4 +14,6 @@ void LayerDelegate::OnLayerOpacityChanged(PropertyChangeReason reason) {} +void LayerDelegate::OnLayerAlphaShapeChanged() {} + } // namespace ui
diff --git a/ui/compositor/layer_delegate.h b/ui/compositor/layer_delegate.h index 1b3c40b..a4b00d32 100644 --- a/ui/compositor/layer_delegate.h +++ b/ui/compositor/layer_delegate.h
@@ -40,6 +40,9 @@ PropertyChangeReason reason); virtual void OnLayerOpacityChanged(PropertyChangeReason reason); + // Invoked when the alpha shape is set. + virtual void OnLayerAlphaShapeChanged(); + protected: virtual ~LayerDelegate() {} };
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc index 8ccf6a4..56b5581 100644 --- a/ui/compositor/layer_unittest.cc +++ b/ui/compositor/layer_unittest.cc
@@ -316,6 +316,7 @@ MOCK_METHOD2(OnLayerTransformed, void(const gfx::Transform&, PropertyChangeReason)); MOCK_METHOD1(OnLayerOpacityChanged, void(PropertyChangeReason)); + MOCK_METHOD0(OnLayerAlphaShapeChanged, void()); void reset() { color_index_ = 0; @@ -2639,6 +2640,26 @@ testing::Mock::VerifyAndClear(&delegate); } +// Verify that LayerDelegate::OnLayerAlphaShapeChanged() is called when the +// alpha shape of a layer is set. +TEST(LayerDelegateTest, OnLayerAlphaShapeChanged) { + auto layer = std::make_unique<Layer>(LAYER_TEXTURED); + testing::StrictMock<TestLayerDelegate> delegate; + layer->set_delegate(&delegate); + + // Set an alpha shape for the layer. Expect the delegate to be notified. + auto shape = std::make_unique<Layer::ShapeRects>(); + shape->emplace_back(0, 0, 10, 20); + EXPECT_CALL(delegate, OnLayerAlphaShapeChanged()); + layer->SetAlphaShape(std::move(shape)); + testing::Mock::VerifyAndClear(&delegate); + + // Clear the alpha shape for the layer. Expect the delegate to be notified. + EXPECT_CALL(delegate, OnLayerAlphaShapeChanged()); + layer->SetAlphaShape(nullptr); + testing::Mock::VerifyAndClear(&delegate); +} + TEST_F(LayerWithRealCompositorTest, CompositorAnimationObserverTest) { std::unique_ptr<Layer> root(CreateLayer(LAYER_TEXTURED));
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc index 95992eb..ea4dc6a1 100644 --- a/ui/gfx/paint_vector_icon.cc +++ b/ui/gfx/paint_vector_icon.cc
@@ -294,18 +294,15 @@ SkScalar arc_sweep_flag = arg(4); SkScalar x = arg(5); SkScalar y = arg(6); + SkPath::ArcSize arc_size = + large_arc_flag ? SkPath::kLarge_ArcSize : SkPath::kSmall_ArcSize; + SkPath::Direction direction = + arc_sweep_flag ? SkPath::kCW_Direction : SkPath::kCCW_Direction; - auto path_fn = - command_type == ARC_TO - ? static_cast<void (SkPath::*)( - SkScalar, SkScalar, SkScalar, SkPath::ArcSize, - SkPath::Direction, SkScalar, SkScalar)>(&SkPath::arcTo) - : &SkPath::rArcTo; - (path.*path_fn)( - rx, ry, angle, - large_arc_flag ? SkPath::kLarge_ArcSize : SkPath::kSmall_ArcSize, - arc_sweep_flag ? SkPath::kCW_Direction : SkPath::kCCW_Direction, x, - y); + if (command_type == ARC_TO) + path.arcTo(rx, ry, angle, arc_size, direction, x, y); + else + path.rArcTo(rx, ry, angle, arc_size, direction, x, y); break; }
diff --git a/ui/ozone/common/linux/BUILD.gn b/ui/ozone/common/linux/BUILD.gn index de979e68..0d62943e 100644 --- a/ui/ozone/common/linux/BUILD.gn +++ b/ui/ozone/common/linux/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/ui.gni") import("//ui/ozone/ozone.gni") -assert(ozone_platform_gbm) +assert(ozone_platform_gbm || ozone_platform_wayland) source_set("linux") { sources = [
diff --git a/ui/ozone/common/linux/drm_util_linux.cc b/ui/ozone/common/linux/drm_util_linux.cc index eaa8d58..b9a26887 100644 --- a/ui/ozone/common/linux/drm_util_linux.cc +++ b/ui/ozone/common/linux/drm_util_linux.cc
@@ -74,4 +74,25 @@ } } +bool IsValidBufferFormat(uint32_t current_format) { + switch (GetBufferFormatFromFourCCFormat(current_format)) { + case gfx::BufferFormat::R_8: + case gfx::BufferFormat::RG_88: + case gfx::BufferFormat::RGBA_8888: + case gfx::BufferFormat::RGBX_8888: + case gfx::BufferFormat::BGRA_8888: + case gfx::BufferFormat::BGRX_8888: + case gfx::BufferFormat::BGRX_1010102: + case gfx::BufferFormat::RGBX_1010102: + case gfx::BufferFormat::BGR_565: + case gfx::BufferFormat::UYVY_422: + case gfx::BufferFormat::YUV_420_BIPLANAR: + case gfx::BufferFormat::YVU_420: + return true; + default: + return false; + } + return false; +} + } // namespace ui
diff --git a/ui/ozone/common/linux/drm_util_linux.h b/ui/ozone/common/linux/drm_util_linux.h index f430a39..4e836bc9 100644 --- a/ui/ozone/common/linux/drm_util_linux.h +++ b/ui/ozone/common/linux/drm_util_linux.h
@@ -13,6 +13,9 @@ int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format); +// Returns true if the fourcc format is known. +bool IsValidBufferFormat(uint32_t current_format); + } // namespace ui #endif // UI_OZONE_COMMON_LINUX_DRM_UTIL_LINUX_H__
diff --git a/ui/ozone/platform/drm/host/drm_device_connector.cc b/ui/ozone/platform/drm/host/drm_device_connector.cc index ed0bb34..dfdd37c 100644 --- a/ui/ozone/platform/drm/host/drm_device_connector.cc +++ b/ui/ozone/platform/drm/host/drm_device_connector.cc
@@ -61,7 +61,8 @@ void DrmDeviceConnector::OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> ui_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) { + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) { // We need to preserve |binder| to let us bind interfaces later. binder_callback_ = std::move(binder); if (am_running_in_ws_mode()) {
diff --git a/ui/ozone/platform/drm/host/drm_device_connector.h b/ui/ozone/platform/drm/host/drm_device_connector.h index d77183c..8de058eb 100644 --- a/ui/ozone/platform/drm/host/drm_device_connector.h +++ b/ui/ozone/platform/drm/host/drm_device_connector.h
@@ -39,7 +39,8 @@ void OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> ui_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) override; + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) override; // BindInterface arranges for the drm_device_ptr to be connected. void BindInterfaceDrmDevice(
diff --git a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc index 12332387..5daea0c 100644 --- a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc +++ b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc
@@ -121,7 +121,8 @@ void DrmGpuPlatformSupportHost::OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> ui_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) { + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) { NOTREACHED() << "DrmGpuPlatformSupportHost::OnGpuServiceLaunched shouldn't " "be used with pre-mojo IPC"; }
diff --git a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h index c2d1d65..9c8cf6f 100644 --- a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h +++ b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h
@@ -44,7 +44,8 @@ void OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> ui_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) override; + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) override; void OnMessageReceived(const IPC::Message& message) override;
diff --git a/ui/ozone/platform/scenic/ozone_platform_scenic.cc b/ui/ozone/platform/scenic/ozone_platform_scenic.cc index 5bb85d465..6100a7f 100644 --- a/ui/ozone/platform/scenic/ozone_platform_scenic.cc +++ b/ui/ozone/platform/scenic/ozone_platform_scenic.cc
@@ -29,9 +29,11 @@ namespace { -constexpr OzonePlatform::PlatformProperties kScenicPlatformProperties = { +const OzonePlatform::PlatformProperties kScenicPlatformProperties( /*needs_view_owner_request=*/true, -}; + /*custom_frame_pref_default=*/false, + /*use_system_title_bar=*/false, + std::vector<gfx::BufferFormat>()); class ScenicPlatformEventSource : public ui::PlatformEventSource { public:
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn index 97eae521..7c5d82b1 100644 --- a/ui/ozone/platform/wayland/BUILD.gn +++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -5,6 +5,7 @@ visibility = [ "//ui/ozone/*" ] import("//build/config/linux/pkg_config.gni") +import("//ui/ozone/platform/wayland/wayland.gni") pkg_config("wayland-egl") { packages = [ "wayland-egl" ] @@ -16,10 +17,14 @@ "client_native_pixmap_factory_wayland.h", "gl_surface_wayland.cc", "gl_surface_wayland.h", + "gpu/wayland_connection_proxy.cc", + "gpu/wayland_connection_proxy.h", "ozone_platform_wayland.cc", "ozone_platform_wayland.h", "wayland_connection.cc", "wayland_connection.h", + "wayland_connection_connector.cc", + "wayland_connection_connector.h", "wayland_cursor.cc", "wayland_cursor.h", "wayland_data_device.cc", @@ -70,8 +75,12 @@ deps = [ "//base", + "//mojo/public/cpp/bindings", "//skia", + "//third_party/libdrm", + "//third_party/minigbm", "//third_party/wayland:wayland_client", + "//third_party/wayland-protocols:linux_dmabuf_protocol", "//third_party/wayland-protocols:xdg_shell_protocol", "//ui/base", "//ui/base:ui_features", @@ -79,17 +88,43 @@ "//ui/events", "//ui/events:dom_keycode_converter", "//ui/events/ozone:events_ozone", + "//ui/events/ozone:events_ozone_evdev", "//ui/events/ozone:events_ozone_layout", "//ui/events/platform", "//ui/gfx", + "//ui/gfx:memory_buffer", "//ui/gfx/geometry", "//ui/ozone:ozone_base", "//ui/ozone/common", + "//ui/ozone/common/linux", + "//ui/ozone/public/interfaces/wayland:wayland_interfaces", "//ui/platform_window", ] defines = [ "OZONE_IMPLEMENTATION" ] + import("//ui/ozone/platform/wayland/wayland.gni") + if (use_wayland_gbm) { + defines += [ "WAYLAND_GBM" ] + sources += [ + "gpu/drm_render_node_handle.cc", + "gpu/drm_render_node_handle.h", + "gpu/drm_render_node_path_finder.cc", + "gpu/drm_render_node_path_finder.h", + "gpu/gbm_pixmap_wayland.cc", + "gpu/gbm_pixmap_wayland.h", + "gpu/gbm_surfaceless_wayland.cc", + "gpu/gbm_surfaceless_wayland.h", + ] + + deps += [ + "//third_party/libdrm", + "//third_party/minigbm", + "//ui/gfx:memory_buffer", + "//ui/ozone/common/linux", + ] + } + configs += [ ":wayland-egl", "//third_party/khronos:khronos_headers",
diff --git a/ui/ozone/platform/wayland/DEPS b/ui/ozone/platform/wayland/DEPS index e60ac4f2..fde6dba3 100644 --- a/ui/ozone/platform/wayland/DEPS +++ b/ui/ozone/platform/wayland/DEPS
@@ -1,4 +1,5 @@ include_rules = [ "+ui/base/ui_features.h", # UI features doesn't bring in all of ui/base. + "+mojo/public", ]
diff --git a/ui/ozone/platform/wayland/client_native_pixmap_factory_wayland.cc b/ui/ozone/platform/wayland/client_native_pixmap_factory_wayland.cc index 5670324..0515392 100644 --- a/ui/ozone/platform/wayland/client_native_pixmap_factory_wayland.cc +++ b/ui/ozone/platform/wayland/client_native_pixmap_factory_wayland.cc
@@ -4,12 +4,53 @@ #include "ui/ozone/platform/wayland/client_native_pixmap_factory_wayland.h" -#include "ui/ozone/common/stub_client_native_pixmap_factory.h" +#include "ui/gfx/linux/client_native_pixmap_dmabuf.h" +#include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" +#include "ui/ozone/public/ozone_platform.h" namespace ui { +// Implements ClientNativePixmapFactory to provide a more accurate buffer format +// support when Wayland dmabuf is used. +class ClientNativePixmapFactoryWayland : public gfx::ClientNativePixmapFactory { + public: + ClientNativePixmapFactoryWayland() { + dmabuf_factory_.reset(gfx::CreateClientNativePixmapFactoryDmabuf()); + } + ~ClientNativePixmapFactoryWayland() override {} + + // ClientNativePixmapFactory overrides: + bool IsConfigurationSupported(gfx::BufferFormat format, + gfx::BufferUsage usage) const override { + OzonePlatform::PlatformProperties properties = + OzonePlatform::GetInstance()->GetPlatformProperties(); + if (properties.supported_buffer_formats.empty()) { + // If the compositor did not announce supported buffer formats, do our + // best and assume those are supported. + return dmabuf_factory_->IsConfigurationSupported(format, usage); + } + + for (auto buffer_format : properties.supported_buffer_formats) { + if (buffer_format == format) + return dmabuf_factory_->IsConfigurationSupported(format, usage); + } + return false; + } + + std::unique_ptr<gfx::ClientNativePixmap> ImportFromHandle( + const gfx::NativePixmapHandle& handle, + const gfx::Size& size, + gfx::BufferUsage usage) override { + return dmabuf_factory_->ImportFromHandle(handle, size, usage); + } + + private: + std::unique_ptr<ClientNativePixmapFactory> dmabuf_factory_; + DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryWayland); +}; + gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryWayland() { - return CreateStubClientNativePixmapFactory(); + return new ClientNativePixmapFactoryWayland(); } } // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/drm_render_node_handle.cc b/ui/ozone/platform/wayland/gpu/drm_render_node_handle.cc new file mode 100644 index 0000000..a049ee5 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/drm_render_node_handle.cc
@@ -0,0 +1,35 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/gpu/drm_render_node_handle.h" + +#include <fcntl.h> +#include <xf86drm.h> + +namespace ui { + +DrmRenderNodeHandle::DrmRenderNodeHandle() = default; + +DrmRenderNodeHandle::~DrmRenderNodeHandle() = default; + +bool DrmRenderNodeHandle::Initialize(const base::FilePath& path) { + base::ScopedFD drm_fd(open(path.value().c_str(), O_RDWR)); + if (drm_fd.get() < 0) + return false; + + drmVersionPtr drm_version = drmGetVersion(drm_fd.get()); + if (!drm_version) { + LOG(FATAL) << "Can't get version for device: '" << path << "'"; + return false; + } + + drm_fd_ = std::move(drm_fd); + return true; +} + +base::ScopedFD DrmRenderNodeHandle::PassFD() { + return std::move(drm_fd_); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/drm_render_node_handle.h b/ui/ozone/platform/wayland/gpu/drm_render_node_handle.h new file mode 100644 index 0000000..46632326 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/drm_render_node_handle.h
@@ -0,0 +1,32 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_HANDLE_H_ +#define UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_HANDLE_H_ + +#include "base/files/file_path.h" +#include "base/files/scoped_file.h" +#include "base/macros.h" + +namespace ui { + +// A wrapper around a DRM render node device handle. +class DrmRenderNodeHandle { + public: + DrmRenderNodeHandle(); + ~DrmRenderNodeHandle(); + + bool Initialize(const base::FilePath& path); + + base::ScopedFD PassFD(); + + private: + base::ScopedFD drm_fd_; + + DISALLOW_COPY_AND_ASSIGN(DrmRenderNodeHandle); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_HANDLE_H_
diff --git a/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc new file mode 100644 index 0000000..c3367aee --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc
@@ -0,0 +1,49 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h" + +#include <fcntl.h> + +#include "base/files/scoped_file.h" +#include "base/strings/stringprintf.h" + +namespace ui { + +namespace { + +// Drm render node path template. +constexpr char kDriRenderNodeTemplate[] = "/dev/dri/renderD%u"; + +// Number of files to look for when discovering DRM devices. +constexpr uint32_t kDrmMaxMinor = 15; +constexpr uint32_t kRenderNodeStart = 128; +constexpr uint32_t kRenderNodeEnd = kRenderNodeStart + kDrmMaxMinor + 1; + +} // namespace + +DrmRenderNodePathFinder::DrmRenderNodePathFinder() = default; + +DrmRenderNodePathFinder::~DrmRenderNodePathFinder() = default; + +base::FilePath DrmRenderNodePathFinder::GetDrmRenderNodePath() { + if (drm_render_node_path_.empty()) + FindDrmRenderNodePath(); + + return drm_render_node_path_; +} + +void DrmRenderNodePathFinder::FindDrmRenderNodePath() { + for (uint32_t i = kRenderNodeStart; i < kRenderNodeEnd; i++) { + std::string dri_render_node(base::StringPrintf(kDriRenderNodeTemplate, i)); + base::ScopedFD drm_fd(open(dri_render_node.c_str(), O_RDWR)); + if (drm_fd.get() < 0) + continue; + + drm_render_node_path_ = base::FilePath(dri_render_node); + break; + } +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h new file mode 100644 index 0000000..a6408e7b --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h
@@ -0,0 +1,33 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_PATH_FINDER_H_ +#define UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_PATH_FINDER_H_ + +#include "base/files/file_path.h" +#include "base/macros.h" + +namespace ui { + +// A helper class that finds a DRM render node device and returns a path to it. +class DrmRenderNodePathFinder { + public: + DrmRenderNodePathFinder(); + ~DrmRenderNodePathFinder(); + + // Returns a path to a drm render node device. If it hasn't been found yet, + // triggers FindDrmRenderNodePath and returns the path. + base::FilePath GetDrmRenderNodePath(); + + private: + void FindDrmRenderNodePath(); + + base::FilePath drm_render_node_path_; + + DISALLOW_COPY_AND_ASSIGN(DrmRenderNodePathFinder); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_GPU_DRM_RENDER_NODE_PATH_FINDER_H_
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc new file mode 100644 index 0000000..8c3d01b4 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc
@@ -0,0 +1,192 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h" + +#include <drm_fourcc.h> +#include <gbm.h> +#include <xf86drmMode.h> + +#include "base/files/platform_file.h" +#include "base/logging.h" +#include "base/posix/eintr_wrapper.h" +#include "base/strings/stringprintf.h" +#include "base/trace_event/trace_event.h" +#include "ui/gfx/buffer_format_util.h" +#include "ui/gfx/geometry/size_conversions.h" +#include "ui/gfx/native_pixmap_handle.h" +#include "ui/ozone/common/linux/drm_util_linux.h" +#include "ui/ozone/common/linux/gbm_device.h" +#include "ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h" +#include "ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h" +#include "ui/ozone/platform/wayland/wayland_surface_factory.h" +#include "ui/ozone/public/overlay_plane.h" +#include "ui/ozone/public/ozone_platform.h" + +namespace ui { + +GbmPixmapWayland::GbmPixmapWayland(WaylandSurfaceFactory* surface_manager, + WaylandConnectionProxy* connection) + : surface_manager_(surface_manager), connection_(connection) {} + +GbmPixmapWayland::~GbmPixmapWayland() { + connection_->DestroyZwpLinuxDmabuf(GetUniqueId()); +} + +bool GbmPixmapWayland::InitializeBuffer(gfx::Size size, + gfx::BufferFormat format, + gfx::BufferUsage usage) { + TRACE_EVENT1("Wayland", "GbmPixmapWayland::InitializeBuffer", "size", + size.ToString()); + uint32_t flags = 0; + switch (usage) { + case gfx::BufferUsage::GPU_READ: + flags = GBM_BO_USE_LINEAR; + break; + case gfx::BufferUsage::SCANOUT: + flags = GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT; + break; + case gfx::BufferUsage::SCANOUT_CAMERA_READ_WRITE: + flags = GBM_BO_USE_LINEAR | GBM_BO_USE_WRITE | GBM_BO_USE_SCANOUT; + break; + case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE: + flags = GBM_BO_USE_LINEAR | GBM_BO_USE_SCANOUT; + break; + case gfx::BufferUsage::SCANOUT_VDA_WRITE: + flags = GBM_BO_USE_SCANOUT; + break; + case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: + case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: + // mmap cannot be used with gbm buffers on a different process. That is, + // Linux disallows this and "permission denied" is returned. To overcome + // this and make software rasterization working, buffers must be created + // on the browser process and gbm_bo_map must be used. + // TODO(msisov): add support fir these two buffer usage cases. + // https://crbug.com/864914 + LOG(FATAL) << "This scenario is not supported in Wayland now"; + break; + default: + NOTREACHED() << "Not supported buffer format"; + break; + } + + const uint32_t fourcc_format = GetFourCCFormatFromBufferFormat(format); + gbm_bo_ = connection_->gbm_device()->CreateBuffer(fourcc_format, size, flags); + if (!gbm_bo_) { + LOG(FATAL) << "Cannot create bo"; + return false; + } + + CreateZwpLinuxDmabuf(); + return true; +} + +bool GbmPixmapWayland::AreDmaBufFdsValid() const { + return gbm_bo_->AreFdsValid(); +} + +size_t GbmPixmapWayland::GetDmaBufFdCount() const { + return gbm_bo_->GetFdCount(); +} + +int GbmPixmapWayland::GetDmaBufFd(size_t plane) const { + return gbm_bo_->GetPlaneFd(plane); +} + +int GbmPixmapWayland::GetDmaBufPitch(size_t plane) const { + return gbm_bo_->GetPlaneStride(plane); +} + +int GbmPixmapWayland::GetDmaBufOffset(size_t plane) const { + return gbm_bo_->GetPlaneOffset(plane); +} + +uint64_t GbmPixmapWayland::GetDmaBufModifier(size_t plane) const { + // TODO(msisov): figure out why returning format modifier results in + // EGL_BAD_ALLOC. + // + // return gbm_bo_->get_format_modifier(); + return 0; +} + +gfx::BufferFormat GbmPixmapWayland::GetBufferFormat() const { + return gbm_bo_->GetBufferFormat(); +} + +gfx::Size GbmPixmapWayland::GetBufferSize() const { + return gbm_bo_->GetSize(); +} + +uint32_t GbmPixmapWayland::GetUniqueId() const { + return gbm_bo_->GetHandle(); +} + +bool GbmPixmapWayland::ScheduleOverlayPlane( + gfx::AcceleratedWidget widget, + int plane_z_order, + gfx::OverlayTransform plane_transform, + const gfx::Rect& display_bounds, + const gfx::RectF& crop_rect, + bool enable_blend, + std::unique_ptr<gfx::GpuFence> gpu_fence) { + GbmSurfacelessWayland* surfaceless = surface_manager_->GetSurface(widget); + DCHECK(surfaceless); + surfaceless->QueueOverlayPlane( + OverlayPlane(this, std::move(gpu_fence), plane_z_order, plane_transform, + display_bounds, crop_rect, enable_blend)); + return true; +} + +gfx::NativePixmapHandle GbmPixmapWayland::ExportHandle() { + gfx::NativePixmapHandle handle; + gfx::BufferFormat format = GetBufferFormat(); + + // TODO(dcastagna): Use gbm_bo_get_num_planes once all the formats we use are + // supported by gbm. + for (size_t i = 0; i < gfx::NumberOfPlanesForBufferFormat(format); ++i) { + // Some formats (e.g: YVU_420) might have less than one fd per plane. + if (i < GetDmaBufFdCount()) { + base::ScopedFD scoped_fd(HANDLE_EINTR(dup(GetDmaBufFd(i)))); + if (!scoped_fd.is_valid()) { + PLOG(ERROR) << "dup"; + return gfx::NativePixmapHandle(); + } + handle.fds.emplace_back( + base::FileDescriptor(scoped_fd.release(), true /* auto_close */)); + } + handle.planes.emplace_back(GetDmaBufPitch(i), GetDmaBufOffset(i), + gbm_bo_->GetPlaneSize(i), GetDmaBufModifier(i)); + } + return handle; +} + +void GbmPixmapWayland::CreateZwpLinuxDmabuf() { + uint64_t modifier = gbm_bo_->GetFormatModifier(); + + std::vector<uint32_t> strides; + std::vector<uint32_t> offsets; + std::vector<uint64_t> modifiers; + + size_t plane_count = gbm_bo_->GetNumPlanes(); + for (size_t i = 0; i < plane_count; ++i) { + strides.push_back(GetDmaBufPitch(i)); + offsets.push_back(GetDmaBufOffset(i)); + if (modifier != DRM_FORMAT_MOD_INVALID) + modifiers.push_back(modifier); + } + + base::ScopedFD fd(HANDLE_EINTR(dup(GetDmaBufFd(0)))); + if (!fd.is_valid()) { + PLOG(FATAL) << "dup"; + return; + } + base::File file(fd.release()); + + // Asks Wayland to create a wl_buffer based on the |file| fd. + connection_->CreateZwpLinuxDmabuf(std::move(file), GetBufferSize(), strides, + offsets, modifiers, gbm_bo_->GetFormat(), + plane_count, GetUniqueId()); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h new file mode 100644 index 0000000..6998041 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h
@@ -0,0 +1,70 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_PIXMAP_WAYLAND_H_ +#define UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_PIXMAP_WAYLAND_H_ + +#include <vector> + +#include "base/files/scoped_file.h" +#include "base/macros.h" +#include "ui/gfx/buffer_types.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/native_pixmap.h" +#include "ui/ozone/common/linux/gbm_buffer.h" + +namespace ui { + +class WaylandSurfaceFactory; +class WaylandConnectionProxy; + +class GbmPixmapWayland : public gfx::NativePixmap { + public: + GbmPixmapWayland(WaylandSurfaceFactory* surface_manager, + WaylandConnectionProxy* connection); + + // Creates a buffer object and initializes the pixmap buffer. + bool InitializeBuffer(gfx::Size size, + gfx::BufferFormat format, + gfx::BufferUsage usage); + + // gfx::NativePixmap overrides: + bool AreDmaBufFdsValid() const override; + size_t GetDmaBufFdCount() const override; + int GetDmaBufFd(size_t plane) const override; + int GetDmaBufPitch(size_t plane) const override; + int GetDmaBufOffset(size_t plane) const override; + uint64_t GetDmaBufModifier(size_t plane) const override; + gfx::BufferFormat GetBufferFormat() const override; + gfx::Size GetBufferSize() const override; + uint32_t GetUniqueId() const override; + bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, + int plane_z_order, + gfx::OverlayTransform plane_transform, + const gfx::Rect& display_bounds, + const gfx::RectF& crop_rect, + bool enable_blend, + std::unique_ptr<gfx::GpuFence> gpu_fence) override; + gfx::NativePixmapHandle ExportHandle() override; + + private: + ~GbmPixmapWayland() override; + + // Asks Wayland to create a dmabuf based wl_buffer. + void CreateZwpLinuxDmabuf(); + + // gbm_bo wrapper for struct gbm_bo. + std::unique_ptr<GbmBuffer> gbm_bo_; + + WaylandSurfaceFactory* surface_manager_ = nullptr; + + // Represents a connection to Wayland. + WaylandConnectionProxy* connection_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(GbmPixmapWayland); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_PIXMAP_WAYLAND_H_
diff --git a/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc new file mode 100644 index 0000000..5403739 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc
@@ -0,0 +1,251 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h" + +#include "base/bind.h" +#include "base/task/post_task.h" +#include "base/trace_event/trace_event.h" +#include "ui/gfx/gpu_fence.h" +#include "ui/ozone/common/egl_util.h" +#include "ui/ozone/platform/wayland/wayland_surface_factory.h" + +namespace ui { + +namespace { + +void WaitForFence(EGLDisplay display, EGLSyncKHR fence) { + eglClientWaitSyncKHR(display, fence, EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, + EGL_FOREVER_KHR); + eglDestroySyncKHR(display, fence); +} + +} // namespace + +GbmSurfacelessWayland::GbmSurfacelessWayland( + WaylandSurfaceFactory* surface_factory, + gfx::AcceleratedWidget widget) + : SurfacelessEGL(gfx::Size()), + surface_factory_(surface_factory), + widget_(widget), + has_implicit_external_sync_( + HasEGLExtension("EGL_ARM_implicit_external_sync")), + weak_factory_(this) { + surface_factory_->RegisterSurface(widget_, this); + unsubmitted_frames_.push_back(std::make_unique<PendingFrame>()); +} + +void GbmSurfacelessWayland::QueueOverlayPlane(OverlayPlane plane) { + planes_.push_back(std::move(plane)); +} + +bool GbmSurfacelessWayland::ScheduleOverlayPlane( + int z_order, + gfx::OverlayTransform transform, + gl::GLImage* image, + const gfx::Rect& bounds_rect, + const gfx::RectF& crop_rect, + bool enable_blend, + std::unique_ptr<gfx::GpuFence> gpu_fence) { + unsubmitted_frames_.back()->overlays.push_back( + gl::GLSurfaceOverlay(z_order, transform, image, bounds_rect, crop_rect, + enable_blend, std::move(gpu_fence))); + return true; +} + +bool GbmSurfacelessWayland::IsOffscreen() { + return false; +} + +bool GbmSurfacelessWayland::SupportsPresentationCallback() { + // TODO(msisov): enable a real presentation callback for wayland. For now, we + // just blindly say it was successful. https://crbug.com/859012. + return true; +} + +bool GbmSurfacelessWayland::SupportsAsyncSwap() { + return true; +} + +bool GbmSurfacelessWayland::SupportsPostSubBuffer() { + // TODO(msisov): figure out how to enable subbuffers with wayland/dmabuf. + return false; +} + +gfx::SwapResult GbmSurfacelessWayland::PostSubBuffer( + int x, + int y, + int width, + int height, + const PresentationCallback& callback) { + // The actual sub buffer handling is handled at higher layers. + NOTREACHED(); + return gfx::SwapResult::SWAP_FAILED; +} + +void GbmSurfacelessWayland::SwapBuffersAsync( + const SwapCompletionCallback& completion_callback, + const PresentationCallback& presentation_callback) { + TRACE_EVENT0("wayland", "GbmSurfacelessWayland::SwapBuffersAsync"); + // If last swap failed, don't try to schedule new ones. + if (!last_swap_buffers_result_) { + completion_callback.Run(gfx::SwapResult::SWAP_FAILED, nullptr); + // Notify the caller, the buffer is never presented on a screen. + presentation_callback.Run(gfx::PresentationFeedback::Failure()); + return; + } + + // TODO(dcastagna): remove glFlush since eglImageFlushExternalEXT called on + // the image should be enough (https://crbug.com/720045). + glFlush(); + unsubmitted_frames_.back()->Flush(); + + PendingFrame* frame = unsubmitted_frames_.back().get(); + frame->completion_callback = completion_callback; + frame->presentation_callback = presentation_callback; + unsubmitted_frames_.push_back(std::make_unique<PendingFrame>()); + + // TODO: the following should be replaced by a per surface flush as it gets + // implemented in GL drivers. + EGLSyncKHR fence = InsertFence(has_implicit_external_sync_); + if (!fence) { + completion_callback.Run(gfx::SwapResult::SWAP_FAILED, nullptr); + // Notify the caller, the buffer is never presented on a screen. + presentation_callback.Run(gfx::PresentationFeedback::Failure()); + return; + } + + base::OnceClosure fence_wait_task = + base::BindOnce(&WaitForFence, GetDisplay(), fence); + + base::OnceClosure fence_retired_callback = base::BindOnce( + &GbmSurfacelessWayland::FenceRetired, weak_factory_.GetWeakPtr(), frame); + + base::PostTaskWithTraitsAndReply( + FROM_HERE, + {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + std::move(fence_wait_task), std::move(fence_retired_callback)); +} + +void GbmSurfacelessWayland::PostSubBufferAsync( + int x, + int y, + int width, + int height, + const SwapCompletionCallback& completion_callback, + const PresentationCallback& presentation_callback) { + // See the comment in SupportsPostSubBuffer. + NOTREACHED(); +} + +EGLConfig GbmSurfacelessWayland::GetConfig() { + if (!config_) { + EGLint config_attribs[] = {EGL_BUFFER_SIZE, + 32, + EGL_ALPHA_SIZE, + 8, + EGL_BLUE_SIZE, + 8, + EGL_GREEN_SIZE, + 8, + EGL_RED_SIZE, + 8, + EGL_RENDERABLE_TYPE, + EGL_OPENGL_ES2_BIT, + EGL_SURFACE_TYPE, + EGL_DONT_CARE, + EGL_NONE}; + config_ = ChooseEGLConfig(GetDisplay(), config_attribs); + } + return config_; +} + +GbmSurfacelessWayland::~GbmSurfacelessWayland() { + surface_factory_->UnregisterSurface(widget_); +} + +GbmSurfacelessWayland::PendingFrame::PendingFrame() {} + +GbmSurfacelessWayland::PendingFrame::~PendingFrame() {} + +bool GbmSurfacelessWayland::PendingFrame::ScheduleOverlayPlanes( + gfx::AcceleratedWidget widget) { + for (auto& overlay : overlays) + if (!overlay.ScheduleOverlayPlane(widget)) + return false; + return true; +} + +void GbmSurfacelessWayland::PendingFrame::Flush() { + for (const auto& overlay : overlays) + overlay.Flush(); +} + +void GbmSurfacelessWayland::SubmitFrame() { + DCHECK(!unsubmitted_frames_.empty()); + + if (unsubmitted_frames_.front()->ready && !submitted_frame_) { + submitted_frame_ = std::move(unsubmitted_frames_.front()); + unsubmitted_frames_.erase(unsubmitted_frames_.begin()); + + bool schedule_planes_succeeded = + submitted_frame_->ScheduleOverlayPlanes(widget_); + + if (!schedule_planes_succeeded) { + OnSubmission(gfx::SwapResult::SWAP_FAILED, nullptr); + OnPresentation(gfx::PresentationFeedback::Failure()); + return; + } + + uint32_t buffer_id = planes_.back().pixmap->GetUniqueId(); + surface_factory_->ScheduleBufferSwap(widget_, buffer_id); + + // Check comment in ::SupportsPresentationCallback. + OnSubmission(gfx::SwapResult::SWAP_ACK, nullptr); + OnPresentation( + gfx::PresentationFeedback(base::TimeTicks::Now(), base::TimeDelta(), + gfx::PresentationFeedback::kZeroCopy)); + + planes_.clear(); + } +} + +EGLSyncKHR GbmSurfacelessWayland::InsertFence(bool implicit) { + const EGLint attrib_list[] = {EGL_SYNC_CONDITION_KHR, + EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM, + EGL_NONE}; + return eglCreateSyncKHR(GetDisplay(), EGL_SYNC_FENCE_KHR, + implicit ? attrib_list : NULL); +} + +void GbmSurfacelessWayland::FenceRetired(PendingFrame* frame) { + frame->ready = true; + SubmitFrame(); +} + +void GbmSurfacelessWayland::OnSubmission( + gfx::SwapResult result, + std::unique_ptr<gfx::GpuFence> out_fence) { + submitted_frame_->swap_result = result; +} + +void GbmSurfacelessWayland::OnPresentation( + const gfx::PresentationFeedback& feedback) { + // Explicitly destroy overlays to free resources (e.g., fences) early. + submitted_frame_->overlays.clear(); + + gfx::SwapResult result = submitted_frame_->swap_result; + std::move(submitted_frame_->completion_callback).Run(result, nullptr); + std::move(submitted_frame_->presentation_callback).Run(feedback); + submitted_frame_.reset(); + + if (result == gfx::SwapResult::SWAP_FAILED) { + last_swap_buffers_result_ = false; + return; + } + + SubmitFrame(); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h new file mode 100644 index 0000000..cc660f3 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h
@@ -0,0 +1,102 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_SURFACELESS_WAYLAND_H_ +#define UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_SURFACELESS_WAYLAND_H_ + +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/gl/gl_surface_egl.h" +#include "ui/ozone/public/overlay_plane.h" +#include "ui/ozone/public/swap_completion_callback.h" + +namespace ui { + +class WaylandSurfaceFactory; + +// A GLSurface for Wayland Ozone platform that uses surfaceless drawing. Drawing +// and displaying happens directly through NativePixmap buffers. CC would call +// into SurfaceFactoryOzone to allocate the buffers and then call +// ScheduleOverlayPlane(..) to schedule the buffer for presentation. +class GbmSurfacelessWayland : public gl::SurfacelessEGL { + public: + GbmSurfacelessWayland(WaylandSurfaceFactory* surface_factory, + gfx::AcceleratedWidget widget); + + void QueueOverlayPlane(OverlayPlane plane); + + // gl::GLSurface: + bool ScheduleOverlayPlane(int z_order, + gfx::OverlayTransform transform, + gl::GLImage* image, + const gfx::Rect& bounds_rect, + const gfx::RectF& crop_rect, + bool enable_blend, + std::unique_ptr<gfx::GpuFence> gpu_fence) override; + bool IsOffscreen() override; + bool SupportsPresentationCallback() override; + bool SupportsAsyncSwap() override; + bool SupportsPostSubBuffer() override; + gfx::SwapResult PostSubBuffer(int x, + int y, + int width, + int height, + const PresentationCallback& callback) override; + void SwapBuffersAsync( + const SwapCompletionCallback& completion_callback, + const PresentationCallback& presentation_callback) override; + void PostSubBufferAsync( + int x, + int y, + int width, + int height, + const SwapCompletionCallback& completion_callback, + const PresentationCallback& presentation_callback) override; + EGLConfig GetConfig() override; + + private: + ~GbmSurfacelessWayland() override; + + struct PendingFrame { + PendingFrame(); + ~PendingFrame(); + + bool ScheduleOverlayPlanes(gfx::AcceleratedWidget widget); + void Flush(); + + bool ready = false; + gfx::SwapResult swap_result = gfx::SwapResult::SWAP_FAILED; + std::vector<gl::GLSurfaceOverlay> overlays; + SwapCompletionCallback completion_callback; + PresentationCallback presentation_callback; + }; + + void SubmitFrame(); + + EGLSyncKHR InsertFence(bool implicit); + void FenceRetired(PendingFrame* frame); + + void OnSubmission(gfx::SwapResult result, + std::unique_ptr<gfx::GpuFence> out_fence); + void OnPresentation(const gfx::PresentationFeedback& feedback); + + WaylandSurfaceFactory* surface_factory_; + std::vector<OverlayPlane> planes_; + + // The native surface. Deleting this is allowed to free the EGLNativeWindow. + gfx::AcceleratedWidget widget_; + std::vector<std::unique_ptr<PendingFrame>> unsubmitted_frames_; + std::unique_ptr<PendingFrame> submitted_frame_; + bool has_implicit_external_sync_; + bool last_swap_buffers_result_ = true; + + base::WeakPtrFactory<GbmSurfacelessWayland> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(GbmSurfacelessWayland); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_GPU_GBM_SURFACELESS_WAYLAND_H_
diff --git a/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.cc b/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.cc new file mode 100644 index 0000000..149f336 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.cc
@@ -0,0 +1,118 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h" + +#include "base/process/process.h" +#include "third_party/khronos/EGL/egl.h" +#include "ui/ozone/common/linux/drm_util_linux.h" +#include "ui/ozone/platform/wayland/wayland_connection.h" + +namespace ui { + +WaylandConnectionProxy::WaylandConnectionProxy(WaylandConnection* connection) + : connection_(connection), + ui_runner_(base::ThreadTaskRunnerHandle::Get()) {} + +WaylandConnectionProxy::~WaylandConnectionProxy() = default; + +void WaylandConnectionProxy::SetWaylandConnection( + ozone::mojom::WaylandConnectionPtr wc_ptr) { + // Store current thread's task runner to be able to make mojo calls on the + // right sequence. + ui_runner_ = base::ThreadTaskRunnerHandle::Get(); + wc_ptr.Bind(wc_ptr.PassInterface()); + wc_ptr_ = std::move(wc_ptr); +} + +void WaylandConnectionProxy::CreateZwpLinuxDmabuf( + base::File file, + gfx::Size size, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + const std::vector<uint64_t>& modifiers, + uint32_t current_format, + uint32_t planes_count, + uint32_t buffer_id) { + DCHECK(ui_runner_->BelongsToCurrentThread()); + DCHECK(wc_ptr_); + wc_ptr_->CreateZwpLinuxDmabuf(std::move(file), size.width(), size.height(), + strides, offsets, current_format, modifiers, + planes_count, buffer_id); +} + +void WaylandConnectionProxy::DestroyZwpLinuxDmabuf(uint32_t buffer_id) { + // Mojo calls must be done on the right sequence. + DCHECK(ui_runner_); + ui_runner_->PostTask( + FROM_HERE, + base::BindOnce(&WaylandConnectionProxy::DestroyZwpLinuxDmabufInternal, + base::Unretained(this), buffer_id)); +} + +void WaylandConnectionProxy::DestroyZwpLinuxDmabufInternal(uint32_t buffer_id) { + DCHECK(ui_runner_->BelongsToCurrentThread()); + DCHECK(wc_ptr_); + wc_ptr_->DestroyZwpLinuxDmabuf(buffer_id); +} + +void WaylandConnectionProxy::ScheduleBufferSwap(gfx::AcceleratedWidget widget, + uint32_t buffer_id) { + // Mojo calls must be done on the right sequence. + DCHECK(ui_runner_); + ui_runner_->PostTask( + FROM_HERE, + base::BindOnce(&WaylandConnectionProxy::ScheduleBufferSwapInternal, + base::Unretained(this), widget, buffer_id)); +} + +void WaylandConnectionProxy::ScheduleBufferSwapInternal( + gfx::AcceleratedWidget widget, + uint32_t buffer_id) { + DCHECK(ui_runner_->BelongsToCurrentThread()); + DCHECK(wc_ptr_); + wc_ptr_->ScheduleBufferSwap(widget, buffer_id); +} + +WaylandWindow* WaylandConnectionProxy::GetWindow( + gfx::AcceleratedWidget widget) { + if (connection_) + return connection_->GetWindow(widget); + return nullptr; +} + +void WaylandConnectionProxy::ScheduleFlush() { + if (connection_) + return connection_->ScheduleFlush(); + + LOG(FATAL) << "Flush mustn't be called directly on the WaylandConnection, " + "when multi-process moe is used"; +} + +wl_shm* WaylandConnectionProxy::shm() { + wl_shm* shm = nullptr; + if (connection_) + shm = connection_->shm(); + return shm; +} + +intptr_t WaylandConnectionProxy::Display() { + if (connection_) + return reinterpret_cast<intptr_t>(connection_->display()); + +#if defined(WAYLAND_GBM) + // It must not be a single process mode. Thus, shared dmabuf approach is used, + // which requires |gbm_device_|. + DCHECK(gbm_device_); + return EGL_DEFAULT_DISPLAY; +#endif + return 0; +} + +void WaylandConnectionProxy::AddBindingWaylandConnectionClient( + ozone::mojom::WaylandConnectionClientRequest request) { + bindings_.AddBinding(this, std::move(request)); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h b/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h new file mode 100644 index 0000000..dcd8eaf8 --- /dev/null +++ b/ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h
@@ -0,0 +1,123 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_GPU_WAYLAND_CONNECTION_PROXY_H_ +#define UI_OZONE_PLATFORM_WAYLAND_GPU_WAYLAND_CONNECTION_PROXY_H_ + +#include "base/macros.h" +#include "base/threading/sequenced_task_runner_handle.h" +#include "base/threading/thread_checker.h" +#include "mojo/public/cpp/bindings/binding_set.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/ozone/platform/wayland/wayland_connection.h" +#include "ui/ozone/public/interfaces/wayland/wayland_connection.mojom.h" + +#if defined(WAYLAND_GBM) +#include "ui/ozone/common/linux/gbm_device.h" +#endif + +struct wl_shm; + +namespace ui { + +class WaylandConnection; +class WaylandWindow; + +// Provides a proxy connection to a WaylandConnection object on +// browser process side. When in multi-process mode, this is used to create +// Wayland dmabufs and ask it to do commits. When in single process mode, +// this class just forwards calls directly to WaylandConnection. +// +// It's guaranteed that WaylandConnectionProxy makes mojo calls on the right +// sequence. +class WaylandConnectionProxy : public ozone::mojom::WaylandConnectionClient { + public: + explicit WaylandConnectionProxy(WaylandConnection* connection); + ~WaylandConnectionProxy() override; + + // WaylandConnectionProxy overrides: + void SetWaylandConnection(ozone::mojom::WaylandConnectionPtr wc_ptr) override; + + // Methods, which must be used when GPU is hosted on a different process + // aka gpu process. + // + // Asks Wayland to create a wl_buffer based on a shared buffer file + // descriptor backed (gbm_bo). + void CreateZwpLinuxDmabuf(base::File file, + gfx::Size size, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + const std::vector<uint64_t>& modifiers, + uint32_t current_format, + uint32_t planes_count, + uint32_t buffer_id); + + // Asks Wayland to destroy a wl_buffer. + void DestroyZwpLinuxDmabuf(uint32_t buffer_id); + + // Asks Wayland to find a wl_buffer with the |buffer_id| and schedule a + // buffer swap for a WaylandWindow, which backs the following |widget|. + void ScheduleBufferSwap(gfx::AcceleratedWidget widget, uint32_t buffer_id); + +#if defined(WAYLAND_GBM) + // Returns a gbm_device based on a DRM render node. + GbmDevice* gbm_device() const { return gbm_device_.get(); } + void set_gbm_device(std::unique_ptr<GbmDevice> gbm_device) { + gbm_device_ = std::move(gbm_device); + } +#endif + + // Methods, which must be used when a single process mode is used (GPU is + // hosted in the browser process). + // + // Return a WaylandWindow based on the |widget|. + WaylandWindow* GetWindow(gfx::AcceleratedWidget widget); + // Schedule flush in the Wayland message loop. + void ScheduleFlush(); + // Returns an object for a shared memory support. Used for software fallback. + wl_shm* shm(); + + // Methods, which can be used with both single- and multi-process modes. + // + // Returns a pointer to native display. When used in single process mode, + // a wl_display pointer is returned. For the the mode, when there are GPU + // and browser processes, EGL_DEFAULT_DISPLAY is returned. + intptr_t Display(); + + // Adds a WaylandConnectionClient binding. + void AddBindingWaylandConnectionClient( + ozone::mojom::WaylandConnectionClientRequest request); + + WaylandConnection* connection() { return connection_; } + + private: + void DestroyZwpLinuxDmabufInternal(uint32_t buffer_id); + void ScheduleBufferSwapInternal(gfx::AcceleratedWidget widget, + uint32_t buffer_id); + + // Non-owned pointer to a WaylandConnection. It is only used in a single + // process mode, when a shared dmabuf approach is not used. + WaylandConnection* connection_ = nullptr; + +#if defined(WAYLAND_GBM) + // A DRM render node based gbm device. + std::unique_ptr<GbmDevice> gbm_device_; +#endif + + mojo::BindingSet<ozone::mojom::WaylandConnectionClient> bindings_; + + // A pointer to a WaylandConnection object, which always lives on a browser + // process side. It's used for a multi-process mode. + ozone::mojom::WaylandConnectionPtr wc_ptr_; + + // A task runner, which is initialized when a WaylandConnectionPtr is set. + // It is used to make sure mojo calls are done on a right sequence. + scoped_refptr<base::SingleThreadTaskRunner> ui_runner_; + + DISALLOW_COPY_AND_ASSIGN(WaylandConnectionProxy); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_GPU_WAYLAND_CONNECTION_PROXY_H_
diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc index 1aa07027..4476357 100644 --- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc +++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
@@ -4,13 +4,16 @@ #include "ui/ozone/platform/wayland/ozone_platform_wayland.h" +#include "base/memory/ptr_util.h" #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" #include "ui/base/ui_features.h" #include "ui/display/manager/fake_display_delegate.h" #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" #include "ui/events/system_input_injector.h" #include "ui/ozone/common/stub_overlay_manager.h" +#include "ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h" #include "ui/ozone/platform/wayland/wayland_connection.h" +#include "ui/ozone/platform/wayland/wayland_connection_connector.h" #include "ui/ozone/platform/wayland/wayland_native_display_delegate.h" #include "ui/ozone/platform/wayland/wayland_surface_factory.h" #include "ui/ozone/platform/wayland/wayland_window.h" @@ -26,6 +29,12 @@ #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" #endif +#if defined(WAYLAND_GBM) +#include "ui/ozone/common/linux/gbm_wrapper.h" +#include "ui/ozone/platform/wayland/gpu/drm_render_node_handle.h" +#include "ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h" +#endif + namespace ui { namespace { @@ -61,7 +70,7 @@ } GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { - return gpu_platform_support_host_.get(); + return connector_ ? connector_.get() : gpu_platform_support_host_.get(); } std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override { @@ -95,33 +104,63 @@ if (!connection_->Initialize()) LOG(FATAL) << "Failed to initialize Wayland platform"; +#if defined(WAYLAND_GBM) + if (!args.single_process) + connector_.reset(new WaylandConnectionConnector(connection_.get())); +#endif + cursor_factory_.reset(new BitmapCursorFactoryOzone); overlay_manager_.reset(new StubOverlayManager); input_controller_ = CreateStubInputController(); - surface_factory_.reset(new WaylandSurfaceFactory(connection_.get())); gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); } void InitializeGPU(const InitParams& args) override { - // TODO(fwang): args.single_process parameter should be checked here; make - // sure callers pass in the proper value. Once it happens, the check whether - // surface factory was set in the same process by a previous InitializeUI - // call becomes unneeded. - if (!surface_factory_) { - // TODO(fwang): Separate processes can not share a Wayland connection - // and so the current implementations of GLOzoneEGLWayland and - // WaylandCanvasSurface may only work when UI and GPU live in the same - // process. GetSurfaceFactoryOzone() must be non-null so a dummy instance - // of WaylandSurfaceFactory is needed to make the GPU initialization - // gracefully fail. - surface_factory_.reset(new WaylandSurfaceFactory(nullptr)); + if (!args.single_process) { + proxy_.reset(new WaylandConnectionProxy(nullptr)); +#if defined(WAYLAND_GBM) + DrmRenderNodePathFinder path_finder; + const base::FilePath drm_node_path = path_finder.GetDrmRenderNodePath(); + if (drm_node_path.empty()) + LOG(FATAL) << "Failed to find drm render node path."; + + DrmRenderNodeHandle handle; + if (!handle.Initialize(drm_node_path)) + LOG(FATAL) << "Failed to initialize drm render node handle."; + + auto gbm = CreateGbmDevice(handle.PassFD().release()); + if (!gbm) + LOG(FATAL) << "Failed to initialize gbm device."; + + proxy_->set_gbm_device(std::move(gbm)); +#endif + } else { + proxy_.reset(new WaylandConnectionProxy(connection_.get())); } + surface_factory_.reset(new WaylandSurfaceFactory(proxy_.get())); } const PlatformProperties& GetPlatformProperties() override { + DCHECK(connection_.get()); + if (properties_.supported_buffer_formats.empty()) { + properties_.supported_buffer_formats = + connection_->GetSupportedBufferFormats(); + } return properties_; } + void AddInterfaces(service_manager::BinderRegistry* registry) override { + registry->AddInterface<ozone::mojom::WaylandConnectionClient>( + base::BindRepeating( + &OzonePlatformWayland::CreateWaylandConnectionClientBinding, + base::Unretained(this))); + } + + void CreateWaylandConnectionClientBinding( + ozone::mojom::WaylandConnectionClientRequest request) { + proxy_->AddBindingWaylandConnectionClient(std::move(request)); + } + private: std::unique_ptr<WaylandConnection> connection_; std::unique_ptr<WaylandSurfaceFactory> surface_factory_; @@ -134,6 +173,9 @@ XkbEvdevCodes xkb_evdev_code_converter_; #endif + std::unique_ptr<WaylandConnectionProxy> proxy_; + std::unique_ptr<WaylandConnectionConnector> connector_; + PlatformProperties properties_; DISALLOW_COPY_AND_ASSIGN(OzonePlatformWayland);
diff --git a/ui/ozone/platform/wayland/wayland.gni b/ui/ozone/platform/wayland/wayland.gni new file mode 100644 index 0000000..8cfdc4c --- /dev/null +++ b/ui/ozone/platform/wayland/wayland.gni
@@ -0,0 +1,12 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//ui/ozone/ozone.gni") + +declare_args() { + # Checks if Wayland must be compiled with dmabuf/gbm feature, which allows a + # multi-process hardware accelerated mode. + use_wayland_gbm = true +}
diff --git a/ui/ozone/platform/wayland/wayland_connection.cc b/ui/ozone/platform/wayland/wayland_connection.cc index b31e91e..4718cf2 100644 --- a/ui/ozone/platform/wayland/wayland_connection.cc +++ b/ui/ozone/platform/wayland/wayland_connection.cc
@@ -4,6 +4,9 @@ #include "ui/ozone/platform/wayland/wayland_connection.h" +#include <drm_fourcc.h> + +#include <linux-dmabuf-unstable-v1-client-protocol.h> #include <xdg-shell-unstable-v5-client-protocol.h> #include <xdg-shell-unstable-v6-client-protocol.h> @@ -14,6 +17,8 @@ #include "base/message_loop/message_loop_current.h" #include "base/strings/string_util.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/trace_event/trace_event.h" +#include "ui/ozone/common/linux/drm_util_linux.h" #include "ui/ozone/platform/wayland/wayland_object.h" #include "ui/ozone/platform/wayland/wayland_window.h" @@ -22,15 +27,18 @@ namespace ui { namespace { const uint32_t kMaxCompositorVersion = 4; +const uint32_t kMaxLinuxDmabufVersion = 1; const uint32_t kMaxSeatVersion = 4; const uint32_t kMaxShmVersion = 1; const uint32_t kMaxXdgShellVersion = 1; } // namespace -WaylandConnection::WaylandConnection() : controller_(FROM_HERE) {} +WaylandConnection::WaylandConnection() + : controller_(FROM_HERE), binding_(this) {} WaylandConnection::~WaylandConnection() { - DCHECK(window_map_.empty()); + DCHECK(pending_buffer_map_.empty() && params_to_id_map_.empty() && + buffers_.empty()); } bool WaylandConnection::Initialize() { @@ -147,10 +155,154 @@ return modifiers; } +// TODO(msisov): handle buffer swap failure or success. +void WaylandConnection::ScheduleBufferSwap(gfx::AcceleratedWidget widget, + uint32_t buffer_id) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + if (!ValidateDataFromGpu(widget, buffer_id)) + return; + + auto it = buffers_.find(buffer_id); + // A buffer might not exist by this time. So, store the request and process + // it once it is created. + if (it == buffers_.end()) { + auto pending_buffers_it = pending_buffer_map_.find(buffer_id); + if (pending_buffers_it != pending_buffer_map_.end()) { + // If a buffer didn't exist and second call for a swap comes, buffer must + // be associated with the same widget. + DCHECK_EQ(pending_buffers_it->second, widget); + } else { + pending_buffer_map_.insert( + std::pair<uint32_t, gfx::AcceleratedWidget>(buffer_id, widget)); + } + return; + } + struct wl_buffer* buffer = it->second.get(); + + WaylandWindow* window = GetWindow(widget); + if (!window) + return; + + // TODO(msisov): it would be beneficial to use real damage regions to improve + // performance. + // + // TODO(msisov): also start using wl_surface_frame callbacks for better + // performance. + wl_surface_damage(window->surface(), 0, 0, window->GetBounds().width(), + window->GetBounds().height()); + wl_surface_attach(window->surface(), buffer, 0, 0); + wl_surface_commit(window->surface()); + + ScheduleFlush(); +} + +void WaylandConnection::CreateZwpLinuxDmabuf( + base::File file, + uint32_t width, + uint32_t height, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + uint32_t format, + const std::vector<uint64_t>& modifiers, + uint32_t planes_count, + uint32_t buffer_id) { + TRACE_EVENT2("Wayland", "WaylandConnection::CreateZwpLinuxDmabuf", "Format", + format, "Buffer id", buffer_id); + + static const struct zwp_linux_buffer_params_v1_listener params_listener = { + WaylandConnection::CreateSucceeded, WaylandConnection::CreateFailed}; + + DCHECK(base::MessageLoopForUI::IsCurrent()); + if (!ValidateDataFromGpu(file, width, height, strides, offsets, format, + modifiers, planes_count, buffer_id)) { + // base::File::Close() has an assertion that checks if blocking operations + // are allowed. Thus, manually close the fd here. + base::ScopedFD fd(file.TakePlatformFile()); + fd.reset(); + return; + } + + // Store |params| connected to |buffer_id| to track buffer creation and + // identify, which buffer a client wants to use. + struct zwp_linux_buffer_params_v1* params = + zwp_linux_dmabuf_v1_create_params(zwp_linux_dmabuf()); + params_to_id_map_.insert( + std::pair<struct zwp_linux_buffer_params_v1*, uint32_t>(params, + buffer_id)); + uint32_t fd = file.TakePlatformFile(); + for (size_t i = 0; i < planes_count; i++) { + zwp_linux_buffer_params_v1_add(params, fd, i /* plane id */, offsets[i], + strides[i], 0 /* modifier hi */, + 0 /* modifier lo */); + } + zwp_linux_buffer_params_v1_add_listener(params, ¶ms_listener, this); + zwp_linux_buffer_params_v1_create(params, width, height, format, 0); + + ScheduleFlush(); +} + +void WaylandConnection::DestroyZwpLinuxDmabuf(uint32_t buffer_id) { + TRACE_EVENT1("Wayland", "WaylandConnection::DestroyZwpLinuxDmabuf", + "Buffer id", buffer_id); + + DCHECK(base::MessageLoopForUI::IsCurrent()); + + auto it = buffers_.find(buffer_id); + if (it == buffers_.end()) { + TerminateGpuProcess("Trying to destroy non-existing buffer"); + return; + } + buffers_.erase(it); + + ScheduleFlush(); +} + ClipboardDelegate* WaylandConnection::GetClipboardDelegate() { return this; } +// static +void WaylandConnection::CreateSucceeded( + void* data, + struct zwp_linux_buffer_params_v1* params, + struct wl_buffer* new_buffer) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + + WaylandConnection* connection = static_cast<WaylandConnection*>(data); + DCHECK(connection); + + // Find which buffer id |params| belong to and store wl_buffer + // with that id. + auto it = connection->params_to_id_map_.find(params); + CHECK(it != connection->params_to_id_map_.end()); + uint32_t buffer_id = it->second; + connection->params_to_id_map_.erase(params); + zwp_linux_buffer_params_v1_destroy(params); + + connection->buffers_.insert(std::pair<uint32_t, wl::Object<wl_buffer>>( + buffer_id, wl::Object<wl_buffer>(new_buffer))); + + TRACE_EVENT1("Wayland", "WaylandConnection::CreateSucceeded", "Buffer id", + buffer_id); + + auto pending_buffers_it = connection->pending_buffer_map_.find(buffer_id); + if (pending_buffers_it != connection->pending_buffer_map_.end()) { + gfx::AcceleratedWidget widget = pending_buffers_it->second; + connection->pending_buffer_map_.erase(pending_buffers_it); + connection->ScheduleBufferSwap(widget, buffer_id); + } +} + +// static +void WaylandConnection::CreateFailed( + void* data, + struct zwp_linux_buffer_params_v1* params) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + + zwp_linux_buffer_params_v1_destroy(params); + LOG(FATAL) << "zwp_linux_buffer_params.create failed"; +} + void WaylandConnection::OfferClipboardData( const ClipboardDelegate::DataMap& data_map, ClipboardDelegate::OfferDataClosure callback) { @@ -179,6 +331,24 @@ return !!data_source_; } +ozone::mojom::WaylandConnectionPtr WaylandConnection::BindInterface() { + // This mustn't be called twice or when the zwp_linux_dmabuf interface is not + // available. + DCHECK(!binding_.is_bound() || zwp_linux_dmabuf_); + ozone::mojom::WaylandConnectionPtr ptr; + binding_.Bind(MakeRequest(&ptr)); + return ptr; +} + +std::vector<gfx::BufferFormat> WaylandConnection::GetSupportedBufferFormats() { + return buffer_formats_; +} + +void WaylandConnection::SetTerminateGpuCallback( + base::OnceCallback<void(std::string)> terminate_callback) { + terminate_gpu_cb_ = std::move(terminate_callback); +} + void WaylandConnection::GetAvailableMimeTypes( ClipboardDelegate::GetMimeTypesClosure callback) { std::move(callback).Run(data_device_->GetAvailableMimeTypes()); @@ -226,6 +396,81 @@ void WaylandConnection::OnFileCanWriteWithoutBlocking(int fd) {} +bool WaylandConnection::ValidateDataFromGpu( + const base::File& file, + uint32_t width, + uint32_t height, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + uint32_t format, + const std::vector<uint64_t>& modifiers, + uint32_t planes_count, + uint32_t buffer_id) { + std::string reason; + if (!file.IsValid()) + reason = "Buffer fd is invalid"; + + if (width == 0 || height == 0) + reason = "Buffer size is invalid"; + + if (planes_count < 1) + reason = "Planes count cannot be less than 1"; + + if (planes_count != strides.size() || planes_count != offsets.size() || + planes_count != modifiers.size()) { + reason = "Number of strides(" + std::to_string(strides.size()) + + ")/offsets(" + std::to_string(offsets.size()) + ")/modifiers(" + + std::to_string(modifiers.size()) + + ") does not correspond to the number of planes(" + + std::to_string(planes_count) + ")"; + } + + for (auto stride : strides) { + if (stride == 0) + reason = "Strides are invalid"; + } + + if (!IsValidBufferFormat(format)) + reason = "Buffer format is invalid"; + + if (buffer_id < 1) + reason = "Invalid buffer id: " + std::to_string(buffer_id); + + if (!reason.empty()) { + TerminateGpuProcess(reason); + return false; + } + return true; +} + +bool WaylandConnection::ValidateDataFromGpu( + const gfx::AcceleratedWidget& widget, + uint32_t buffer_id) { + std::string reason; + + if (widget == gfx::kNullAcceleratedWidget) + reason = "Invalid accelerated widget"; + + if (buffer_id < 1) + reason = "Invalid buffer id: " + std::to_string(buffer_id); + + if (!reason.empty()) { + TerminateGpuProcess(reason); + return false; + } + + return true; +} + +void WaylandConnection::TerminateGpuProcess(std::string reason) { + std::move(terminate_gpu_cb_).Run(std::move(reason)); + binding_.Unbind(); + + buffers_.clear(); + params_to_id_map_.clear(); + pending_buffer_map_.clear(); +} + const std::vector<std::unique_ptr<WaylandOutput>>& WaylandConnection::GetOutputList() const { return output_list_; @@ -246,6 +491,9 @@ static const zxdg_shell_v6_listener shell_v6_listener = { &WaylandConnection::PingV6, }; + static const zwp_linux_dmabuf_v1_listener dmabuf_listener = { + &WaylandConnection::Format, &WaylandConnection::Modifiers, + }; WaylandConnection* connection = static_cast<WaylandConnection*>(data); if (!connection->compositor_ && strcmp(interface, "wl_compositor") == 0) { @@ -330,6 +578,15 @@ connection->data_device_manager_.reset( new WaylandDataDeviceManager(data_device_manager.release())); connection->data_device_manager_->set_connection(connection); + } else if (!connection->zwp_linux_dmabuf_ && + (strcmp(interface, "zwp_linux_dmabuf_v1") == 0)) { + connection->zwp_linux_dmabuf_ = wl::Bind<zwp_linux_dmabuf_v1>( + registry, name, std::min(version, kMaxLinuxDmabufVersion)); + zwp_linux_dmabuf_v1_add_listener(connection->zwp_linux_dmabuf(), + &dmabuf_listener, connection); + // A roundtrip after binding guarantees that the client has received all + // supported formats. + wl_display_roundtrip(connection->display_.get()); } connection->ScheduleFlush(); @@ -414,4 +671,25 @@ connection->ScheduleFlush(); } +// static +void WaylandConnection::Modifiers(void* data, + struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, + uint32_t format, + uint32_t modifier_hi, + uint32_t modifier_lo) { + NOTIMPLEMENTED(); +} + +// static +void WaylandConnection::Format(void* data, + struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, + uint32_t format) { + WaylandConnection* connection = static_cast<WaylandConnection*>(data); + // Return on not the supported ARGB format. + if (format == DRM_FORMAT_ARGB2101010) + return; + connection->buffer_formats_.push_back( + GetBufferFormatFromFourCCFormat(format)); +} + } // namespace ui
diff --git a/ui/ozone/platform/wayland/wayland_connection.h b/ui/ozone/platform/wayland/wayland_connection.h index e617c86d..ad3543d 100644 --- a/ui/ozone/platform/wayland/wayland_connection.h +++ b/ui/ozone/platform/wayland/wayland_connection.h
@@ -7,7 +7,11 @@ #include <map> +#include "ui/gfx/buffer_types.h" + +#include "base/files/file.h" #include "base/message_loop/message_pump_libevent.h" +#include "mojo/public/cpp/bindings/binding.h" #include "ui/events/platform/platform_event_source.h" #include "ui/gfx/native_widget_types.h" #include "ui/ozone/platform/wayland/wayland_data_device.h" @@ -19,6 +23,11 @@ #include "ui/ozone/platform/wayland/wayland_pointer.h" #include "ui/ozone/platform/wayland/wayland_touch.h" #include "ui/ozone/public/clipboard_delegate.h" +#include "ui/ozone/public/gpu_platform_support_host.h" +#include "ui/ozone/public/interfaces/wayland/wayland_connection.mojom.h" + +struct zwp_linux_dmabuf_v1; +struct zwp_linux_buffer_params_v1; namespace ui { @@ -26,6 +35,7 @@ class WaylandConnection : public PlatformEventSource, public ClipboardDelegate, + public ozone::mojom::WaylandConnection, public base::MessagePumpLibevent::FdWatcher { public: WaylandConnection(); @@ -34,6 +44,28 @@ bool Initialize(); bool StartProcessingEvents(); + // ozone::mojom::WaylandConnection overrides: + // + // The overridden methods below are invoked by GPU. + // + // Called by the GPU and asks to import a wl_buffer based on a gbm file + // descriptor. + void CreateZwpLinuxDmabuf(base::File file, + uint32_t width, + uint32_t height, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + uint32_t format, + const std::vector<uint64_t>& modifiers, + uint32_t planes_count, + uint32_t buffer_id) override; + // Called by the GPU to destroy the imported wl_buffer with a |buffer_id|. + void DestroyZwpLinuxDmabuf(uint32_t buffer_id) override; + // Called by the GPU and asks to attach a wl_buffer with a |buffer_id| to a + // WaylandWindow with the specified |widget|. + void ScheduleBufferSwap(gfx::AcceleratedWidget widget, + uint32_t buffer_id) override; + // Schedules a flush of the Wayland connection. void ScheduleFlush(); @@ -45,6 +77,7 @@ zxdg_shell_v6* shell_v6() { return shell_v6_.get(); } wl_seat* seat() { return seat_.get(); } wl_data_device* data_device() { return data_device_->data_device(); } + zwp_linux_dmabuf_v1* zwp_linux_dmabuf() { return zwp_linux_dmabuf_.get(); } WaylandWindow* GetWindow(gfx::AcceleratedWidget widget); WaylandWindow* GetCurrentFocusedWindow(); @@ -84,6 +117,14 @@ ClipboardDelegate::GetMimeTypesClosure callback) override; bool IsSelectionOwner() override; + // Returns bound pointer to own mojo interface. + ozone::mojom::WaylandConnectionPtr BindInterface(); + + std::vector<gfx::BufferFormat> GetSupportedBufferFormats(); + + void SetTerminateGpuCallback( + base::OnceCallback<void(std::string)> terminate_gpu_cb); + private: void Flush(); void DispatchUiEvent(Event* event); @@ -95,6 +136,22 @@ void OnFileCanReadWithoutBlocking(int fd) override; void OnFileCanWriteWithoutBlocking(int fd) override; + // Validates data sent by the GPU. If anything, terminates the gpu process. + bool ValidateDataFromGpu(const base::File& file, + uint32_t width, + uint32_t height, + const std::vector<uint32_t>& strides, + const std::vector<uint32_t>& offsets, + uint32_t format, + const std::vector<uint64_t>& modifiers, + uint32_t planes_count, + uint32_t buffer_id); + bool ValidateDataFromGpu(const gfx::AcceleratedWidget& widget, + uint32_t buffer_id); + + // Terminates the GPU process on invalid data received + void TerminateGpuProcess(std::string reason); + // wl_registry_listener static void Global(void* data, wl_registry* registry, @@ -113,6 +170,22 @@ // xdg_shell_listener static void Ping(void* data, xdg_shell* shell, uint32_t serial); + // zwp_linux_dmabuf_v1_listener + static void Modifiers(void* data, + struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, + uint32_t format, + uint32_t modifier_hi, + uint32_t modifier_lo); + static void Format(void* data, + struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, + uint32_t format); + + static void CreateSucceeded(void* data, + struct zwp_linux_buffer_params_v1* params, + struct wl_buffer* new_buffer); + static void CreateFailed(void* data, + struct zwp_linux_buffer_params_v1* params); + std::map<gfx::AcceleratedWidget, WaylandWindow*> window_map_; wl::Object<wl_display> display_; @@ -122,8 +195,23 @@ wl::Object<wl_seat> seat_; wl::Object<wl_shm> shm_; wl::Object<xdg_shell> shell_; + wl::Object<zwp_linux_dmabuf_v1> zwp_linux_dmabuf_; wl::Object<zxdg_shell_v6> shell_v6_; + // Stores a wl_buffer and it's id provided by the GbmBuffer object on the + // GPU process side. + base::flat_map<uint32_t, wl::Object<wl_buffer>> buffers_; + // A temporary params-to-buffer id map, which is used to identify which + // id wl_buffer should be assigned when storing it in the |buffers_| map + // during CreateSucceeded call. + base::flat_map<struct zwp_linux_buffer_params_v1*, uint32_t> + params_to_id_map_; + // It might happen that GPU asks to swap buffers, when a wl_buffer hasn't + // been created yet. Thus, store the request in a pending map. Once buffer + // is created, it will be attached to requested WaylandWindow based on the + // gfx::AcceleratedWidget. + base::flat_map<uint32_t, gfx::AcceleratedWidget> pending_buffer_map_; + std::unique_ptr<WaylandDataDeviceManager> data_device_manager_; std::unique_ptr<WaylandDataDevice> data_device_; std::unique_ptr<WaylandDataSource> data_source_; @@ -147,6 +235,14 @@ // Stores the callback to be invoked upon data reading from clipboard. RequestDataClosure read_clipboard_closure_; + mojo::Binding<ozone::mojom::WaylandConnection> binding_; + + std::vector<gfx::BufferFormat> buffer_formats_; + + // A callback, which is used to terminate a GPU process in case of invalid + // data sent by the GPU to the browser process. + base::OnceCallback<void(std::string)> terminate_gpu_cb_; + DISALLOW_COPY_AND_ASSIGN(WaylandConnection); };
diff --git a/ui/ozone/platform/wayland/wayland_connection_connector.cc b/ui/ozone/platform/wayland/wayland_connection_connector.cc new file mode 100644 index 0000000..cee7bb4 --- /dev/null +++ b/ui/ozone/platform/wayland/wayland_connection_connector.cc
@@ -0,0 +1,92 @@ +// Copyright 2018 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 "ui/ozone/platform/wayland/wayland_connection_connector.h" + +#include "base/task_runner_util.h" +#include "ui/ozone/platform/wayland/wayland_connection.h" +#include "ui/ozone/public/interfaces/wayland/wayland_connection.mojom.h" + +namespace ui { + +namespace { + +// TODO(msisov): In the future when GpuProcessHost is moved to vizhost, remove +// this utility code. +using BinderCallback = ui::GpuPlatformSupportHost::GpuHostBindInterfaceCallback; + +void BindInterfaceInGpuProcess(const std::string& interface_name, + mojo::ScopedMessagePipeHandle interface_pipe, + const BinderCallback& binder_callback) { + return binder_callback.Run(interface_name, std::move(interface_pipe)); +} + +template <typename Interface> +void BindInterfaceInGpuProcess(mojo::InterfaceRequest<Interface> request, + const BinderCallback& binder_callback) { + BindInterfaceInGpuProcess( + Interface::Name_, std::move(request.PassMessagePipe()), binder_callback); +} + +} // namespace + +WaylandConnectionConnector::WaylandConnectionConnector( + WaylandConnection* connection) + : connection_(connection) {} + +WaylandConnectionConnector::~WaylandConnectionConnector() = default; + +void WaylandConnectionConnector::OnGpuProcessLaunched( + int host_id, + scoped_refptr<base::SingleThreadTaskRunner> ui_runner, + scoped_refptr<base::SingleThreadTaskRunner> send_runner, + const base::RepeatingCallback<void(IPC::Message*)>& send_callback) {} + +void WaylandConnectionConnector::OnChannelDestroyed(int host_id) { + // TODO(msisov): Handle restarting. + NOTIMPLEMENTED(); +} + +void WaylandConnectionConnector::OnMessageReceived( + const IPC::Message& message) { + NOTREACHED() << "This class should only be used with mojo transport but here " + "we're wrongly getting invoked to handle IPC communication."; +} + +void WaylandConnectionConnector::OnGpuServiceLaunched( + scoped_refptr<base::SingleThreadTaskRunner> ui_runner, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) { + terminate_callback_ = std::move(terminate_callback); + binder_ = std::move(binder); + + io_runner_ = io_runner; + auto on_terminate_gpu_cb = + base::BindOnce(&WaylandConnectionConnector::OnTerminateGpuProcess, + base::Unretained(this)); + connection_->SetTerminateGpuCallback(std::move(on_terminate_gpu_cb)); + + base::PostTaskAndReplyWithResult( + ui_runner.get(), FROM_HERE, + base::BindOnce(&WaylandConnection::BindInterface, + base::Unretained(connection_)), + base::BindOnce(&WaylandConnectionConnector::OnWaylandConnectionPtrBinded, + base::Unretained(this))); +} + +void WaylandConnectionConnector::OnWaylandConnectionPtrBinded( + ozone::mojom::WaylandConnectionPtr wc_ptr) const { + ozone::mojom::WaylandConnectionClientPtr wcp_ptr; + auto request = mojo::MakeRequest(&wcp_ptr); + BindInterfaceInGpuProcess(std::move(request), binder_); + wcp_ptr->SetWaylandConnection(std::move(wc_ptr)); +} + +void WaylandConnectionConnector::OnTerminateGpuProcess(std::string message) { + io_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(terminate_callback_), + std::move(message))); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/wayland_connection_connector.h b/ui/ozone/platform/wayland/wayland_connection_connector.h new file mode 100644 index 0000000..c8941ed --- /dev/null +++ b/ui/ozone/platform/wayland/wayland_connection_connector.h
@@ -0,0 +1,59 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_CONNECTION_CONNECTOR_H_ +#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_CONNECTION_CONNECTOR_H_ + +#include "ui/ozone/public/gpu_platform_support_host.h" + +#include "ui/ozone/public/interfaces/wayland/wayland_connection.mojom.h" + +namespace ui { + +class WaylandConnection; + +// A connector class, which instantiates a connection between +// WaylandConnectionProxy on the GPU side and the WaylandConnection object on +// the browser process side. +class WaylandConnectionConnector : public GpuPlatformSupportHost { + public: + WaylandConnectionConnector(WaylandConnection* connection); + ~WaylandConnectionConnector() override; + + // GpuPlatformSupportHost: + void OnGpuProcessLaunched( + int host_id, + scoped_refptr<base::SingleThreadTaskRunner> ui_runner, + scoped_refptr<base::SingleThreadTaskRunner> send_runner, + const base::RepeatingCallback<void(IPC::Message*)>& send_callback) + override; + void OnChannelDestroyed(int host_id) override; + void OnMessageReceived(const IPC::Message& message) override; + void OnGpuServiceLaunched( + scoped_refptr<base::SingleThreadTaskRunner> ui_runner, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) override; + + private: + void OnWaylandConnectionPtrBinded( + ozone::mojom::WaylandConnectionPtr wc_ptr) const; + + void OnTerminateGpuProcess(std::string message); + + // Non-owning pointer, which is used to bind a mojo pointer to the + // WaylandConnection. + WaylandConnection* connection_ = nullptr; + + GpuHostBindInterfaceCallback binder_; + GpuHostTerminateCallback terminate_callback_; + + scoped_refptr<base::SingleThreadTaskRunner> io_runner_; + + DISALLOW_COPY_AND_ASSIGN(WaylandConnectionConnector); +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_CONNECTION_CONNECTOR_H_
diff --git a/ui/ozone/platform/wayland/wayland_object.cc b/ui/ozone/platform/wayland/wayland_object.cc index c9ec781..ec41d32 100644 --- a/ui/ozone/platform/wayland/wayland_object.cc +++ b/ui/ozone/platform/wayland/wayland_object.cc
@@ -4,6 +4,7 @@ #include "ui/ozone/platform/wayland/wayland_object.h" +#include <linux-dmabuf-unstable-v1-client-protocol.h> #include <wayland-client.h> #include <xdg-shell-unstable-v5-client-protocol.h> #include <xdg-shell-unstable-v6-client-protocol.h> @@ -126,6 +127,11 @@ const wl_interface* ObjectTraits<xdg_popup>::interface = &xdg_popup_interface; void (*ObjectTraits<xdg_popup>::deleter)(xdg_popup*) = &xdg_popup_destroy; +const wl_interface* ObjectTraits<zwp_linux_dmabuf_v1>::interface = + &zwp_linux_dmabuf_v1_interface; +void (*ObjectTraits<zwp_linux_dmabuf_v1>::deleter)(zwp_linux_dmabuf_v1*) = + &zwp_linux_dmabuf_v1_destroy; + const wl_interface* ObjectTraits<zxdg_shell_v6>::interface = &zxdg_shell_v6_interface; void (*ObjectTraits<zxdg_shell_v6>::deleter)(zxdg_shell_v6*) =
diff --git a/ui/ozone/platform/wayland/wayland_object.h b/ui/ozone/platform/wayland/wayland_object.h index 6924c4a..df3f16e 100644 --- a/ui/ozone/platform/wayland/wayland_object.h +++ b/ui/ozone/platform/wayland/wayland_object.h
@@ -30,6 +30,7 @@ struct xdg_shell; struct xdg_surface; struct xdg_popup; +struct zwp_linux_dmabuf_v1; struct zxdg_shell_v6; struct zxdg_surface_v6; struct zxdg_toplevel_v6; @@ -174,6 +175,12 @@ }; template <> +struct ObjectTraits<zwp_linux_dmabuf_v1> { + static const wl_interface* interface; + static void (*deleter)(zwp_linux_dmabuf_v1*); +}; + +template <> struct ObjectTraits<zxdg_shell_v6> { static const wl_interface* interface; static void (*deleter)(zxdg_shell_v6*);
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc index 6e9834e..805d4608 100644 --- a/ui/ozone/platform/wayland/wayland_surface_factory.cc +++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc
@@ -15,11 +15,16 @@ #include "ui/ozone/common/egl_util.h" #include "ui/ozone/common/gl_ozone_egl.h" #include "ui/ozone/platform/wayland/gl_surface_wayland.h" -#include "ui/ozone/platform/wayland/wayland_connection.h" +#include "ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h" #include "ui/ozone/platform/wayland/wayland_object.h" #include "ui/ozone/platform/wayland/wayland_window.h" #include "ui/ozone/public/surface_ozone_canvas.h" +#if defined(WAYLAND_GBM) +#include "ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h" +#include "ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h" +#endif + namespace ui { static void DeleteSharedMemory(void* pixels, void* context) { @@ -28,7 +33,8 @@ class WaylandCanvasSurface : public SurfaceOzoneCanvas { public: - WaylandCanvasSurface(WaylandConnection* connection, WaylandWindow* window_); + WaylandCanvasSurface(WaylandConnectionProxy* connection, + WaylandWindow* window_); ~WaylandCanvasSurface() override; // SurfaceOzoneCanvas @@ -38,7 +44,7 @@ std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; private: - WaylandConnection* connection_; + WaylandConnectionProxy* connection_; WaylandWindow* window_; gfx::Size size_; @@ -49,7 +55,7 @@ DISALLOW_COPY_AND_ASSIGN(WaylandCanvasSurface); }; -WaylandCanvasSurface::WaylandCanvasSurface(WaylandConnection* connection, +WaylandCanvasSurface::WaylandCanvasSurface(WaylandConnectionProxy* connection, WaylandWindow* window) : connection_(connection), window_(window), @@ -128,13 +134,27 @@ class GLOzoneEGLWayland : public GLOzoneEGL { public: - explicit GLOzoneEGLWayland(WaylandConnection* connection) - : connection_(connection) {} + GLOzoneEGLWayland(WaylandConnectionProxy* connection, + WaylandSurfaceFactory* surface_factory) + : connection_(connection), surface_factory_(surface_factory) {} ~GLOzoneEGLWayland() override {} scoped_refptr<gl::GLSurface> CreateViewGLSurface( gfx::AcceleratedWidget widget) override; + scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( + gfx::AcceleratedWidget window) override { +#if defined(WAYLAND_GBM) + // If there is a gbm device available, use surfaceless gl surface. + if (!connection_->gbm_device()) + return nullptr; + return gl::InitializeGLSurface( + new GbmSurfacelessWayland(surface_factory_, window)); +#else + return nullptr; +#endif + } + scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( const gfx::Size& size) override; @@ -143,7 +163,8 @@ bool LoadGLES2Bindings(gl::GLImplementation impl) override; private: - WaylandConnection* connection_; + WaylandConnectionProxy* connection_ = nullptr; + WaylandSurfaceFactory* surface_factory_ = nullptr; DISALLOW_COPY_AND_ASSIGN(GLOzoneEGLWayland); }; @@ -152,7 +173,8 @@ gfx::AcceleratedWidget widget) { DCHECK(connection_); WaylandWindow* window = connection_->GetWindow(widget); - DCHECK(window); + if (!window) + return nullptr; // The wl_egl_window needs to be created before the GLSurface so it can be // used in the GLSurface constructor. auto egl_window = CreateWaylandEglWindow(window); @@ -172,7 +194,7 @@ } intptr_t GLOzoneEGLWayland::GetNativeDisplay() { - return reinterpret_cast<intptr_t>(connection_->display()); + return connection_->Display(); } bool GLOzoneEGLWayland::LoadGLES2Bindings(gl::GLImplementation impl) { @@ -184,14 +206,36 @@ } // namespace -WaylandSurfaceFactory::WaylandSurfaceFactory(WaylandConnection* connection) +WaylandSurfaceFactory::WaylandSurfaceFactory(WaylandConnectionProxy* connection) : connection_(connection) { if (connection_) - egl_implementation_ = std::make_unique<GLOzoneEGLWayland>(connection_); + egl_implementation_ = + std::make_unique<GLOzoneEGLWayland>(connection_, this); } WaylandSurfaceFactory::~WaylandSurfaceFactory() {} +void WaylandSurfaceFactory::RegisterSurface(gfx::AcceleratedWidget widget, + GbmSurfacelessWayland* surface) { + widget_to_surface_map_.insert(std::make_pair(widget, surface)); +} + +void WaylandSurfaceFactory::UnregisterSurface(gfx::AcceleratedWidget widget) { + widget_to_surface_map_.erase(widget); +} + +GbmSurfacelessWayland* WaylandSurfaceFactory::GetSurface( + gfx::AcceleratedWidget widget) const { + auto it = widget_to_surface_map_.find(widget); + DCHECK(it != widget_to_surface_map_.end()); + return it->second; +} + +void WaylandSurfaceFactory::ScheduleBufferSwap(gfx::AcceleratedWidget widget, + uint32_t buffer_id) { + connection_->ScheduleBufferSwap(widget, buffer_id); +} + std::unique_ptr<SurfaceOzoneCanvas> WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) { if (!connection_) @@ -227,8 +271,15 @@ gfx::Size size, gfx::BufferFormat format, gfx::BufferUsage usage) { - NOTIMPLEMENTED(); +#if defined(WAYLAND_GBM) + scoped_refptr<GbmPixmapWayland> pixmap = + base::MakeRefCounted<GbmPixmapWayland>(this, connection_); + if (!pixmap->InitializeBuffer(size, format, usage)) + return nullptr; + return pixmap; +#else return nullptr; +#endif } scoped_refptr<gfx::NativePixmap>
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.h b/ui/ozone/platform/wayland/wayland_surface_factory.h index f320bc5..3b569890 100644 --- a/ui/ozone/platform/wayland/wayland_surface_factory.h +++ b/ui/ozone/platform/wayland/wayland_surface_factory.h
@@ -10,16 +10,28 @@ #include "ui/gl/gl_surface.h" #include "ui/ozone/public/surface_factory_ozone.h" +#include "base/posix/eintr_wrapper.h" +#include "base/single_thread_task_runner.h" +#include "base/threading/sequenced_task_runner_handle.h" + namespace ui { -class WaylandConnection; +class WaylandConnectionProxy; +class GbmSurfacelessWayland; class WaylandSurfaceFactory : public SurfaceFactoryOzone { public: - explicit WaylandSurfaceFactory(WaylandConnection* connection); + explicit WaylandSurfaceFactory(WaylandConnectionProxy* connection); ~WaylandSurfaceFactory() override; - // SurfaceFactoryOzone: + // These methods are used, when a dmabuf based approach is used. + void ScheduleBufferSwap(gfx::AcceleratedWidget widget, uint32_t buffer_id); + void RegisterSurface(gfx::AcceleratedWidget widget, + GbmSurfacelessWayland* surface); + void UnregisterSurface(gfx::AcceleratedWidget widget); + GbmSurfacelessWayland* GetSurface(gfx::AcceleratedWidget widget) const; + + // SurfaceFactoryOzone overrides: std::vector<gl::GLImplementation> GetAllowedGLImplementations() override; GLOzone* GetGLOzone(gl::GLImplementation implementation) override; std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( @@ -36,9 +48,12 @@ const gfx::NativePixmapHandle& handle) override; private: - WaylandConnection* connection_; + WaylandConnectionProxy* connection_ = nullptr; std::unique_ptr<GLOzone> egl_implementation_; + std::map<gfx::AcceleratedWidget, GbmSurfacelessWayland*> + widget_to_surface_map_; + DISALLOW_COPY_AND_ASSIGN(WaylandSurfaceFactory); };
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc b/ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc index ac53749..e1365e7d 100644 --- a/ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc +++ b/ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc
@@ -19,7 +19,7 @@ class WaylandSurfaceFactoryTest : public WaylandTest { public: - WaylandSurfaceFactoryTest() : surface_factory(connection_.get()) {} + WaylandSurfaceFactoryTest() : surface_factory(connection_proxy_.get()) {} ~WaylandSurfaceFactoryTest() override {}
diff --git a/ui/ozone/platform/wayland/wayland_test.cc b/ui/ozone/platform/wayland/wayland_test.cc index ff8d382..8db8147 100644 --- a/ui/ozone/platform/wayland/wayland_test.cc +++ b/ui/ozone/platform/wayland/wayland_test.cc
@@ -29,6 +29,7 @@ std::make_unique<StubKeyboardLayoutEngine>()); #endif connection_.reset(new WaylandConnection); + connection_proxy_.reset(new WaylandConnectionProxy(connection_.get())); window_ = std::make_unique<WaylandWindow>(&delegate_, connection_.get()); }
diff --git a/ui/ozone/platform/wayland/wayland_test.h b/ui/ozone/platform/wayland/wayland_test.h index 20f7dfa4..26f44a5 100644 --- a/ui/ozone/platform/wayland/wayland_test.h +++ b/ui/ozone/platform/wayland/wayland_test.h
@@ -9,6 +9,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/ui_features.h" #include "ui/ozone/platform/wayland/fake_server.h" +#include "ui/ozone/platform/wayland/gpu/wayland_connection_proxy.h" #include "ui/ozone/platform/wayland/wayland_connection.h" #include "ui/ozone/platform/wayland/wayland_window.h" #include "ui/ozone/test/mock_platform_window_delegate.h" @@ -43,6 +44,7 @@ wl::MockSurface* surface_; MockPlatformWindowDelegate delegate_; + std::unique_ptr<WaylandConnectionProxy> connection_proxy_; std::unique_ptr<WaylandConnection> connection_; std::unique_ptr<WaylandWindow> window_; gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
diff --git a/ui/ozone/public/gpu_platform_support_host.cc b/ui/ozone/public/gpu_platform_support_host.cc index 586186c..0881946 100644 --- a/ui/ozone/public/gpu_platform_support_host.cc +++ b/ui/ozone/public/gpu_platform_support_host.cc
@@ -26,7 +26,8 @@ void OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> ui_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) override {} + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) override {} }; } // namespace
diff --git a/ui/ozone/public/gpu_platform_support_host.h b/ui/ozone/public/gpu_platform_support_host.h index f1120e74..2f81d97 100644 --- a/ui/ozone/public/gpu_platform_support_host.h +++ b/ui/ozone/public/gpu_platform_support_host.h
@@ -30,6 +30,8 @@ using GpuHostBindInterfaceCallback = base::RepeatingCallback<void(const std::string&, mojo::ScopedMessagePipeHandle)>; + using GpuHostTerminateCallback = + base::OnceCallback<void(const std::string& message)>; GpuPlatformSupportHost(); virtual ~GpuPlatformSupportHost(); @@ -55,7 +57,8 @@ virtual void OnGpuServiceLaunched( scoped_refptr<base::SingleThreadTaskRunner> host_runner, scoped_refptr<base::SingleThreadTaskRunner> io_runner, - GpuHostBindInterfaceCallback binder) = 0; + GpuHostBindInterfaceCallback binder, + GpuHostTerminateCallback terminate_callback) = 0; }; // create a stub implementation.
diff --git a/ui/ozone/public/interfaces/wayland/BUILD.gn b/ui/ozone/public/interfaces/wayland/BUILD.gn new file mode 100644 index 0000000..c6f2360d --- /dev/null +++ b/ui/ozone/public/interfaces/wayland/BUILD.gn
@@ -0,0 +1,16 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("wayland_interfaces") { + sources = [ + "wayland_connection.mojom", + ] + + public_deps = [ + "//mojo/public/mojom/base", + "//ui/gfx/mojo", + ] +}
diff --git a/ui/ozone/public/interfaces/wayland/OWNERS b/ui/ozone/public/interfaces/wayland/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/ui/ozone/public/interfaces/wayland/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/ui/ozone/public/interfaces/wayland/wayland_connection.mojom b/ui/ozone/public/interfaces/wayland/wayland_connection.mojom new file mode 100644 index 0000000..fde5b12 --- /dev/null +++ b/ui/ozone/public/interfaces/wayland/wayland_connection.mojom
@@ -0,0 +1,36 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ui.ozone.mojom; + +import "mojo/public/mojom/base/file.mojom"; +import "mojo/public/mojom/base/file_path.mojom"; +import "ui/gfx/mojo/accelerated_widget.mojom"; + +// Used by the GPU for communication with a WaylandConnection on the browser +// process. +interface WaylandConnection { + // Asks Wayland to create a wl_buffer based on the dmabuf |file| descriptor. + CreateZwpLinuxDmabuf(mojo_base.mojom.File file, + uint32 width, + uint32 height, + array<uint32> strides, + array<uint32> offsets, + uint32 format, + array<uint64> modifiers, + uint32 planes_count, + uint32 buffer_id); + + // Destroys a wl_buffer created by WaylandConnection based on the |buffer_id|. + DestroyZwpLinuxDmabuf(uint32 buffer_id); + + // Swaps wl_buffers for a WaylandWindow with the following |widget|. + ScheduleBufferSwap(gfx.mojom.AcceleratedWidget widget, uint32 buffer_id); +}; + +// Used by the browser process to provide the GPU process with a mojo ptr to a +// WaylandConnection, which lives on the browser process. +interface WaylandConnectionClient { + SetWaylandConnection(WaylandConnection wc_ptr); +};
diff --git a/ui/ozone/public/ozone_platform.cc b/ui/ozone/public/ozone_platform.cc index b496a02..b924a7e8 100644 --- a/ui/ozone/public/ozone_platform.cc +++ b/ui/ozone/public/ozone_platform.cc
@@ -22,7 +22,7 @@ base::LazyInstance<base::OnceCallback<void(OzonePlatform*)>>::Leaky instance_callback = LAZY_INSTANCE_INITIALIZER; -constexpr OzonePlatform::PlatformProperties kDefaultPlatformProperties; +const OzonePlatform::PlatformProperties kDefaultPlatformProperties; base::Lock& GetOzoneInstanceLock() { static base::Lock lock; @@ -31,6 +31,23 @@ } // namespace +OzonePlatform::PlatformProperties::PlatformProperties() = default; + +OzonePlatform::PlatformProperties::PlatformProperties( + bool needs_request, + bool custom_frame_default, + bool can_use_system_title_bar, + std::vector<gfx::BufferFormat> buffer_formats) + : needs_view_owner_request(needs_request), + custom_frame_pref_default(custom_frame_default), + use_system_title_bar(can_use_system_title_bar), + supported_buffer_formats(buffer_formats) {} + +OzonePlatform::PlatformProperties::~PlatformProperties() = default; + +OzonePlatform::PlatformProperties::PlatformProperties( + const PlatformProperties& other) = default; + OzonePlatform::OzonePlatform() { GetOzoneInstanceLock().AssertAcquired(); DCHECK(!instance_) << "There should only be a single OzonePlatform.";
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h index ecf1fd85..8d776c83 100644 --- a/ui/ozone/public/ozone_platform.h +++ b/ui/ozone/public/ozone_platform.h
@@ -13,6 +13,7 @@ #include "services/service_manager/public/cpp/bind_source_info.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "ui/events/system_input_injector.h" +#include "ui/gfx/buffer_types.h" #include "ui/gfx/native_widget_types.h" #include "ui/ozone/ozone_export.h" @@ -86,6 +87,14 @@ // Struct used to indicate platform properties. struct PlatformProperties { + PlatformProperties(); + PlatformProperties(bool needs_request, + bool custom_frame_default, + bool can_use_system_title_bar, + std::vector<gfx::BufferFormat> buffer_formats); + ~PlatformProperties(); + PlatformProperties(const PlatformProperties& other); + // Fuchsia only: set to true when the platforms requires // |view_owner_request| field in PlatformWindowInitProperties when creating // a window. @@ -98,6 +107,9 @@ // Determine whether switching between system and custom frames is // supported. bool use_system_title_bar = false; + + // Wayland only: carries buffer formats supported by a Wayland server. + std::vector<gfx::BufferFormat> supported_buffer_formats; }; // Ensures the OzonePlatform instance without doing any initialization.
diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd index 34d477f2..31f846e 100644 --- a/ui/strings/ui_strings.grd +++ b/ui/strings/ui_strings.grd
@@ -598,9 +598,6 @@ <message name="IDS_APP_MEDIA_STOP_KEY" desc="Media stop key"> Media Stop </message> - <message name="IDS_APP_ALT_KEY" desc="Alt key"> - Alt - </message> <message name="IDS_APP_CTRL_KEY" desc="Ctrl key"> Ctrl </message>
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 892dd16f..99c8b00 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -455,6 +455,7 @@ "cocoa/widget_owner_nswindow_adapter.mm", "controls/button/label_button_label.cc", "controls/button/label_button_label.h", + "controls/menu/menu_pre_target_handler.h", ] sources += get_target_outputs(":views_vector_icons") @@ -588,7 +589,6 @@ "accessibility/ax_widget_obj_wrapper.h", "accessibility/ax_window_obj_wrapper.h", "bubble/tray_bubble_view.h", - "controls/menu/menu_pre_target_handler.h", "controls/native/native_view_host_aura.h", "corewm/cursor_height_provider_win.h", "corewm/tooltip.h", @@ -622,7 +622,8 @@ "accessibility/ax_window_obj_wrapper.cc", "bubble/tray_bubble_view.cc", "controls/menu/display_change_listener_aura.cc", - "controls/menu/menu_pre_target_handler.cc", + "controls/menu/menu_pre_target_handler_aura.cc", + "controls/menu/menu_pre_target_handler_aura.h", "controls/native/native_view_host_aura.cc", "corewm/cursor_height_provider_win.cc", "corewm/tooltip_aura.cc", @@ -722,6 +723,10 @@ if (is_mac) { sources -= [ "controls/views_text_services_context_menu.cc" ] + sources += [ + "controls/menu/menu_pre_target_handler_mac.h", + "controls/menu/menu_pre_target_handler_mac.mm", + ] deps += [ "//components/crash/core/common", "//ui/accelerated_widget_mac",
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index ee2852fe..7fb17a38 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc
@@ -31,6 +31,7 @@ #include "ui/views/controls/menu/menu_controller_delegate.h" #include "ui/views/controls/menu/menu_host_root_view.h" #include "ui/views/controls/menu/menu_item_view.h" +#include "ui/views/controls/menu/menu_pre_target_handler.h" #include "ui/views/controls/menu/menu_scroll_view_container.h" #include "ui/views/controls/menu/submenu_view.h" #include "ui/views/drag_utils.h" @@ -55,7 +56,6 @@ #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" -#include "ui/views/controls/menu/menu_pre_target_handler.h" #endif using base::TimeDelta; @@ -461,12 +461,9 @@ if (owner_) owner_->AddObserver(this); -#if defined(USE_AURA) // Only create a MenuPreTargetHandler for non-nested menus. Nested menus // will use the existing one. - menu_pre_target_handler_ = - std::make_unique<MenuPreTargetHandler>(this, owner_); -#endif + menu_pre_target_handler_ = MenuPreTargetHandler::Create(this, owner_); } #if defined(OS_MACOSX)
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h index 6b2aaa7c..97ff101b 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h
@@ -39,15 +39,12 @@ class MenuButton; class MenuHostRootView; class MenuItemView; +class MenuPreTargetHandler; class MouseEvent; class SubmenuView; class View; class ViewTracker; -#if defined(USE_AURA) -class MenuPreTargetHandler; -#endif - namespace internal { class MenuControllerDelegate; class MenuRunnerImpl; @@ -731,9 +728,7 @@ std::unique_ptr<MenuCocoaWatcherMac> menu_cocoa_watcher_; #endif -#if defined(USE_AURA) std::unique_ptr<MenuPreTargetHandler> menu_pre_target_handler_; -#endif DISALLOW_COPY_AND_ASSIGN(MenuController); };
diff --git a/ui/views/controls/menu/menu_pre_target_handler.h b/ui/views/controls/menu/menu_pre_target_handler.h index 4ff27ddc..8a02e96 100644 --- a/ui/views/controls/menu/menu_pre_target_handler.h +++ b/ui/views/controls/menu/menu_pre_target_handler.h
@@ -1,56 +1,39 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_CONTROLS_MENU_PRE_TARGET_HANDLER_H_ -#define UI_VIEWS_CONTROLS_MENU_PRE_TARGET_HANDLER_H_ +#ifndef UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_H_ +#define UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_H_ -#include "ui/aura/window_observer.h" -#include "ui/events/event_handler.h" -#include "ui/views/views_export.h" -#include "ui/wm/public/activation_change_observer.h" +#include <memory> -namespace aura { -class Window; -} // namespace aura +#include "base/macros.h" namespace views { class MenuController; class Widget; -// MenuPreTargetHandler is used to observe activation changes, cancel events, -// and root window destruction, to shutdown the menu. -// -// Additionally handles key events to provide accelerator support to menus. -class VIEWS_EXPORT MenuPreTargetHandler : public wm::ActivationChangeObserver, - public aura::WindowObserver, - public ui::EventHandler { +// A MenuPreTargetHandler is responsible for intercepting events destined for +// another widget (the menu's owning widget) and letting the menu's controller +// try dispatching them first. +class MenuPreTargetHandler { public: - MenuPreTargetHandler(MenuController* controller, Widget* owner); - ~MenuPreTargetHandler() override; + virtual ~MenuPreTargetHandler() = default; - // aura::client:ActivationChangeObserver: - void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason, - aura::Window* gained_active, - aura::Window* lost_active) override; + // There are separate implementations of this method for Aura platforms and + // for Mac. + static std::unique_ptr<MenuPreTargetHandler> Create( + MenuController* controller, + Widget* owner); - // aura::WindowObserver: - void OnWindowDestroying(aura::Window* window) override; - - // ui::EventHandler: - void OnCancelMode(ui::CancelModeEvent* event) override; - void OnKeyEvent(ui::KeyEvent* event) override; + protected: + MenuPreTargetHandler() = default; private: - void Cleanup(); - - MenuController* controller_; - aura::Window* root_; - DISALLOW_COPY_AND_ASSIGN(MenuPreTargetHandler); }; } // namespace views -#endif // UI_VIEWS_CONTROLS_MENU_PRE_TARGET_HANDLER_H_ +#endif // UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_H_
diff --git a/ui/views/controls/menu/menu_pre_target_handler.cc b/ui/views/controls/menu/menu_pre_target_handler_aura.cc similarity index 65% rename from ui/views/controls/menu/menu_pre_target_handler.cc rename to ui/views/controls/menu/menu_pre_target_handler_aura.cc index 1ea390e..45b0716 100644 --- a/ui/views/controls/menu/menu_pre_target_handler.cc +++ b/ui/views/controls/menu/menu_pre_target_handler_aura.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/views/controls/menu/menu_pre_target_handler.h" +#include "ui/views/controls/menu/menu_pre_target_handler_aura.h" #include "ui/aura/env.h" #include "ui/aura/window.h" @@ -20,8 +20,8 @@ } // namespace -MenuPreTargetHandler::MenuPreTargetHandler(MenuController* controller, - Widget* owner) +MenuPreTargetHandlerAura::MenuPreTargetHandlerAura(MenuController* controller, + Widget* owner) : controller_(controller), root_(GetOwnerRootWindow(owner)) { aura::Env::GetInstance()->AddPreTargetHandler( this, ui::EventTarget::Priority::kSystem); @@ -31,12 +31,12 @@ } } -MenuPreTargetHandler::~MenuPreTargetHandler() { +MenuPreTargetHandlerAura::~MenuPreTargetHandlerAura() { aura::Env::GetInstance()->RemovePreTargetHandler(this); Cleanup(); } -void MenuPreTargetHandler::OnWindowActivated( +void MenuPreTargetHandlerAura::OnWindowActivated( wm::ActivationChangeObserver::ActivationReason reason, aura::Window* gained_active, aura::Window* lost_active) { @@ -44,19 +44,19 @@ controller_->CancelAll(); } -void MenuPreTargetHandler::OnWindowDestroying(aura::Window* window) { +void MenuPreTargetHandlerAura::OnWindowDestroying(aura::Window* window) { Cleanup(); } -void MenuPreTargetHandler::OnCancelMode(ui::CancelModeEvent* event) { +void MenuPreTargetHandlerAura::OnCancelMode(ui::CancelModeEvent* event) { controller_->CancelAll(); } -void MenuPreTargetHandler::OnKeyEvent(ui::KeyEvent* event) { +void MenuPreTargetHandlerAura::OnKeyEvent(ui::KeyEvent* event) { controller_->OnWillDispatchKeyEvent(event); } -void MenuPreTargetHandler::Cleanup() { +void MenuPreTargetHandlerAura::Cleanup() { if (!root_) return; // The ActivationClient may have been destroyed by the time we get here. @@ -67,4 +67,11 @@ root_ = nullptr; } +// static +std::unique_ptr<MenuPreTargetHandler> MenuPreTargetHandler::Create( + MenuController* controller, + Widget* owner) { + return std::make_unique<MenuPreTargetHandlerAura>(controller, owner); +} + } // namespace views
diff --git a/ui/views/controls/menu/menu_pre_target_handler_aura.h b/ui/views/controls/menu/menu_pre_target_handler_aura.h new file mode 100644 index 0000000..13fc79c --- /dev/null +++ b/ui/views/controls/menu/menu_pre_target_handler_aura.h
@@ -0,0 +1,59 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_AURA_H_ +#define UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_AURA_H_ + +#include "ui/aura/window_observer.h" +#include "ui/events/event_handler.h" +#include "ui/views/controls/menu/menu_pre_target_handler.h" +#include "ui/views/views_export.h" +#include "ui/wm/public/activation_change_observer.h" + +namespace aura { +class Window; +} // namespace aura + +namespace views { + +class MenuController; +class Widget; + +// MenuPreTargetHandlerAura is used to observe activation changes, cancel +// events, and root window destruction, to shutdown the menu. +// +// Additionally handles key events to provide accelerator support to menus. +class VIEWS_EXPORT MenuPreTargetHandlerAura + : public wm::ActivationChangeObserver, + public aura::WindowObserver, + public ui::EventHandler, + public MenuPreTargetHandler { + public: + MenuPreTargetHandlerAura(MenuController* controller, Widget* owner); + ~MenuPreTargetHandlerAura() override; + + // aura::client:ActivationChangeObserver: + void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason, + aura::Window* gained_active, + aura::Window* lost_active) override; + + // aura::WindowObserver: + void OnWindowDestroying(aura::Window* window) override; + + // ui::EventHandler: + void OnCancelMode(ui::CancelModeEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; + + private: + void Cleanup(); + + MenuController* controller_; + aura::Window* root_; + + DISALLOW_COPY_AND_ASSIGN(MenuPreTargetHandlerAura); +}; + +} // namespace views + +#endif // UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_AURA_H_
diff --git a/ui/views/controls/menu/menu_pre_target_handler_mac.h b/ui/views/controls/menu/menu_pre_target_handler_mac.h new file mode 100644 index 0000000..d225097 --- /dev/null +++ b/ui/views/controls/menu/menu_pre_target_handler_mac.h
@@ -0,0 +1,32 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_MAC_H_ +#define UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_MAC_H_ + +#include "ui/events/event_handler.h" +#include "ui/views/controls/menu/menu_pre_target_handler.h" +#include "ui/views/event_monitor_mac.h" + +namespace views { + +class MenuPreTargetHandlerMac : public MenuPreTargetHandler, + public ui::EventHandler { + public: + MenuPreTargetHandlerMac(MenuController* controller, Widget* widget); + ~MenuPreTargetHandlerMac() override; + + // ui::EventHandler: + void OnKeyEvent(ui::KeyEvent* event) override; + + private: + MenuController* controller_; // Weak. Owns |this|. + std::unique_ptr<EventMonitorMac> event_monitor_; + + DISALLOW_COPY_AND_ASSIGN(MenuPreTargetHandlerMac); +}; + +} // namespace views + +#endif // UI_VIEWS_CONTROLS_MENU_MENU_PRE_TARGET_HANDLER_MAC_H_
diff --git a/ui/views/controls/menu/menu_pre_target_handler_mac.mm b/ui/views/controls/menu/menu_pre_target_handler_mac.mm new file mode 100644 index 0000000..81ce0da --- /dev/null +++ b/ui/views/controls/menu/menu_pre_target_handler_mac.mm
@@ -0,0 +1,34 @@ +// Copyright 2018 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 "ui/views/controls/menu/menu_pre_target_handler_mac.h" + +#include "ui/views/controls/menu/menu_controller.h" +#include "ui/views/widget/widget.h" + +namespace views { + +MenuPreTargetHandlerMac::MenuPreTargetHandlerMac(MenuController* controller, + Widget* widget) + : controller_(controller), + event_monitor_( + std::make_unique<EventMonitorMac>(this, widget->GetNativeWindow())) {} + +MenuPreTargetHandlerMac::~MenuPreTargetHandlerMac() {} + +void MenuPreTargetHandlerMac::OnKeyEvent(ui::KeyEvent* event) { + if (controller_->OnWillDispatchKeyEvent(event) != + ui::POST_DISPATCH_PERFORM_DEFAULT) { + event->SetHandled(); + } +} + +// static +std::unique_ptr<MenuPreTargetHandler> MenuPreTargetHandler::Create( + MenuController* controller, + Widget* widget) { + return std::make_unique<MenuPreTargetHandlerMac>(controller, widget); +} + +} // namespace views
diff --git a/ui/views/event_monitor_mac.mm b/ui/views/event_monitor_mac.mm index 8511347..7485ab26 100644 --- a/ui/views/event_monitor_mac.mm +++ b/ui/views/event_monitor_mac.mm
@@ -48,8 +48,13 @@ if (!target_window || [event window] == target_window) { std::unique_ptr<ui::Event> ui_event = ui::EventFromNative(event); - if (ui_event) + if (ui_event) { event_handler->OnEvent(ui_event.get()); + // If an event is handled, swallow it by returning nil so the event + // never proceeds to the normal event handling machinery. + if (ui_event->handled()) + return nil; + } } return event; };
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc index 0f37029..80a1708 100644 --- a/ui/views/mus/desktop_window_tree_host_mus.cc +++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -496,17 +496,36 @@ return this; } -void DesktopWindowTreeHostMus::ShowWindowWithState(ui::WindowShowState state) { - if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN) - window()->SetProperty(aura::client::kShowStateKey, state); +void DesktopWindowTreeHostMus::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { + native_widget_delegate_->OnNativeWidgetVisibilityChanging(true); + + if (show_state == ui::SHOW_STATE_MAXIMIZED && !restore_bounds.IsEmpty()) { + window()->SetProperty(aura::client::kRestoreBoundsKey, + new gfx::Rect(restore_bounds)); + } + if (show_state == ui::SHOW_STATE_MAXIMIZED || + show_state == ui::SHOW_STATE_FULLSCREEN) { + window()->SetProperty(aura::client::kShowStateKey, show_state); + } + // DesktopWindowTreeHostMus is unique in that it calls window()->Show() here. + // All other implementations call window()->Show() from the constructor. This + // is necessary as window()'s visibility is mirrored in the server, on other + // platforms it's the visibility of the AcceleratedWidget that matters and + // dictates what is actually drawn on screen. window()->Show(); if (compositor()) compositor()->SetVisible(true); + // |content_window_| is the Window that will be focused by way of Activate(). + // Ensure |content_window_| is visible before the call to Activate(), + // otherwise focus goes to window(). + content_window()->Show(); + native_widget_delegate_->OnNativeWidgetVisibilityChanged(true); if (native_widget_delegate_->CanActivate()) { - if (state != ui::SHOW_STATE_INACTIVE) + if (show_state != ui::SHOW_STATE_INACTIVE) Activate(); // SetInitialFocus() should be always be called, even for @@ -516,17 +535,10 @@ // should pass SHOW_STATE_INACTIVE to SetInitialFocus() to stop the initial // focused view from getting focused. See crbug.com/515594 for example. native_widget_delegate_->SetInitialFocus( - IsActive() ? state : ui::SHOW_STATE_INACTIVE); + IsActive() ? show_state : ui::SHOW_STATE_INACTIVE); } } -void DesktopWindowTreeHostMus::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - window()->SetProperty(aura::client::kRestoreBoundsKey, - new gfx::Rect(restored_bounds)); - ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED); -} - bool DesktopWindowTreeHostMus::IsVisible() const { // Go through the DesktopNativeWidgetAura::IsVisible() for checking // visibility of the parent as it has additional checks beyond checking the @@ -888,11 +900,7 @@ } void DesktopWindowTreeHostMus::ShowImpl() { - native_widget_delegate_->OnNativeWidgetVisibilityChanging(true); - // Using ui::SHOW_STATE_NORMAL matches that of DesktopWindowTreeHostX11. - ShowWindowWithState(ui::SHOW_STATE_NORMAL); - WindowTreeHostMus::ShowImpl(); - native_widget_delegate_->OnNativeWidgetVisibilityChanged(true); + Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); } void DesktopWindowTreeHostMus::HideImpl() {
diff --git a/ui/views/mus/desktop_window_tree_host_mus.h b/ui/views/mus/desktop_window_tree_host_mus.h index 3e043a8..a93e0c29 100644 --- a/ui/views/mus/desktop_window_tree_host_mus.h +++ b/ui/views/mus/desktop_window_tree_host_mus.h
@@ -74,8 +74,8 @@ void Close() override; void CloseNow() override; aura::WindowTreeHost* AsWindowTreeHost() override; - void ShowWindowWithState(ui::WindowShowState state) override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; bool IsVisible() const override; void SetSize(const gfx::Size& size) override; void StackAbove(aura::Window* window) override;
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 2b4abc4..ca16438 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -747,11 +747,11 @@ desktop_window_tree_host_->CloseNow(); } -void DesktopNativeWidgetAura::Show() { +void DesktopNativeWidgetAura::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { if (!content_window_) return; - desktop_window_tree_host_->AsWindowTreeHost()->Show(); - content_window_->Show(); + desktop_window_tree_host_->Show(show_state, restore_bounds); } void DesktopNativeWidgetAura::Hide() { @@ -761,23 +761,6 @@ content_window_->Hide(); } -void DesktopNativeWidgetAura::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - // IsVisible() should check the same objects here for visibility. - if (!content_window_) - return; - desktop_window_tree_host_->ShowMaximizedWithBounds(restored_bounds); - content_window_->Show(); -} - -void DesktopNativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { - // IsVisible() should check the same objects here for visibility. - if (!content_window_) - return; - desktop_window_tree_host_->ShowWindowWithState(state); - content_window_->Show(); -} - bool DesktopNativeWidgetAura::IsVisible() const { // The objects checked here should be the same objects changed in // ShowWithWindowState and ShowMaximizedWithBounds. For example, MS Windows
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h index a19d3949..da45a84 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -144,10 +144,9 @@ void SetShape(std::unique_ptr<Widget::ShapeRects> shape) override; void Close() override; void CloseNow() override; - void Show() override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; void Hide() override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; - void ShowWithWindowState(ui::WindowShowState state) override; bool IsVisible() const override; void Activate() override; void Deactivate() override;
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc index 1e7210e..9d4d564 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
@@ -33,6 +33,8 @@ #include "ui/views/window/dialog_delegate.h" #if defined(OS_WIN) +#include <windows.h> + #include "ui/base/view_prop.h" #include "ui/base/win/window_event_target.h" #include "ui/views/win/hwnd_util.h" @@ -122,6 +124,7 @@ ->GetFocusedWindow()); } +#if defined(OS_WIN) // Verifies that if the DesktopWindowTreeHost is already shown, the native view // still reports not visible as we haven't shown the content window. TEST_F(DesktopNativeWidgetAuraTest, WidgetNotVisibleOnlyWindowTreeHostShown) { @@ -131,11 +134,11 @@ init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; init_params.native_widget = new DesktopNativeWidgetAura(&widget); widget.Init(init_params); - DesktopNativeWidgetAura* desktop_native_widget_aura = - static_cast<DesktopNativeWidgetAura*>(widget.native_widget()); - desktop_native_widget_aura->host()->Show(); + ShowWindow(widget.GetNativeView()->GetHost()->GetAcceleratedWidget(), + SW_SHOWNORMAL); EXPECT_FALSE(widget.IsVisible()); } +#endif TEST_F(DesktopNativeWidgetAuraTest, DesktopAuraWindowShowFrameless) { Widget widget;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host.h b/ui/views/widget/desktop_aura/desktop_window_tree_host.h index a6e2eca..8a909991 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host.h
@@ -75,8 +75,24 @@ virtual aura::WindowTreeHost* AsWindowTreeHost() = 0; - virtual void ShowWindowWithState(ui::WindowShowState show_state) = 0; - virtual void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) = 0; + // There are two distinct ways for DesktopWindowTreeHosts's to be shown: + // 1. This function is called. As this function is specific to + // DesktopWindowTreeHost, it is only called from DesktopNativeWidgetAura. + // 2. Calling Show() directly on the WindowTreeHost associated with this + // DesktopWindowTreeHost. This is very rare. In general, calls go through + // Widget, which ends up in (1). + // + // Implementations must deal with these two code paths. In general, this is + // done by having the WindowTreeHost subclass override ShowImpl() to call this + // function: Show(ui::SHOW_STATE_NORMAL, gfx::Rect()). A subtle + // ramification is the implementation of this function can *not* call + // WindowTreeHost::Show(), and the implementation of this must perform the + // same work as WindowTreeHost::Show(). This means setting the visibility of + // the compositor, window() and DesktopNativeWidgetAura::content_window() + // appropriately. Some subclasses set the visibility of window() in the + // constructor and assume it's always true. + virtual void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) = 0; virtual bool IsVisible() const = 0;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc index 8879221..dcf1d7d 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
@@ -145,8 +145,11 @@ return this; } -void DesktopWindowTreeHostPlatform::ShowWindowWithState( - ui::WindowShowState show_state) { +void DesktopWindowTreeHostPlatform::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { + if (show_state == ui::SHOW_STATE_MAXIMIZED && !restore_bounds.IsEmpty()) + platform_window()->SetRestoredBoundsInPixels(ToPixelRect(restore_bounds)); + if (compositor()) { platform_window()->Show(); compositor()->SetVisible(true); @@ -182,12 +185,8 @@ native_widget_delegate_->SetInitialFocus( IsActive() ? show_state : ui::SHOW_STATE_INACTIVE); } -} -void DesktopWindowTreeHostPlatform::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - platform_window()->SetRestoredBoundsInPixels(ToPixelRect(restored_bounds)); - ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED); + desktop_native_widget_aura_->content_window()->Show(); } bool DesktopWindowTreeHostPlatform::IsVisible() const {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h index 7e28ac1..b6219dd 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
@@ -34,8 +34,8 @@ void Close() override; void CloseNow() override; aura::WindowTreeHost* AsWindowTreeHost() override; - void ShowWindowWithState(ui::WindowShowState show_state) override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; bool IsVisible() const override; void SetSize(const gfx::Size& size) override; void StackAbove(aura::Window* window) override;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc index 5b6df9c..9ab47c8 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -199,20 +199,19 @@ return this; } -void DesktopWindowTreeHostWin::ShowWindowWithState( - ui::WindowShowState show_state) { +void DesktopWindowTreeHostWin::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { if (compositor()) compositor()->SetVisible(true); - message_handler_->ShowWindowWithState(show_state); -} -void DesktopWindowTreeHostWin::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - if (compositor()) - compositor()->SetVisible(true); - gfx::Rect pixel_bounds = - display::win::ScreenWin::DIPToScreenRect(GetHWND(), restored_bounds); - message_handler_->ShowMaximizedWithBounds(pixel_bounds); + gfx::Rect pixel_restore_bounds; + if (show_state == ui::SHOW_STATE_MAXIMIZED) { + pixel_restore_bounds = + display::win::ScreenWin::DIPToScreenRect(GetHWND(), restore_bounds); + } + message_handler_->Show(show_state, pixel_restore_bounds); + + content_window()->Show(); } bool DesktopWindowTreeHostWin::IsVisible() const { @@ -504,7 +503,7 @@ } void DesktopWindowTreeHostWin::ShowImpl() { - message_handler_->Show(); + Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); } void DesktopWindowTreeHostWin::HideImpl() {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h index 485438e..364d6df 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -67,8 +67,8 @@ void Close() override; void CloseNow() override; aura::WindowTreeHost* AsWindowTreeHost() override; - void ShowWindowWithState(ui::WindowShowState show_state) override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; bool IsVisible() const override; void SetSize(const gfx::Size& size) override; void StackAbove(aura::Window* window) override;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 22a9914..b6fe249 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -514,16 +514,23 @@ return this; } -void DesktopWindowTreeHostX11::ShowWindowWithState( - ui::WindowShowState show_state) { +void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { if (compositor()) SetVisible(true); + if (!IsVisible() || !window_mapped_in_server_) MapWindow(show_state); switch (show_state) { case ui::SHOW_STATE_MAXIMIZED: Maximize(); + if (!restore_bounds.IsEmpty()) { + // Enforce |restored_bounds_in_pixels_| since calling Maximize() could + // have reset it. + restored_bounds_in_pixels_ = ToPixelRect(restore_bounds); + } + break; case ui::SHOW_STATE_MINIMIZED: Minimize(); @@ -536,14 +543,8 @@ } native_widget_delegate_->AsWidget()->SetInitialFocus(show_state); -} -void DesktopWindowTreeHostX11::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - ShowWindowWithState(ui::SHOW_STATE_MAXIMIZED); - // Enforce |restored_bounds_in_pixels_| since calling Maximize() could have - // reset it. - restored_bounds_in_pixels_ = ToPixelRect(restored_bounds); + content_window()->Show(); } bool DesktopWindowTreeHostX11::IsVisible() const { @@ -826,7 +827,7 @@ SetWMSpecState(true, gfx::GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), gfx::GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); if (IsMinimized()) - ShowWindowWithState(ui::SHOW_STATE_NORMAL); + Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); } void DesktopWindowTreeHostX11::Minimize() { @@ -839,7 +840,7 @@ SetWMSpecState(false, gfx::GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), gfx::GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); if (IsMinimized()) - ShowWindowWithState(ui::SHOW_STATE_NORMAL); + Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); } bool DesktopWindowTreeHostX11::IsMaximized() const { @@ -1190,7 +1191,7 @@ } void DesktopWindowTreeHostX11::ShowImpl() { - ShowWindowWithState(ui::SHOW_STATE_NORMAL); + Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); } void DesktopWindowTreeHostX11::HideImpl() {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h index c5e6df7c..eed4039 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -103,8 +103,8 @@ void Close() override; void CloseNow() override; aura::WindowTreeHost* AsWindowTreeHost() override; - void ShowWindowWithState(ui::WindowShowState show_state) override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; bool IsVisible() const override; void SetSize(const gfx::Size& requested_size) override; void StackAbove(aura::Window* window) override;
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 0decc40..b5a27c9 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc
@@ -547,30 +547,20 @@ delete window_; } -void NativeWidgetAura::Show() { - ShowWithWindowState(ui::SHOW_STATE_NORMAL); -} - -void NativeWidgetAura::Hide() { - if (window_) - window_->Hide(); -} - -void NativeWidgetAura::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - SetRestoreBounds(window_, restored_bounds); - ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); -} - -void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { +void NativeWidgetAura::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { if (!window_) return; - if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN) - window_->SetProperty(aura::client::kShowStateKey, state); + if (show_state == ui::SHOW_STATE_MAXIMIZED && !restore_bounds.IsEmpty()) + SetRestoreBounds(window_, restore_bounds); + if (show_state == ui::SHOW_STATE_MAXIMIZED || + show_state == ui::SHOW_STATE_FULLSCREEN) { + window_->SetProperty(aura::client::kShowStateKey, show_state); + } window_->Show(); if (delegate_->CanActivate()) { - if (state != ui::SHOW_STATE_INACTIVE) + if (show_state != ui::SHOW_STATE_INACTIVE) Activate(); // SetInitialFocus() should be always be called, even for // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will @@ -578,15 +568,20 @@ // Activate() might fail if the window is non-activatable. In this case, we // should pass SHOW_STATE_INACTIVE to SetInitialFocus() to stop the initial // focused view from getting focused. See crbug.com/515594 for example. - SetInitialFocus(IsActive() ? state : ui::SHOW_STATE_INACTIVE); + SetInitialFocus(IsActive() ? show_state : ui::SHOW_STATE_INACTIVE); } // On desktop aura, a window is activated first even when it is shown as // minimized. Do the same for consistency. - if (state == ui::SHOW_STATE_MINIMIZED) + if (show_state == ui::SHOW_STATE_MINIMIZED) Minimize(); } +void NativeWidgetAura::Hide() { + if (window_) + window_->Hide(); +} + bool NativeWidgetAura::IsVisible() const { return window_ && window_->IsVisible(); }
diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index 64617ed..f46dab1 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h
@@ -105,10 +105,9 @@ void SetShape(std::unique_ptr<Widget::ShapeRects> shape) override; void Close() override; void CloseNow() override; - void Show() override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; void Hide() override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; - void ShowWithWindowState(ui::WindowShowState state) override; bool IsVisible() const override; void Activate() override; void Deactivate() override;
diff --git a/ui/views/widget/native_widget_mac.h b/ui/views/widget/native_widget_mac.h index 5e757e0f..0ea0533 100644 --- a/ui/views/widget/native_widget_mac.h +++ b/ui/views/widget/native_widget_mac.h
@@ -98,10 +98,9 @@ void SetShape(std::unique_ptr<Widget::ShapeRects> shape) override; void Close() override; void CloseNow() override; - void Show() override; + void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) override; void Hide() override; - void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; - void ShowWithWindowState(ui::WindowShowState state) override; bool IsVisible() const override; void Activate() override; void Deactivate() override;
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm index 4e53a164..36184ec 100644 --- a/ui/views/widget/native_widget_mac.mm +++ b/ui/views/widget/native_widget_mac.mm
@@ -431,27 +431,12 @@ // Note: |this| is deleted here when ownership_ == NATIVE_WIDGET_OWNS_WIDGET. } -void NativeWidgetMac::Show() { - ShowWithWindowState(ui::SHOW_STATE_NORMAL); -} - -void NativeWidgetMac::Hide() { +void NativeWidgetMac::Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) { if (!bridge()) return; - bridge()->SetVisibilityState(BridgedNativeWidget::HIDE_WINDOW); -} - -void NativeWidgetMac::ShowMaximizedWithBounds( - const gfx::Rect& restored_bounds) { - NOTIMPLEMENTED(); -} - -void NativeWidgetMac::ShowWithWindowState(ui::WindowShowState state) { - if (!bridge()) - return; - - switch (state) { + switch (show_state) { case ui::SHOW_STATE_DEFAULT: case ui::SHOW_STATE_NORMAL: case ui::SHOW_STATE_INACTIVE: @@ -466,13 +451,20 @@ break; } bridge()->SetVisibilityState( - state == ui::SHOW_STATE_INACTIVE + show_state == ui::SHOW_STATE_INACTIVE ? BridgedNativeWidget::SHOW_INACTIVE : BridgedNativeWidget::SHOW_AND_ACTIVATE_WINDOW); // Ignore the SetInitialFocus() result. BridgedContentView should get // firstResponder status regardless. - delegate_->SetInitialFocus(state); + delegate_->SetInitialFocus(show_state); +} + +void NativeWidgetMac::Hide() { + if (!bridge()) + return; + + bridge()->SetVisibilityState(BridgedNativeWidget::HIDE_WINDOW); } bool NativeWidgetMac::IsVisible() const {
diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h index a0874dd..f59ae9f 100644 --- a/ui/views/widget/native_widget_private.h +++ b/ui/views/widget/native_widget_private.h
@@ -183,12 +183,9 @@ virtual void SetShape(std::unique_ptr<Widget::ShapeRects> shape) = 0; virtual void Close() = 0; virtual void CloseNow() = 0; - virtual void Show() = 0; + virtual void Show(ui::WindowShowState show_state, + const gfx::Rect& restore_bounds) = 0; virtual void Hide() = 0; - // Invoked if the initial show should maximize the window. |restored_bounds| - // is the bounds of the window when not maximized. - virtual void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) = 0; - virtual void ShowWithWindowState(ui::WindowShowState show_state) = 0; virtual bool IsVisible() const = 0; virtual void Activate() = 0; virtual void Deactivate() = 0;
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 1bc5afc..573adf58 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc
@@ -615,19 +615,20 @@ if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && !initial_restored_bounds_.IsEmpty() && !IsFullscreen()) { - native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); + native_widget_->Show(ui::SHOW_STATE_MAXIMIZED, initial_restored_bounds_); } else { - native_widget_->ShowWithWindowState( - IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : saved_show_state_); + native_widget_->Show( + IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : saved_show_state_, + gfx::Rect()); } // |saved_show_state_| only applies the first time the window is shown. // If we don't reset the value the window may be shown maximized every time // it is subsequently shown after being hidden. saved_show_state_ = ui::SHOW_STATE_NORMAL; } else { - CanActivate() - ? native_widget_->Show() - : native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE); + native_widget_->Show( + CanActivate() ? ui::SHOW_STATE_NORMAL : ui::SHOW_STATE_INACTIVE, + gfx::Rect()); } } @@ -645,7 +646,7 @@ SetBounds(initial_restored_bounds_); saved_show_state_ = ui::SHOW_STATE_NORMAL; } - native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE); + native_widget_->Show(ui::SHOW_STATE_INACTIVE, gfx::Rect()); } void Widget::Activate() {
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc index 595f215b..97097c4 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc
@@ -615,52 +615,57 @@ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); } -void HWNDMessageHandler::Show() { - if (IsWindow(hwnd())) { - if (!(GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_TRANSPARENT) && - !(GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_NOACTIVATE)) { - ShowWindowWithState(ui::SHOW_STATE_NORMAL); - } else { - ShowWindowWithState(ui::SHOW_STATE_INACTIVE); - } - } -} - -void HWNDMessageHandler::ShowWindowWithState(ui::WindowShowState show_state) { - TRACE_EVENT0("views", "HWNDMessageHandler::ShowWindowWithState"); +void HWNDMessageHandler::Show(ui::WindowShowState show_state, + const gfx::Rect& pixel_restore_bounds) { + TRACE_EVENT0("views", "HWNDMessageHandler::Show"); DWORD native_show_state; - switch (show_state) { - case ui::SHOW_STATE_INACTIVE: - native_show_state = SW_SHOWNOACTIVATE; - break; - case ui::SHOW_STATE_MAXIMIZED: - native_show_state = SW_SHOWMAXIMIZED; - break; - case ui::SHOW_STATE_MINIMIZED: - native_show_state = SW_SHOWMINIMIZED; - break; - case ui::SHOW_STATE_NORMAL: - native_show_state = SW_SHOWNORMAL; - break; - case ui::SHOW_STATE_FULLSCREEN: - native_show_state = SW_SHOWNORMAL; - SetFullscreen(true); - break; - default: - native_show_state = delegate_->GetInitialShowState(); - break; - } + if (show_state == ui::SHOW_STATE_MAXIMIZED && + !pixel_restore_bounds.IsEmpty()) { + WINDOWPLACEMENT placement = {0}; + placement.length = sizeof(WINDOWPLACEMENT); + placement.showCmd = SW_SHOWMAXIMIZED; + placement.rcNormalPosition = pixel_restore_bounds.ToRECT(); + SetWindowPlacement(hwnd(), &placement); + native_show_state = SW_SHOWMAXIMIZED; + } else { + switch (show_state) { + case ui::SHOW_STATE_INACTIVE: + native_show_state = SW_SHOWNOACTIVATE; + break; + case ui::SHOW_STATE_MAXIMIZED: + native_show_state = SW_SHOWMAXIMIZED; + break; + case ui::SHOW_STATE_MINIMIZED: + native_show_state = SW_SHOWMINIMIZED; + break; + case ui::SHOW_STATE_NORMAL: + if ((GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_TRANSPARENT) || + (GetWindowLong(hwnd(), GWL_EXSTYLE) & WS_EX_NOACTIVATE)) { + native_show_state = SW_SHOWNOACTIVATE; + } else { + native_show_state = SW_SHOWNORMAL; + } + break; + case ui::SHOW_STATE_FULLSCREEN: + native_show_state = SW_SHOWNORMAL; + SetFullscreen(true); + break; + default: + native_show_state = delegate_->GetInitialShowState(); + break; + } - ShowWindow(hwnd(), native_show_state); - // When launched from certain programs like bash and Windows Live Messenger, - // show_state is set to SW_HIDE, so we need to correct that condition. We - // don't just change show_state to SW_SHOWNORMAL because MSDN says we must - // always first call ShowWindow with the specified value from STARTUPINFO, - // otherwise all future ShowWindow calls will be ignored (!!#@@#!). Instead, - // we call ShowWindow again in this case. - if (native_show_state == SW_HIDE) { - native_show_state = SW_SHOWNORMAL; ShowWindow(hwnd(), native_show_state); + // When launched from certain programs like bash and Windows Live + // Messenger, show_state is set to SW_HIDE, so we need to correct that + // condition. We don't just change show_state to SW_SHOWNORMAL because + // MSDN says we must always first call ShowWindow with the specified + // value from STARTUPINFO, otherwise all future ShowWindow calls will be + // ignored (!!#@@#!). Instead, we call ShowWindow again in this case. + if (native_show_state == SW_HIDE) { + native_show_state = SW_SHOWNORMAL; + ShowWindow(hwnd(), native_show_state); + } } // We need to explicitly activate the window if we've been shown with a state @@ -675,19 +680,6 @@ SetInitialFocus(); } -void HWNDMessageHandler::ShowMaximizedWithBounds(const gfx::Rect& bounds) { - WINDOWPLACEMENT placement = { 0 }; - placement.length = sizeof(WINDOWPLACEMENT); - placement.showCmd = SW_SHOWMAXIMIZED; - placement.rcNormalPosition = bounds.ToRECT(); - SetWindowPlacement(hwnd(), &placement); - - // We need to explicitly activate the window, because if we're opened from a - // desktop shortcut while an existing window is already running it doesn't - // seem to be enough to use SW_SHOWMAXIMIZED to activate the window. - Activate(); -} - void HWNDMessageHandler::Hide() { if (IsWindow(hwnd())) { // NOTE: Be careful not to activate any windows here (for example, calling
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h index 4dc520b..593c3c0 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h
@@ -107,9 +107,10 @@ void StackAbove(HWND other_hwnd); void StackAtTop(); - void Show(); - void ShowWindowWithState(ui::WindowShowState show_state); - void ShowMaximizedWithBounds(const gfx::Rect& bounds); + // Shows the window. If |show_state| is maximized, |pixel_restore_bounds| is + // the bounds to restore the window to when going back to normal. + void Show(ui::WindowShowState show_state, + const gfx::Rect& pixel_restore_bounds); void Hide(); void Maximize();