diff --git a/BUILD.gn b/BUILD.gn index 9429718..a63acc2 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -177,7 +177,7 @@ "//mojo/edk/test:mojo_public_bindings_unittests", "//mojo/edk/test:mojo_public_system_unittests", "//net:net_perftests", - "//services:service_unittests", + "//services:services_unittests", "//services/service_manager/public/cpp", "//storage:storage_unittests", "//third_party/WebKit/Source/platform:blink_platform_unittests",
diff --git a/DEPS b/DEPS index 776f9a86..0c08d76 100644 --- a/DEPS +++ b/DEPS
@@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'fb9c11b49ee4fe6c18703d661dcaee498085c4c5', + 'pdfium_revision': '56e5e67fd2ac582dcfa83821c815a0014a43bd10', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '95d73385835dd1347cacacd1e25efa48938ee90a', + 'catapult_revision': 'cb612d8318470c9725c4f071e17ceacb7d0e07ab', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other.
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 1d7c3e6a..fef3b67 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -669,6 +669,23 @@ "wm/lock_state_observer.h", "wm/lock_window_state.cc", "wm/lock_window_state.h", + "wm/maximize_mode/maximize_mode_backdrop_delegate_impl.cc", + "wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h", + "wm/maximize_mode/maximize_mode_controller.cc", + "wm/maximize_mode/maximize_mode_controller.h", + "wm/maximize_mode/maximize_mode_event_handler.cc", + "wm/maximize_mode/maximize_mode_event_handler.h", + "wm/maximize_mode/maximize_mode_event_handler_aura.cc", + "wm/maximize_mode/maximize_mode_event_handler_aura.h", + "wm/maximize_mode/maximize_mode_window_manager.cc", + "wm/maximize_mode/maximize_mode_window_manager.h", + "wm/maximize_mode/maximize_mode_window_state.cc", + "wm/maximize_mode/maximize_mode_window_state.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h", "wm/mru_window_tracker.cc", "wm/mru_window_tracker.h", "wm/overlay_event_filter.cc", @@ -732,23 +749,6 @@ "wm/system_modal_container_layout_manager.h", "wm/system_wallpaper_controller.cc", "wm/system_wallpaper_controller.h", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h", - "wm/tablet_mode/tablet_mode_backdrop_delegate_impl.cc", - "wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h", - "wm/tablet_mode/tablet_mode_controller.cc", - "wm/tablet_mode/tablet_mode_controller.h", - "wm/tablet_mode/tablet_mode_event_handler.cc", - "wm/tablet_mode/tablet_mode_event_handler.h", - "wm/tablet_mode/tablet_mode_event_handler_aura.cc", - "wm/tablet_mode/tablet_mode_event_handler_aura.h", - "wm/tablet_mode/tablet_mode_window_manager.cc", - "wm/tablet_mode/tablet_mode_window_manager.h", - "wm/tablet_mode/tablet_mode_window_state.cc", - "wm/tablet_mode/tablet_mode_window_state.h", "wm/toplevel_window_event_handler.cc", "wm/toplevel_window_event_handler.h", "wm/video_detector.cc", @@ -923,8 +923,8 @@ sources -= [ "host/ash_window_tree_host_x11.cc", "host/ash_window_tree_host_x11.h", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h", ] } @@ -936,8 +936,8 @@ ] } else { sources -= [ - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc", - "wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h", ] } @@ -1254,6 +1254,8 @@ "wm/container_finder_unittest.cc", "wm/immersive_fullscreen_controller_unittest.cc", "wm/lock_state_controller_unittest.cc", + "wm/maximize_mode/accelerometer_test_data_literals.cc", + "wm/maximize_mode/maximize_mode_window_manager_unittest.cc", "wm/mru_window_tracker_unittest.cc", "wm/overlay_event_filter_unittest.cc", "wm/overview/cleanup_animation_observer_unittest.cc", @@ -1266,8 +1268,6 @@ "wm/session_state_animator_impl_unittest.cc", "wm/stacking_controller_unittest.cc", "wm/system_modal_container_layout_manager_unittest.cc", - "wm/tablet_mode/accelerometer_test_data_literals.cc", - "wm/tablet_mode/tablet_mode_window_manager_unittest.cc", "wm/toplevel_window_event_handler_unittest.cc", "wm/video_detector_unittest.cc", "wm/window_animations_unittest.cc", @@ -1411,7 +1411,7 @@ "wm/lock_layout_manager_unittest.cc", # TODO: investigate failures in mash. http://crbug.com/698092. - "wm/tablet_mode/tablet_mode_controller_unittest.cc", + "wm/maximize_mode/maximize_mode_controller_unittest.cc", # TODO: mash doesn't support CursorManager. http://crbug.com/631103. "wm/resize_shadow_and_cursor_unittest.cc",
diff --git a/ash/accelerators/accelerator_controller_delegate_aura.cc b/ash/accelerators/accelerator_controller_delegate_aura.cc index 43fcff0d..24633933 100644 --- a/ash/accelerators/accelerator_controller_delegate_aura.cc +++ b/ash/accelerators/accelerator_controller_delegate_aura.cc
@@ -23,6 +23,7 @@ #include "ash/system/system_notifier.h" #include "ash/touch/touch_hud_debug.h" #include "ash/utility/screenshot_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/power_button_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h"
diff --git a/ash/accelerators/debug_commands.cc b/ash/accelerators/debug_commands.cc index b2130138..611ac23 100644 --- a/ash/accelerators/debug_commands.cc +++ b/ash/accelerators/debug_commands.cc
@@ -13,7 +13,7 @@ #include "ash/system/toast/toast_manager.h" #include "ash/wallpaper/wallpaper_controller.h" #include "ash/wallpaper/wallpaper_delegate.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/widget_finder.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" @@ -146,9 +146,9 @@ } void HandleToggleTouchView() { - TabletModeController* controller = Shell::Get()->tablet_mode_controller(); - controller->EnableTabletModeWindowManager( - !controller->IsTabletModeWindowManagerEnabled()); + MaximizeModeController* controller = Shell::Get()->maximize_mode_controller(); + controller->EnableMaximizeModeWindowManager( + !controller->IsMaximizeModeWindowManagerEnabled()); } void HandleTriggerCrash() {
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc index 6c787574..258a88d4 100644 --- a/ash/app_list/app_list_presenter_delegate.cc +++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -15,7 +15,7 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_port.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm_window.h" #include "base/command_line.h" #include "ui/app_list/app_list_constants.h"
diff --git a/ash/aura/shell_port_classic.cc b/ash/aura/shell_port_classic.cc index d27eb274..c42a9f4 100644 --- a/ash/aura/shell_port_classic.cc +++ b/ash/aura/shell_port_classic.cc
@@ -26,10 +26,10 @@ #include "ash/touch/touch_uma.h" #include "ash/virtual_keyboard_controller.h" #include "ash/wm/drag_window_resizer.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" -#include "ash/wm/tablet_mode/tablet_mode_event_handler_aura.h" #include "ash/wm/window_cycle_event_filter_aura.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace_event_handler_aura.h" @@ -42,12 +42,12 @@ #include "ui/display/types/native_display_delegate.h" #if defined(USE_X11) -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" #include "ui/display/manager/chromeos/x11/native_display_delegate_x11.h" #endif #if defined(USE_OZONE) -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" #include "ui/display/types/native_display_delegate.h" #include "ui/ozone/public/ozone_platform.h" #endif @@ -185,9 +185,9 @@ return base::MakeUnique<WindowCycleEventFilterAura>(); } -std::unique_ptr<wm::TabletModeEventHandler> -ShellPortClassic::CreateTabletModeEventHandler() { - return base::WrapUnique(new wm::TabletModeEventHandlerAura); +std::unique_ptr<wm::MaximizeModeEventHandler> +ShellPortClassic::CreateMaximizeModeEventHandler() { + return base::WrapUnique(new wm::MaximizeModeEventHandlerAura); } std::unique_ptr<WorkspaceEventHandler>
diff --git a/ash/aura/shell_port_classic.h b/ash/aura/shell_port_classic.h index 2143ee8d..a9843982 100644 --- a/ash/aura/shell_port_classic.h +++ b/ash/aura/shell_port_classic.h
@@ -62,7 +62,7 @@ wm::WindowState* window_state) override; std::unique_ptr<WindowCycleEventFilter> CreateWindowCycleEventFilter() override; - std::unique_ptr<wm::TabletModeEventHandler> CreateTabletModeEventHandler() + std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() override; std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( aura::Window* workspace_window) override;
diff --git a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc index a9611a3f..90df6ec7 100644 --- a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc +++ b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
@@ -20,7 +20,7 @@ #include "ash/test/screen_orientation_controller_test_api.h" #include "ash/test/test_shell_delegate.h" #include "ash/test/test_system_tray_delegate.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm_window.h" #include "base/command_line.h" @@ -56,8 +56,9 @@ return info; } -void EnableTabletMode(bool enable) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(enable); +void EnableMaximizeMode(bool enable) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + enable); } bool RotationLocked() { @@ -359,7 +360,7 @@ // Tests that accelerometer readings in each of the screen angles will trigger a // rotation of the internal display. TEST_F(ScreenOrientationControllerTest, DisplayRotation) { - EnableTabletMode(true); + EnableMaximizeMode(true); // Now test rotating in all directions. TriggerLidUpdate(gfx::Vector3dF(-kMeanGravity, 0.0f, 0.0f)); EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); @@ -374,7 +375,7 @@ // Tests that low angles are ignored by the accelerometer (i.e. when the device // is almost laying flat). TEST_F(ScreenOrientationControllerTest, RotationIgnoresLowAngles) { - EnableTabletMode(true); + EnableMaximizeMode(true); TriggerLidUpdate(gfx::Vector3dF(0.0f, -kMeanGravity, -kMeanGravity)); EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); TriggerLidUpdate(gfx::Vector3dF(-2.0f, 0.0f, -kMeanGravity)); @@ -390,7 +391,7 @@ // Tests that the display will stick to the current orientation beyond the // halfway point, preventing frequent updates back and forth. TEST_F(ScreenOrientationControllerTest, RotationSticky) { - EnableTabletMode(true); + EnableMaximizeMode(true); gfx::Vector3dF gravity(0.0f, -kMeanGravity, 0.0f); TriggerLidUpdate(gravity); EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); @@ -422,7 +423,7 @@ // Tests that the display will stick to its current orientation when the // rotation lock has been set. TEST_F(ScreenOrientationControllerTest, RotationLockPreventsRotation) { - EnableTabletMode(true); + EnableMaximizeMode(true); SetUserRotationLocked(true); // Turn past the threshold for rotation. @@ -443,7 +444,7 @@ // Tests that the screen rotation notifications are suppressed when // triggered by the accelerometer. TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) { - EnableTabletMode(true); + EnableMaximizeMode(true); Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing( true); display::test::DisplayManagerTestApi(display_manager()) @@ -456,7 +457,7 @@ EXPECT_FALSE(message_center->HasPopupNotifications()); // Make sure notifications are still displayed when - // adjusting the screen rotation directly when in tablet mode + // adjusting the screen rotation directly when in maximize mode ASSERT_NE(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation()); SetInternalDisplayRotation(display::Display::ROTATE_270); SetSystemRotationLocked(false); @@ -471,7 +472,7 @@ EXPECT_FALSE(message_center->HasPopupNotifications()); // Make sure notifications are blocked when adjusting the screen rotation - // via the accelerometer while in tablet mode + // via the accelerometer while in maximize mode // Rotate the screen 90 degrees ASSERT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation()); TriggerLidUpdate(gfx::Vector3dF(-kMeanGravity, 0.0f, 0.0f)); @@ -480,8 +481,8 @@ EXPECT_FALSE(message_center->HasPopupNotifications()); // Make sure notifications are still displayed when - // adjusting the screen rotation directly when not in tablet mode - EnableTabletMode(false); + // adjusting the screen rotation directly when not in maximize mode + EnableMaximizeMode(false); // Reset the screen rotation. SetInternalDisplayRotation(display::Display::ROTATE_0); // Clear all notifications @@ -497,18 +498,18 @@ } // Tests that if a user has set a display rotation that it is restored upon -// exiting tablet mode. +// exiting maximize mode. TEST_F(ScreenOrientationControllerTest, ResetUserRotationUponExit) { display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); SetInternalDisplayRotation(display::Display::ROTATE_90); - EnableTabletMode(true); + EnableMaximizeMode(true); TriggerLidUpdate(gfx::Vector3dF(0.0f, kMeanGravity, 0.0f)); EXPECT_EQ(display::Display::ROTATE_180, GetCurrentInternalDisplayRotation()); - EnableTabletMode(false); + EnableMaximizeMode(false); EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); } @@ -516,22 +517,22 @@ // becomes locked. TEST_F(ScreenOrientationControllerTest, NonAccelerometerRotationChangesLockRotation) { - EnableTabletMode(true); + EnableMaximizeMode(true); ASSERT_FALSE(RotationLocked()); SetInternalDisplayRotation(display::Display::ROTATE_270); EXPECT_TRUE(RotationLocked()); } // Tests that if a user changes the display rotation, while rotation is locked, -// that the updates are recorded. Upon exiting tablet mode the latest user +// that the updates are recorded. Upon exiting maximize mode the latest user // rotation should be applied. TEST_F(ScreenOrientationControllerTest, UpdateUserRotationWhileRotationLocked) { - EnableTabletMode(true); + EnableMaximizeMode(true); SetInternalDisplayRotation(display::Display::ROTATE_270); // User sets rotation to the same rotation that the display was at when - // tablet mode was activated. + // maximize mode was activated. SetInternalDisplayRotation(display::Display::ROTATE_0); - EnableTabletMode(false); + EnableMaximizeMode(false); EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); } @@ -540,7 +541,7 @@ TEST_F(ScreenOrientationControllerTest, LandscapeOrientationAllowsRotation) { std::unique_ptr<content::WebContents> content(CreateWebContents()); std::unique_ptr<aura::Window> focus_window(CreateAppWindowInShellWithId(0)); - EnableTabletMode(true); + EnableMaximizeMode(true); AttachAndActivateWebContents(content.get(), focus_window.get()); delegate()->Lock(content.get(), blink::kWebScreenOrientationLockLandscape); @@ -563,7 +564,7 @@ TEST_F(ScreenOrientationControllerTest, PortraitOrientationAllowsRotation) { std::unique_ptr<content::WebContents> content(CreateWebContents()); std::unique_ptr<aura::Window> focus_window(CreateAppWindowInShellWithId(0)); - EnableTabletMode(true); + EnableMaximizeMode(true); AttachAndActivateWebContents(content.get(), focus_window.get()); delegate()->Lock(content.get(), blink::kWebScreenOrientationLockPortrait); @@ -586,7 +587,7 @@ TEST_F(ScreenOrientationControllerTest, OrientationLockDisallowsRotation) { std::unique_ptr<content::WebContents> content(CreateWebContents()); std::unique_ptr<aura::Window> focus_window(CreateAppWindowInShellWithId(0)); - EnableTabletMode(true); + EnableMaximizeMode(true); AttachAndActivateWebContents(content.get(), focus_window.get()); delegate()->Lock(content.get(), @@ -608,7 +609,7 @@ TEST_F(ScreenOrientationControllerTest, UserRotationLockDisallowsRotation) { std::unique_ptr<content::WebContents> content(CreateWebContents()); std::unique_ptr<aura::Window> focus_window(CreateAppWindowInShellWithId(0)); - EnableTabletMode(true); + EnableMaximizeMode(true); AttachAndActivateWebContents(content.get(), focus_window.get()); delegate()->Lock(content.get(), blink::kWebScreenOrientationLockLandscape); @@ -623,7 +624,7 @@ EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); } -// Tests that when TabletMode is triggered before the internal display is +// Tests that when MaximizeMode is triggered before the internal display is // ready, that ScreenOrientationController still begins listening to events, // which require an internal display to be acted upon. TEST_F(ScreenOrientationControllerTest, InternalDisplayNotAvailableAtStartup) { @@ -633,7 +634,7 @@ int64_t internal_display_id = display::Display::InternalDisplayId(); display::Display::SetInternalDisplayId(display::kInvalidDisplayId); - EnableTabletMode(true); + EnableMaximizeMode(true); // Should not crash, even though there is no internal display. SetDisplayRotationById(internal_display_id, display::Display::ROTATE_180);
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 3988e02..11990bc 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -18,7 +18,7 @@ #include "ash/test/ash_test_base.h" #include "ash/test/mirror_window_test_api.h" #include "ash/test/screen_orientation_controller_test_api.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "base/command_line.h" @@ -3027,7 +3027,8 @@ EXPECT_EQ(0, test_observer.countAndReset()); // Just enabling will not save the lock. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_EQ(1, test_observer.countAndReset()); EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation()); @@ -3069,13 +3070,15 @@ EXPECT_EQ(0, test_observer.countAndReset()); // Exit tablet mode reset to clamshell's rotation, which is 90. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_EQ(1, test_observer.countAndReset()); EXPECT_EQ(display::Display::ROTATE_90, screen->GetPrimaryDisplay().rotation()); // Activate Any. wm::ActivateWindow(window_a); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_EQ(1, test_observer.countAndReset()); // Entering with active ANY will lock again to landscape. EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation()); @@ -3120,7 +3123,8 @@ display::Screen* screen = display::Screen::GetScreen(); // Just enabling will not save the lock. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); orientation_controller->LockOrientationForWindow( window, blink::kWebScreenOrientationLockPortrait, @@ -3167,7 +3171,8 @@ ScreenOrientationController::LockCompletionBehavior::None); } wm::ActivateWindow(window_a); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); orientation_controller->OnAccelerometerUpdated(portrait_primary);
diff --git a/ash/display/screen_orientation_controller_chromeos.cc b/ash/display/screen_orientation_controller_chromeos.cc index cba27a9e..facaac0 100644 --- a/ash/display/screen_orientation_controller_chromeos.cc +++ b/ash/display/screen_orientation_controller_chromeos.cc
@@ -9,8 +9,8 @@ #include "ash/shared/app_types.h" #include "ash/shell.h" #include "ash/shell_port.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/mru_window_tracker.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "base/auto_reset.h" #include "base/command_line.h" @@ -216,8 +216,8 @@ bool ScreenOrientationController::ScreenOrientationProviderSupported() const { return Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); } void ScreenOrientationController::ToggleUserRotationLock() { @@ -303,8 +303,8 @@ } } -void ScreenOrientationController::OnTabletModeStarted() { - // Do not exit early, as the internal display can be determined after Tablet +void ScreenOrientationController::OnMaximizeModeStarted() { + // Do not exit early, as the internal display can be determined after Maximize // Mode has started. (chrome-os-partner:38796) // Always start observing. if (display::Display::HasInternalDisplay()) { @@ -325,7 +325,7 @@ observer.OnUserRotationLockChanged(); } -void ScreenOrientationController::OnTabletModeEnding() { +void ScreenOrientationController::OnMaximizeModeEnding() { chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); ShellPort::Get()->RemoveDisplayObserver(this); if (!display::Display::HasInternalDisplay())
diff --git a/ash/display/screen_orientation_controller_chromeos.h b/ash/display/screen_orientation_controller_chromeos.h index 4248a8a..b64d4c1 100644 --- a/ash/display/screen_orientation_controller_chromeos.h +++ b/ash/display/screen_orientation_controller_chromeos.h
@@ -116,8 +116,8 @@ void OnDisplayConfigurationChanged() override; // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnding() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnding() override; private: friend class test::ScreenOrientationControllerTestApi; @@ -214,7 +214,7 @@ blink::WebScreenOrientationLockType rotation_locked_orientation_; // The rotation of the display set by the user. This rotation will be - // restored upon exiting tablet mode. + // restored upon exiting maximize mode. display::Display::Rotation user_rotation_; // The orientation of the device locked by the user.
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc index d1c152ad..4a1629e 100644 --- a/ash/display/window_tree_host_manager.cc +++ b/ash/display/window_tree_host_manager.cc
@@ -515,7 +515,7 @@ // Do not move the cursor if the cursor's location did not change. This avoids // moving (and showing) the cursor: // - At startup. - // - When the device is rotated in tablet mode. + // - When the device is rotated in maximized mode. // |cursor_display_id_for_restore_| is checked to ensure that the cursor is // moved when the cursor's native position does not change but the display // that it is on has changed. This occurs when swapping the primary display.
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view.cc b/ash/frame/caption_buttons/frame_caption_button_container_view.cc index c8e5fe0..0169b201aa 100644 --- a/ash/frame/caption_buttons/frame_caption_button_container_view.cc +++ b/ash/frame/caption_buttons/frame_caption_button_container_view.cc
@@ -11,7 +11,7 @@ #include "ash/frame/caption_buttons/frame_size_button.h" #include "ash/shell.h" #include "ash/shell_port.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" @@ -35,11 +35,11 @@ // Duration of the animation of the alpha of |size_button_|. const int kAlphaAnimationDurationMs = 250; -// Delay during |tablet_mode_animation_| hide to wait before beginning to +// Delay during |maximize_mode_animation_| hide to wait before beginning to // animate the position of |minimize_button_|. const int kHidePositionDelayMs = 100; -// Duration of |tablet_mode_animation_| hiding. +// Duration of |maximize_mode_animation_| hiding. // Hiding size button 250 // |------------------------| // Delay 100 Slide minimize button 500 @@ -47,39 +47,39 @@ const int kHideAnimationDurationMs = kHidePositionDelayMs + kPositionAnimationDurationMs; -// Delay during |tablet_mode_animation_| show to wait before beginning to +// Delay during |maximize_mode_animation_| show to wait before beginning to // animate the alpha of |size_button_|. const int kShowAnimationAlphaDelayMs = 100; -// Duration of |tablet_mode_animation_| showing. +// Duration of |maximize_mode_animation_| showing. // Slide minimize button 500 // |-------------------------------------------------| // Delay 100 Show size button 250 // |---------|-----------------------| const int kShowAnimationDurationMs = kPositionAnimationDurationMs; -// Value of |tablet_mode_animation_| showing to begin animating alpha of +// Value of |maximize_mode_animation_| showing to begin animating alpha of // |size_button_|. float SizeButtonShowStartValue() { return static_cast<float>(kShowAnimationAlphaDelayMs) / kShowAnimationDurationMs; } -// Amount of |tablet_mode_animation_| showing to animate the alpha of +// Amount of |maximize_mode_animation_| showing to animate the alpha of // |size_button_|. float SizeButtonShowDuration() { return static_cast<float>(kAlphaAnimationDurationMs) / kShowAnimationDurationMs; } -// Amount of |tablet_mode_animation_| hiding to animate the alpha of +// Amount of |maximize_mode_animation_| hiding to animate the alpha of // |size_button_|. float SizeButtonHideDuration() { return static_cast<float>(kAlphaAnimationDurationMs) / kHideAnimationDurationMs; } -// Value of |tablet_mode_animation_| hiding to begin animating the position of +// Value of |maximize_mode_animation_| hiding to begin animating the position of // |minimize_button_|. float HidePositionStartValue() { return 1.0f - @@ -115,12 +115,12 @@ size_button_(NULL), close_button_(NULL) { bool size_button_visibility = ShouldSizeButtonBeVisible(); - tablet_mode_animation_.reset(new gfx::SlideAnimation(this)); - tablet_mode_animation_->SetTweenType(gfx::Tween::LINEAR); + maximize_mode_animation_.reset(new gfx::SlideAnimation(this)); + maximize_mode_animation_->SetTweenType(gfx::Tween::LINEAR); // Ensure animation tracks visibility of size button. if (size_button_visibility) - tablet_mode_animation_->Reset(1.0f); + maximize_mode_animation_->Reset(1.0f); // Insert the buttons left to right. minimize_button_ = new FrameCaptionButton(this, CAPTION_BUTTON_ICON_MINIMIZE); @@ -144,7 +144,7 @@ FrameCaptionButtonContainerView::~FrameCaptionButtonContainerView() {} void FrameCaptionButtonContainerView::TestApi::EndAnimations() { - container_view_->tablet_mode_animation_->End(); + container_view_->maximize_mode_animation_->End(); } void FrameCaptionButtonContainerView::SetButtonImage( @@ -196,11 +196,11 @@ bool visible = ShouldSizeButtonBeVisible(); if (visible) { size_button_->SetVisible(true); - tablet_mode_animation_->SetSlideDuration(kShowAnimationDurationMs); - tablet_mode_animation_->Show(); + maximize_mode_animation_->SetSlideDuration(kShowAnimationDurationMs); + maximize_mode_animation_->Show(); } else { - tablet_mode_animation_->SetSlideDuration(kHideAnimationDurationMs); - tablet_mode_animation_->Hide(); + maximize_mode_animation_->SetSlideDuration(kHideAnimationDurationMs); + maximize_mode_animation_->Hide(); } } @@ -231,8 +231,8 @@ child->SetBounds(x, 0, size.width(), size.height()); x += size.width(); } - if (tablet_mode_animation_->is_animating()) { - AnimationProgressed(tablet_mode_animation_.get()); + if (maximize_mode_animation_->is_animating()) { + AnimationProgressed(maximize_mode_animation_.get()); } } @@ -245,7 +245,7 @@ // Ensure that position is calculated at least once. AnimationProgressed(animation); - double current_value = tablet_mode_animation_->GetCurrentValue(); + double current_value = maximize_mode_animation_->GetCurrentValue(); if (current_value == 0.0) { size_button_->SetVisible(false); PreferredSizeChanged(); @@ -257,7 +257,7 @@ double current_value = animation->GetCurrentValue(); int size_alpha = 0; int minimize_x = 0; - if (tablet_mode_animation_->IsShowing()) { + if (maximize_mode_animation_->IsShowing()) { double scaled_value = CapAnimationValue((current_value - SizeButtonShowStartValue()) / SizeButtonShowDuration()); @@ -308,8 +308,8 @@ bool FrameCaptionButtonContainerView::ShouldSizeButtonBeVisible() const { return !Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled() && + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled() && frame_->widget_delegate()->CanMaximize(); }
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view.h b/ash/frame/caption_buttons/frame_caption_button_container_view.h index 7471893..93bd98b 100644 --- a/ash/frame/caption_buttons/frame_caption_button_container_view.h +++ b/ash/frame/caption_buttons/frame_caption_button_container_view.h
@@ -88,7 +88,7 @@ int NonClientHitTest(const gfx::Point& point) const; // Updates the size button's visibility based on whether |frame_| can be - // maximized and if tablet mode is enabled. A parent view should relayout + // maximized and if maximize mode is enabled. A parent view should relayout // to reflect the change in visibility. void UpdateSizeButtonVisibility(); @@ -115,7 +115,7 @@ CaptionButtonIcon icon, Animate animate); - // Returns true if tablet mode is not enabled, and |frame_| widget delegate + // Returns true if maximize mode is not enabled, and |frame_| widget delegate // can be maximized. bool ShouldSizeButtonBeVisible() const; @@ -148,7 +148,7 @@ // Animation that affects the position of |minimize_button_| and the // visibility of |size_button_|. - std::unique_ptr<gfx::SlideAnimation> tablet_mode_animation_; + std::unique_ptr<gfx::SlideAnimation> maximize_mode_animation_; DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); };
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc b/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc index e2f2528..4b4e5e28 100644 --- a/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc +++ b/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc
@@ -10,7 +10,7 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -165,7 +165,8 @@ // Hidden size button should result in minimize button animating to the // right. The size button should not be visible, but should not have moved. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); container.UpdateSizeButtonVisibility(); test.EndAnimations(); // Parent needs to layout in response to size change. @@ -184,7 +185,8 @@ // Revealing the size button should cause the minimize button to return to its // original position. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); container.UpdateSizeButtonVisibility(); // Calling code needs to layout in response to size change. container.Layout();
diff --git a/ash/frame/custom_frame_view_ash_unittest.cc b/ash/frame/custom_frame_view_ash_unittest.cc index 84b4508..0d797e7 100644 --- a/ash/frame/custom_frame_view_ash_unittest.cc +++ b/ash/frame/custom_frame_view_ash_unittest.cc
@@ -13,7 +13,7 @@ #include "ash/shell_port.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_session_state_delegate.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_unittest_util.h" @@ -202,7 +202,7 @@ EXPECT_FALSE(custom_frame_view->GetAvatarIconViewForTest()); } -// The visibility of the size button is updated when tablet mode is toggled. +// The visibility of the size button is updated when maximize mode is toggled. // Verify that the layout of the HeaderView is updated for the size button's // new visibility. TEST_F(CustomFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) { @@ -211,12 +211,14 @@ const gfx::Rect initial = delegate->GetFrameCaptionButtonContainerViewBounds(); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); delegate->EndFrameCaptionButtonContainerViewAnimations(); - const gfx::Rect tablet_mode_bounds = + const gfx::Rect maximize_mode_bounds = delegate->GetFrameCaptionButtonContainerViewBounds(); - EXPECT_GT(initial.width(), tablet_mode_bounds.width()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + EXPECT_GT(initial.width(), maximize_mode_bounds.width()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); delegate->EndFrameCaptionButtonContainerViewAnimations(); const gfx::Rect after_restore = delegate->GetFrameCaptionButtonContainerViewBounds();
diff --git a/ash/frame/header_view.cc b/ash/frame/header_view.cc index d8d1065..c59c577 100644 --- a/ash/frame/header_view.cc +++ b/ash/frame/header_view.cc
@@ -146,12 +146,12 @@ caption_button_container_->SetVisible(true); } -void HeaderView::OnTabletModeStarted() { +void HeaderView::OnMaximizeModeStarted() { caption_button_container_->UpdateSizeButtonVisibility(); parent()->Layout(); } -void HeaderView::OnTabletModeEnded() { +void HeaderView::OnMaximizeModeEnded() { caption_button_container_->UpdateSizeButtonVisibility(); parent()->Layout(); }
diff --git a/ash/frame/header_view.h b/ash/frame/header_view.h index 70c6016c..4d59fedc 100644 --- a/ash/frame/header_view.h +++ b/ash/frame/header_view.h
@@ -74,8 +74,8 @@ // ShellObserver: void OnOverviewModeStarting() override; void OnOverviewModeEnded() override; - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; FrameCaptionButtonContainerView* caption_button_container() { return caption_button_container_;
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index ac26b52f..7107e989 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -5,6 +5,7 @@ #include "ash/login/ui/lock_contents_view.h" #include "ash/login/lock_screen_controller.h" +#include "ash/public/interfaces/user_info.mojom.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "base/strings/utf_string_conversions.h" @@ -42,7 +43,7 @@ const mojom::UserSession* const user_session = Shell::Get()->session_controller()->GetUserSession(user_index); Shell::Get()->lock_screen_controller()->AuthenticateUser( - user_session->account_id, std::string(), + user_session->user_info->account_id, std::string(), false /* authenticated_by_pin */); }
diff --git a/ash/metrics/pointer_metrics_recorder.cc b/ash/metrics/pointer_metrics_recorder.cc index 39584bc2..65d6f54 100644 --- a/ash/metrics/pointer_metrics_recorder.cc +++ b/ash/metrics/pointer_metrics_recorder.cc
@@ -7,7 +7,7 @@ #include "ash/shared/app_types.h" #include "ash/shell.h" #include "ash/shell_port.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm_window.h" #include "base/metrics/histogram_macros.h" #include "ui/events/event_constants.h" @@ -47,8 +47,8 @@ void RecordUMA(ui::EventPointerType type, views::Widget* target) { DownEventFormFactor form_factor = DownEventFormFactor::CLAMSHELL; if (Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()) { + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()) { form_factor = DownEventFormFactor::TOUCH_VIEW; } UMA_HISTOGRAM_ENUMERATION(
diff --git a/ash/metrics/pointer_metrics_recorder_unittest.cc b/ash/metrics/pointer_metrics_recorder_unittest.cc index 5f91823..4a8212ef 100644 --- a/ash/metrics/pointer_metrics_recorder_unittest.cc +++ b/ash/metrics/pointer_metrics_recorder_unittest.cc
@@ -8,7 +8,7 @@ #include "ash/shared/app_types.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm_window.h" #include "base/test/histogram_tester.h" #include "ui/events/event.h" @@ -134,14 +134,16 @@ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE), base::TimeTicks()); - // Enable tablet mode - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + // Enable maximize mode + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); pointer_metrics_recorder_->OnPointerEventObserved(pointer_event, gfx::Point(), target.get()); histogram_tester_->ExpectBucketCount(kFormFactorHistogramName, 1, 1); - // Disable tablet mode - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + // Disable maximize mode + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); pointer_metrics_recorder_->OnPointerEventObserved(pointer_event, gfx::Point(), target.get()); histogram_tester_->ExpectBucketCount(kFormFactorHistogramName, 0, 1);
diff --git a/ash/mojo_interface_factory.cc b/ash/mojo_interface_factory.cc index 15586f2..c8eab24b 100644 --- a/ash/mojo_interface_factory.cc +++ b/ash/mojo_interface_factory.cc
@@ -21,7 +21,7 @@ #include "ash/system/tray/system_tray_controller.h" #include "ash/tray_action/tray_action.h" #include "ash/wallpaper/wallpaper_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/bind.h" #include "base/single_thread_task_runner.h" #include "services/service_manager/public/cpp/bind_source_info.h" @@ -102,7 +102,7 @@ void BindTouchViewRequestOnMainThread( const service_manager::BindSourceInfo& source_info, mojom::TouchViewManagerRequest request) { - Shell::Get()->tablet_mode_controller()->BindRequest(std::move(request)); + Shell::Get()->maximize_mode_controller()->BindRequest(std::move(request)); } void BindTrayActionRequestOnMainThread(
diff --git a/ash/mus/bridge/shell_port_mash.cc b/ash/mus/bridge/shell_port_mash.cc index cdca83b5..191ad69 100644 --- a/ash/mus/bridge/shell_port_mash.cc +++ b/ash/mus/bridge/shell_port_mash.cc
@@ -41,11 +41,11 @@ #include "ash/virtual_keyboard_controller.h" #include "ash/wallpaper/wallpaper_delegate.h" #include "ash/wm/drag_window_resizer.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" #include "ash/wm/mru_window_tracker.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" -#include "ash/wm/tablet_mode/tablet_mode_event_handler.h" -#include "ash/wm/tablet_mode/tablet_mode_event_handler_aura.h" #include "ash/wm/window_cycle_event_filter.h" #include "ash/wm/window_cycle_event_filter_aura.h" #include "ash/wm/window_resizer.h" @@ -371,10 +371,10 @@ return nullptr; } -std::unique_ptr<wm::TabletModeEventHandler> -ShellPortMash::CreateTabletModeEventHandler() { +std::unique_ptr<wm::MaximizeModeEventHandler> +ShellPortMash::CreateMaximizeModeEventHandler() { if (GetAshConfig() == Config::MUS) - return base::MakeUnique<wm::TabletModeEventHandlerAura>(); + return base::MakeUnique<wm::MaximizeModeEventHandlerAura>(); // TODO: need support for window manager to get events before client: // http://crbug.com/624157.
diff --git a/ash/mus/bridge/shell_port_mash.h b/ash/mus/bridge/shell_port_mash.h index be47cb2..a6b7b2f 100644 --- a/ash/mus/bridge/shell_port_mash.h +++ b/ash/mus/bridge/shell_port_mash.h
@@ -90,7 +90,7 @@ wm::WindowState* window_state) override; std::unique_ptr<WindowCycleEventFilter> CreateWindowCycleEventFilter() override; - std::unique_ptr<wm::TabletModeEventHandler> CreateTabletModeEventHandler() + std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() override; std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( aura::Window* workspace_window) override;
diff --git a/ash/mus/non_client_frame_controller.cc b/ash/mus/non_client_frame_controller.cc index 8767bf14..3e9d184 100644 --- a/ash/mus/non_client_frame_controller.cc +++ b/ash/mus/non_client_frame_controller.cc
@@ -22,7 +22,6 @@ #include "ash/wm/panels/panel_frame_view.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" -#include "ash/wm_window.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" @@ -40,6 +39,7 @@ #include "ui/gfx/geometry/vector2d.h" #include "ui/views/widget/native_widget_aura.h" #include "ui/views/widget/widget.h" +#include "ui/wm/core/coordinate_conversion.h" DECLARE_UI_CLASS_PROPERTY_TYPE(ash::mus::NonClientFrameController*); @@ -120,8 +120,8 @@ // DCHECK is to ensure when parent changes this code is updated. // http://crbug.com/640392. DCHECK_EQ(frame_window_->parent(), title_area_window->parent()); - result.push_back( - WmWindow::Get(title_area_window)->ConvertRectToScreen(visible_bounds)); + ::wm::ConvertRectToScreen(title_area_window, &visible_bounds); + result.push_back(visible_bounds); return result; } @@ -263,8 +263,8 @@ DISALLOW_COPY_AND_ASSIGN(ClientViewMus); }; -// Returns the frame insets to use when ShouldUseExtendedHitRegion() returns -// true. +// Returns the frame insets to use when ShouldUseExtendedHitRegionForWindow() +// returns true. gfx::Insets GetExtendedHitRegion() { return gfx::Insets(kResizeOutsideBoundsSize, kResizeOutsideBoundsSize, kResizeOutsideBoundsSize, kResizeOutsideBoundsSize); @@ -333,10 +333,9 @@ layer->SetColor(SK_ColorTRANSPARENT); layer->SetFillsBoundsOpaquely(true); - WmWindow* wm_window = WmWindow::Get(window_); const gfx::Insets extended_hit_region = - wm_window->ShouldUseExtendedHitRegion() ? GetExtendedHitRegion() - : gfx::Insets(); + wm::ShouldUseExtendedHitRegionForWindow(window_) ? GetExtendedHitRegion() + : gfx::Insets(); window_manager_client_->SetExtendedHitArea(window_, extended_hit_region); aura::client::GetTransientWindowClient()->AddObserver(this);
diff --git a/ash/public/interfaces/BUILD.gn b/ash/public/interfaces/BUILD.gn index 3784b9c..03027d4 100644 --- a/ash/public/interfaces/BUILD.gn +++ b/ash/public/interfaces/BUILD.gn
@@ -27,6 +27,7 @@ "touch_view.mojom", "tray_action.mojom", "update.mojom", + "user_info.mojom", "volume.mojom", "vpn_list.mojom", "wallpaper.mojom",
diff --git a/ash/public/interfaces/session_controller.mojom b/ash/public/interfaces/session_controller.mojom index 246b2ba9..4e902cd 100644 --- a/ash/public/interfaces/session_controller.mojom +++ b/ash/public/interfaces/session_controller.mojom
@@ -4,8 +4,8 @@ module ash.mojom; +import "ash/public/interfaces/user_info.mojom"; import "components/signin/public/interfaces/account_id.mojom"; -import "ui/gfx/image/mojo/image.mojom"; // Matches session_manager::SessionState. enum SessionState { @@ -37,34 +37,6 @@ LOGIN_SECONDARY, }; -// Matches user_manager::UserType. -enum UserType { - // Regular user, has a user name and password. - REGULAR, - - // Guest user, logs in without authentication. - GUEST, - - // Public account user, logs in without authentication. Available only if - // enabled through policy. - PUBLIC_ACCOUNT, - - // Supervised user, logs in only with local authentication. - SUPERVISED, - - // Kiosk app robot, logs in without authentication. - KIOSK, - - // Child user, with supervised options. - CHILD, - - // Android app in kiosk mode, logs in without authentication. - ARC_KIOSK, - - // Active Directory user. Authenticates against Active Directory server. - ACTIVE_DIRECTORY, -}; - // Matches ash::CycleUserDirection. enum CycleUserDirection { NEXT, // Cycle to the next user. @@ -80,11 +52,9 @@ // and incremented by one for each subsequent user session. uint32 session_id; - UserType type; - signin.mojom.AccountId account_id; - string display_name; - string display_email; - gfx.mojom.ImageSkia avatar; + // Contains general user information state, like the account id, display name, + // and avatar. + UserInfo user_info; // For supervised users only, the email address of the custodian account. // Empty for non-supervised users. Available after profile is loaded.
diff --git a/ash/public/interfaces/session_controller.typemap b/ash/public/interfaces/session_controller.typemap index 67592a2..013e443 100644 --- a/ash/public/interfaces/session_controller.typemap +++ b/ash/public/interfaces/session_controller.typemap
@@ -6,16 +6,13 @@ public_headers = [ "//ash/public/cpp/session_types.h", "//components/session_manager/session_manager_types.h", - "//components/user_manager/user_type.h", ] traits_headers = [ "//ash/public/interfaces/session_controller_traits.h" ] public_deps = [ "//components/session_manager:base", - "//components/user_manager", ] type_mappings = [ "ash.mojom.AddUserSessionPolicy=ash::AddUserSessionPolicy", "ash.mojom.CycleUserDirection=ash::CycleUserDirection", "ash.mojom.SessionState=session_manager::SessionState", - "ash.mojom.UserType=user_manager::UserType", ]
diff --git a/ash/public/interfaces/session_controller_traits.h b/ash/public/interfaces/session_controller_traits.h index b582ff4..ea37ab7 100644 --- a/ash/public/interfaces/session_controller_traits.h +++ b/ash/public/interfaces/session_controller_traits.h
@@ -8,7 +8,6 @@ #include "ash/public/cpp/session_types.h" #include "ash/public/interfaces/session_controller.mojom.h" #include "components/session_manager/session_manager_types.h" -#include "components/user_manager/user_type.h" namespace mojo { @@ -66,67 +65,6 @@ }; template <> -struct EnumTraits<ash::mojom::UserType, user_manager::UserType> { - static ash::mojom::UserType ToMojom(user_manager::UserType input) { - switch (input) { - case user_manager::USER_TYPE_REGULAR: - return ash::mojom::UserType::REGULAR; - case user_manager::USER_TYPE_GUEST: - return ash::mojom::UserType::GUEST; - case user_manager::USER_TYPE_PUBLIC_ACCOUNT: - return ash::mojom::UserType::PUBLIC_ACCOUNT; - case user_manager::USER_TYPE_SUPERVISED: - return ash::mojom::UserType::SUPERVISED; - case user_manager::USER_TYPE_KIOSK_APP: - return ash::mojom::UserType::KIOSK; - case user_manager::USER_TYPE_CHILD: - return ash::mojom::UserType::CHILD; - case user_manager::USER_TYPE_ARC_KIOSK_APP: - return ash::mojom::UserType::ARC_KIOSK; - case user_manager::USER_TYPE_ACTIVE_DIRECTORY: - return ash::mojom::UserType::ACTIVE_DIRECTORY; - case user_manager::NUM_USER_TYPES: - // Bail as this is not a valid user type. - break; - } - NOTREACHED(); - return ash::mojom::UserType::REGULAR; - } - - static bool FromMojom(ash::mojom::UserType input, - user_manager::UserType* out) { - switch (input) { - case ash::mojom::UserType::REGULAR: - *out = user_manager::USER_TYPE_REGULAR; - return true; - case ash::mojom::UserType::GUEST: - *out = user_manager::USER_TYPE_GUEST; - return true; - case ash::mojom::UserType::PUBLIC_ACCOUNT: - *out = user_manager::USER_TYPE_PUBLIC_ACCOUNT; - return true; - case ash::mojom::UserType::SUPERVISED: - *out = user_manager::USER_TYPE_SUPERVISED; - return true; - case ash::mojom::UserType::KIOSK: - *out = user_manager::USER_TYPE_KIOSK_APP; - return true; - case ash::mojom::UserType::CHILD: - *out = user_manager::USER_TYPE_CHILD; - return true; - case ash::mojom::UserType::ARC_KIOSK: - *out = user_manager::USER_TYPE_ARC_KIOSK_APP; - return true; - case ash::mojom::UserType::ACTIVE_DIRECTORY: - *out = user_manager::USER_TYPE_ACTIVE_DIRECTORY; - return true; - } - NOTREACHED(); - return false; - } -}; - -template <> struct EnumTraits<ash::mojom::AddUserSessionPolicy, ash::AddUserSessionPolicy> { static ash::mojom::AddUserSessionPolicy ToMojom( ash::AddUserSessionPolicy input) {
diff --git a/ash/public/interfaces/typemaps.gni b/ash/public/interfaces/typemaps.gni index 53027c18..ac3500d5 100644 --- a/ash/public/interfaces/typemaps.gni +++ b/ash/public/interfaces/typemaps.gni
@@ -5,5 +5,6 @@ typemaps = [ "//ash/public/interfaces/session_controller.typemap", "//ash/public/interfaces/shelf.typemap", + "//ash/public/interfaces/user_info.typemap", "//ash/public/interfaces/wallpaper.typemap", ]
diff --git a/ash/public/interfaces/user_info.mojom b/ash/public/interfaces/user_info.mojom new file mode 100644 index 0000000..6fba255 --- /dev/null +++ b/ash/public/interfaces/user_info.mojom
@@ -0,0 +1,47 @@ +// 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. + +module ash.mojom; + +import "components/signin/public/interfaces/account_id.mojom"; +import "ui/gfx/image/mojo/image.mojom"; + +// Matches user_manager::UserType. +enum UserType { + // Regular user, has a user name and password. + REGULAR, + + // Guest user, logs in without authentication. + GUEST, + + // Public account user, logs in without authentication. Available only if + // enabled through policy. + PUBLIC_ACCOUNT, + + // Supervised user, logs in only with local authentication. + SUPERVISED, + + // Kiosk app robot, logs in without authentication. + KIOSK, + + // Child user, with supervised options. + CHILD, + + // Android app in kiosk mode, logs in without authentication. + ARC_KIOSK, + + // Active Directory user. Authenticates against Active Directory server. + ACTIVE_DIRECTORY, +}; + + +// Info about a user. May be sent repeatedly for a single user because +// individual fields may change (e.g. the avatar image or custodians). +struct UserInfo { + UserType type; + signin.mojom.AccountId account_id; + string display_name; + string display_email; + gfx.mojom.ImageSkia avatar; +}; \ No newline at end of file
diff --git a/ash/public/interfaces/user_info.typemap b/ash/public/interfaces/user_info.typemap new file mode 100644 index 0000000..5a0e9376 --- /dev/null +++ b/ash/public/interfaces/user_info.typemap
@@ -0,0 +1,11 @@ +# 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. + +mojom = "//ash/public/interfaces/user_info.mojom" +public_headers = [ "//components/user_manager/user_type.h" ] +traits_headers = [ "//ash/public/interfaces/user_info_traits.h" ] +public_deps = [ + "//components/user_manager", +] +type_mappings = [ "ash.mojom.UserType=user_manager::UserType" ]
diff --git a/ash/public/interfaces/user_info_traits.h b/ash/public/interfaces/user_info_traits.h new file mode 100644 index 0000000..77bf2a0 --- /dev/null +++ b/ash/public/interfaces/user_info_traits.h
@@ -0,0 +1,76 @@ +// 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. + +#ifndef ASH_PUBLIC_INTERFACES_USER_INFO_TRAITS_H_ +#define ASH_PUBLIC_INTERFACES_USER_INFO_TRAITS_H_ + +#include "ash/public/interfaces/user_info.mojom.h" +#include "components/user_manager/user_type.h" + +namespace mojo { + +template <> +struct EnumTraits<ash::mojom::UserType, user_manager::UserType> { + static ash::mojom::UserType ToMojom(user_manager::UserType input) { + switch (input) { + case user_manager::USER_TYPE_REGULAR: + return ash::mojom::UserType::REGULAR; + case user_manager::USER_TYPE_GUEST: + return ash::mojom::UserType::GUEST; + case user_manager::USER_TYPE_PUBLIC_ACCOUNT: + return ash::mojom::UserType::PUBLIC_ACCOUNT; + case user_manager::USER_TYPE_SUPERVISED: + return ash::mojom::UserType::SUPERVISED; + case user_manager::USER_TYPE_KIOSK_APP: + return ash::mojom::UserType::KIOSK; + case user_manager::USER_TYPE_CHILD: + return ash::mojom::UserType::CHILD; + case user_manager::USER_TYPE_ARC_KIOSK_APP: + return ash::mojom::UserType::ARC_KIOSK; + case user_manager::USER_TYPE_ACTIVE_DIRECTORY: + return ash::mojom::UserType::ACTIVE_DIRECTORY; + case user_manager::NUM_USER_TYPES: + // Bail as this is not a valid user type. + break; + } + NOTREACHED(); + return ash::mojom::UserType::REGULAR; + } + + static bool FromMojom(ash::mojom::UserType input, + user_manager::UserType* out) { + switch (input) { + case ash::mojom::UserType::REGULAR: + *out = user_manager::USER_TYPE_REGULAR; + return true; + case ash::mojom::UserType::GUEST: + *out = user_manager::USER_TYPE_GUEST; + return true; + case ash::mojom::UserType::PUBLIC_ACCOUNT: + *out = user_manager::USER_TYPE_PUBLIC_ACCOUNT; + return true; + case ash::mojom::UserType::SUPERVISED: + *out = user_manager::USER_TYPE_SUPERVISED; + return true; + case ash::mojom::UserType::KIOSK: + *out = user_manager::USER_TYPE_KIOSK_APP; + return true; + case ash::mojom::UserType::CHILD: + *out = user_manager::USER_TYPE_CHILD; + return true; + case ash::mojom::UserType::ARC_KIOSK: + *out = user_manager::USER_TYPE_ARC_KIOSK_APP; + return true; + case ash::mojom::UserType::ACTIVE_DIRECTORY: + *out = user_manager::USER_TYPE_ACTIVE_DIRECTORY; + return true; + } + NOTREACHED(); + return false; + } +}; + +} // namespace mojo + +#endif // ASH_PUBLIC_INTERFACES_USER_INFO_TRAITS_H_
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 36a9fc4..f99da864 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -74,6 +74,7 @@ #include "ui/aura/window_tracker.h" #include "ui/base/models/menu_model.h" #include "ui/chromeos/touch_exploration_controller.h" +#include "ui/compositor/layer.h" #include "ui/display/types/display_constants.h" #include "ui/events/event_utils.h" #include "ui/keyboard/keyboard_controller.h" @@ -246,8 +247,9 @@ } // Creates a new window for use as a container. -// TODO(sky): This should create an aura::Window. http://crbug.com/671246. -WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { +aura::Window* CreateContainer(int window_id, + const char* name, + aura::Window* parent) { aura::Window* window = new aura::Window(nullptr, aura::client::WINDOW_TYPE_UNKNOWN); window->Init(ui::LAYER_NOT_DRAWN); @@ -257,22 +259,20 @@ } window->set_id(window_id); window->SetName(name); - parent->aura_window()->AddChild(window); + parent->AddChild(window); if (window_id != kShellWindowId_UnparentedControlContainer) window->Show(); - return WmWindow::Get(window); + return window; } -// TODO(sky): This should take an aura::Window. http://crbug.com/671246. -bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { - if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) +bool ShouldDestroyWindowInCloseChildWindows(aura::Window* window) { + if (!window->owned_by_parent()) return false; if (Shell::GetAshConfig() != Config::MASH) return true; - aura::WindowMus* window_mus = - aura::WindowMus::Get(WmWindow::GetAuraWindow(window)); + aura::WindowMus* window_mus = aura::WindowMus::Get(window); return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) || Shell::window_tree_client()->IsRoot(window_mus); } @@ -568,13 +568,13 @@ // Explicitly destroy top level windows. We do this because such windows may // query the RootWindow for state. aura::WindowTracker non_toplevel_windows; - WmWindow* root = GetWindow(); - non_toplevel_windows.Add(root->aura_window()); + aura::Window* root = GetRootWindow(); + non_toplevel_windows.Add(root); while (!non_toplevel_windows.windows().empty()) { aura::Window* non_toplevel_window = non_toplevel_windows.Pop(); aura::WindowTracker toplevel_windows; for (aura::Window* child : non_toplevel_window->children()) { - if (!ShouldDestroyWindowInCloseChildWindows(WmWindow::Get(child))) + if (!ShouldDestroyWindowInCloseChildWindows(child)) continue; if (child->delegate()) toplevel_windows.Add(child); @@ -585,10 +585,10 @@ delete toplevel_windows.Pop(); } // And then remove the containers. - while (!root->GetChildren().empty()) { - WmWindow* child = root->GetChildren()[0]; + while (!root->children().empty()) { + aura::Window* child = root->children()[0]; if (ShouldDestroyWindowInCloseChildWindows(child)) - child->Destroy(); + delete child; else root->RemoveChild(child); } @@ -825,11 +825,11 @@ // Make it easier to resize windows that partially overlap the shelf. Must // occur after the ShelfLayoutManager is constructed by ShelfWidget. aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); - shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( - WmWindow::Get(shelf_container), shelf_.get())); + shelf_container->SetEventTargeter( + base::MakeUnique<ShelfWindowTargeter>(shelf_container, shelf_.get())); aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); - status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( - WmWindow::Get(status_container), shelf_.get())); + status_container->SetEventTargeter( + base::MakeUnique<ShelfWindowTargeter>(status_container, shelf_.get())); panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); GetContainer(kShellWindowId_PanelContainer) @@ -848,12 +848,12 @@ } void RootWindowController::CreateContainers() { - WmWindow* root = GetWindow(); + aura::Window* root = GetRootWindow(); // For screen rotation animation: add a NOT_DRAWN layer in between the // root_window's layer and its current children so that we only need to // initiate two LayerAnimationSequences. One for the new layers and one for // the old layers. - WmWindow* screen_rotation_container = CreateContainer( + aura::Window* screen_rotation_container = CreateContainer( kShellWindowId_ScreenRotationContainer, "ScreenRotationContainer", root); // These containers are just used by PowerButtonController to animate groups @@ -866,168 +866,153 @@ // included in those animate groups. When the screen is locked, the wallpaper // is moved to the lock screen wallpaper container (and moved back on unlock). // Ensure that there's an opaque layer occluding the non-lock-screen layers. - WmWindow* wallpaper_container = + aura::Window* wallpaper_container = CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer", screen_rotation_container); - wallpaper_container->SetChildWindowVisibilityChangesAnimated(); + ::wm::SetChildWindowVisibilityChangesAnimated(wallpaper_container); - WmWindow* non_lock_screen_containers = CreateContainer( + aura::Window* non_lock_screen_containers = CreateContainer( kShellWindowId_NonLockScreenContainersContainer, "NonLockScreenContainersContainer", screen_rotation_container); // Clip all windows inside this container, as half pixel of the window's // texture may become visible when the screen is scaled. crbug.com/368591. - non_lock_screen_containers->SetMasksToBounds(true); + non_lock_screen_containers->layer()->SetMasksToBounds(true); - WmWindow* lock_wallpaper_containers = CreateContainer( + aura::Window* lock_wallpaper_containers = CreateContainer( kShellWindowId_LockScreenWallpaperContainer, "LockScreenWallpaperContainer", screen_rotation_container); - lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); + ::wm::SetChildWindowVisibilityChangesAnimated(lock_wallpaper_containers); - WmWindow* lock_screen_containers = CreateContainer( + aura::Window* lock_screen_containers = CreateContainer( kShellWindowId_LockScreenContainersContainer, "LockScreenContainersContainer", screen_rotation_container); - WmWindow* lock_screen_related_containers = CreateContainer( + aura::Window* lock_screen_related_containers = CreateContainer( kShellWindowId_LockScreenRelatedContainersContainer, "LockScreenRelatedContainersContainer", screen_rotation_container); CreateContainer(kShellWindowId_UnparentedControlContainer, "UnparentedControlContainer", non_lock_screen_containers); - WmWindow* default_container = + aura::Window* default_container = CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", non_lock_screen_containers); - default_container->SetChildWindowVisibilityChangesAnimated(); - default_container->SetSnapsChildrenToPhysicalPixelBoundary(); - default_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - default_container->SetChildrenUseExtendedHitRegion(); + ::wm::SetChildWindowVisibilityChangesAnimated(default_container); + wm::SetSnapsChildrenToPhysicalPixelBoundary(default_container); + default_container->SetProperty(kUsesScreenCoordinatesKey, true); + wm::SetChildrenUseExtendedHitRegionForWindow(default_container); - WmWindow* always_on_top_container = + aura::Window* always_on_top_container = CreateContainer(kShellWindowId_AlwaysOnTopContainer, "AlwaysOnTopContainer", non_lock_screen_containers); - always_on_top_container->SetChildWindowVisibilityChangesAnimated(); - always_on_top_container->SetSnapsChildrenToPhysicalPixelBoundary(); - always_on_top_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + ::wm::SetChildWindowVisibilityChangesAnimated(always_on_top_container); + wm::SetSnapsChildrenToPhysicalPixelBoundary(always_on_top_container); + always_on_top_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* shelf_container = + aura::Window* shelf_container = CreateContainer(kShellWindowId_ShelfContainer, "ShelfContainer", non_lock_screen_containers); - shelf_container->SetSnapsChildrenToPhysicalPixelBoundary(); - shelf_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - shelf_container->SetLockedToRoot(true); + wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_container); + shelf_container->SetProperty(kUsesScreenCoordinatesKey, true); + shelf_container->SetProperty(kLockedToRootKey, true); - WmWindow* panel_container = + aura::Window* panel_container = CreateContainer(kShellWindowId_PanelContainer, "PanelContainer", non_lock_screen_containers); - panel_container->SetSnapsChildrenToPhysicalPixelBoundary(); - panel_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary(panel_container); + panel_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* shelf_bubble_container = + aura::Window* shelf_bubble_container = CreateContainer(kShellWindowId_ShelfBubbleContainer, "ShelfBubbleContainer", non_lock_screen_containers); - shelf_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary(); - shelf_bubble_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - shelf_bubble_container->SetLockedToRoot(true); + wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_bubble_container); + shelf_bubble_container->SetProperty(kUsesScreenCoordinatesKey, true); + shelf_bubble_container->SetProperty(kLockedToRootKey, true); - WmWindow* app_list_container = + aura::Window* app_list_container = CreateContainer(kShellWindowId_AppListContainer, "AppListContainer", non_lock_screen_containers); - app_list_container->SetSnapsChildrenToPhysicalPixelBoundary(); - app_list_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary(app_list_container); + app_list_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* modal_container = + aura::Window* modal_container = CreateContainer(kShellWindowId_SystemModalContainer, "SystemModalContainer", non_lock_screen_containers); - modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); - modal_container->SetChildWindowVisibilityChangesAnimated(); - modal_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - modal_container->SetChildrenUseExtendedHitRegion(); + wm::SetSnapsChildrenToPhysicalPixelBoundary(modal_container); + ::wm::SetChildWindowVisibilityChangesAnimated(modal_container); + modal_container->SetProperty(kUsesScreenCoordinatesKey, true); + wm::SetChildrenUseExtendedHitRegionForWindow(modal_container); // TODO(beng): Figure out if we can make this use // SystemModalContainerEventFilter instead of stops_event_propagation. - WmWindow* lock_container = + aura::Window* lock_container = CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer", lock_screen_containers); - lock_container->SetSnapsChildrenToPhysicalPixelBoundary(); - lock_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_container); + lock_container->SetProperty(kUsesScreenCoordinatesKey, true); // TODO(beng): stopsevents - WmWindow* lock_action_handler_container = + aura::Window* lock_action_handler_container = CreateContainer(kShellWindowId_LockActionHandlerContainer, "LockActionHandlerContainer", lock_screen_containers); - lock_action_handler_container->SetSnapsChildrenToPhysicalPixelBoundary(); - lock_action_handler_container->SetChildWindowVisibilityChangesAnimated(); - lock_action_handler_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_action_handler_container); + ::wm::SetChildWindowVisibilityChangesAnimated(lock_action_handler_container); + lock_action_handler_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* lock_modal_container = + aura::Window* lock_modal_container = CreateContainer(kShellWindowId_LockSystemModalContainer, "LockSystemModalContainer", lock_screen_containers); - lock_modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); - lock_modal_container->SetChildWindowVisibilityChangesAnimated(); - lock_modal_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - lock_modal_container->SetChildrenUseExtendedHitRegion(); + wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_modal_container); + ::wm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); + lock_modal_container->SetProperty(kUsesScreenCoordinatesKey, true); + wm::SetChildrenUseExtendedHitRegionForWindow(lock_modal_container); - WmWindow* status_container = + aura::Window* status_container = CreateContainer(kShellWindowId_StatusContainer, "StatusContainer", lock_screen_related_containers); - status_container->SetSnapsChildrenToPhysicalPixelBoundary(); - status_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - status_container->SetLockedToRoot(true); + wm::SetSnapsChildrenToPhysicalPixelBoundary(status_container); + status_container->SetProperty(kUsesScreenCoordinatesKey, true); + status_container->SetProperty(kLockedToRootKey, true); - WmWindow* settings_bubble_container = + aura::Window* settings_bubble_container = CreateContainer(kShellWindowId_SettingBubbleContainer, "SettingBubbleContainer", lock_screen_related_containers); - settings_bubble_container->SetChildWindowVisibilityChangesAnimated(); - settings_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary(); - settings_bubble_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); - settings_bubble_container->SetLockedToRoot(true); + ::wm::SetChildWindowVisibilityChangesAnimated(settings_bubble_container); + wm::SetSnapsChildrenToPhysicalPixelBoundary(settings_bubble_container); + settings_bubble_container->SetProperty(kUsesScreenCoordinatesKey, true); + settings_bubble_container->SetProperty(kLockedToRootKey, true); - WmWindow* virtual_keyboard_parent_container = CreateContainer( + aura::Window* virtual_keyboard_parent_container = CreateContainer( kShellWindowId_ImeWindowParentContainer, "VirtualKeyboardParentContainer", lock_screen_related_containers); - virtual_keyboard_parent_container->SetSnapsChildrenToPhysicalPixelBoundary(); - virtual_keyboard_parent_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary( + virtual_keyboard_parent_container); + virtual_keyboard_parent_container->SetProperty(kUsesScreenCoordinatesKey, + true); - WmWindow* menu_container = + aura::Window* menu_container = CreateContainer(kShellWindowId_MenuContainer, "MenuContainer", lock_screen_related_containers); - menu_container->SetChildWindowVisibilityChangesAnimated(); - menu_container->SetSnapsChildrenToPhysicalPixelBoundary(); - menu_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + ::wm::SetChildWindowVisibilityChangesAnimated(menu_container); + wm::SetSnapsChildrenToPhysicalPixelBoundary(menu_container); + menu_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* drag_drop_container = CreateContainer( + aura::Window* drag_drop_container = CreateContainer( kShellWindowId_DragImageAndTooltipContainer, "DragImageAndTooltipContainer", lock_screen_related_containers); - drag_drop_container->SetChildWindowVisibilityChangesAnimated(); - drag_drop_container->SetSnapsChildrenToPhysicalPixelBoundary(); - drag_drop_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + ::wm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); + wm::SetSnapsChildrenToPhysicalPixelBoundary(drag_drop_container); + drag_drop_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* overlay_container = + aura::Window* overlay_container = CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", lock_screen_related_containers); - overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); - overlay_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + wm::SetSnapsChildrenToPhysicalPixelBoundary(overlay_container); + overlay_container->SetProperty(kUsesScreenCoordinatesKey, true); - WmWindow* mouse_cursor_container = + aura::Window* mouse_cursor_container = CreateContainer(kShellWindowId_MouseCursorContainer, "MouseCursorContainer", screen_rotation_container); - mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( - WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); + mouse_cursor_container->SetProperty(kUsesScreenCoordinatesKey, true); CreateContainer(kShellWindowId_PowerButtonAnimationContainer, "PowerButtonAnimationContainer", screen_rotation_container);
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index d9434738..1971f4b 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h
@@ -298,7 +298,7 @@ void InitLayoutManagers(); - // Creates the containers (WmWindows) used by the shell. + // Creates the containers (aura::Windows) used by the shell. void CreateContainers(); // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|.
diff --git a/ash/session/session_controller.cc b/ash/session/session_controller.cc index b2f3092..20d884a3 100644 --- a/ash/session/session_controller.cc +++ b/ash/session/session_controller.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <utility> +#include "ash/public/interfaces/user_info.mojom.h" #include "ash/session/session_observer.h" #include "ash/shell.h" #include "ash/system/power/power_event_observer.h" @@ -139,7 +140,7 @@ if (!IsActiveUserSessionStarted()) return false; - user_manager::UserType active_user_type = GetUserSession(0)->type; + user_manager::UserType active_user_type = GetUserSession(0)->user_info->type; return active_user_type == user_manager::USER_TYPE_SUPERVISED || active_user_type == user_manager::USER_TYPE_CHILD; } @@ -148,7 +149,7 @@ if (!IsActiveUserSessionStarted()) return false; - user_manager::UserType active_user_type = GetUserSession(0)->type; + user_manager::UserType active_user_type = GetUserSession(0)->user_info->type; return active_user_type == user_manager::USER_TYPE_CHILD; } @@ -156,7 +157,7 @@ if (!IsActiveUserSessionStarted()) return false; - user_manager::UserType active_user_type = GetUserSession(0)->type; + user_manager::UserType active_user_type = GetUserSession(0)->user_info->type; return active_user_type == user_manager::USER_TYPE_KIOSK_APP || active_user_type == user_manager::USER_TYPE_ARC_KIOSK_APP; } @@ -208,7 +209,7 @@ *it = std::move(user_session); for (auto& observer : observers_) - observer.OnUserSessionUpdated((*it)->account_id); + observer.OnUserSessionUpdated((*it)->user_info->account_id); UpdateLoginStatus(); } @@ -238,8 +239,10 @@ if (user_sessions_[0]->session_id != active_session_id_) { active_session_id_ = user_sessions_[0]->session_id; - for (auto& observer : observers_) - observer.OnActiveUserSessionChanged(user_sessions_[0]->account_id); + for (auto& observer : observers_) { + observer.OnActiveUserSessionChanged( + user_sessions_[0]->user_info->account_id); + } UpdateLoginStatus(); } @@ -312,7 +315,7 @@ } void SessionController::AddUserSession(mojom::UserSessionPtr user_session) { - const AccountId account_id(user_session->account_id); + const AccountId account_id(user_session->user_info->account_id); user_sessions_.push_back(std::move(user_session)); @@ -350,7 +353,7 @@ if (user_sessions_.empty()) // Can be empty in tests. return LoginStatus::USER; - switch (user_sessions_[0]->type) { + switch (user_sessions_[0]->user_info->type) { case user_manager::USER_TYPE_REGULAR: // TODO: This needs to distinguish between owner and non-owner. return LoginStatus::USER;
diff --git a/ash/session/session_controller_unittest.cc b/ash/session/session_controller_unittest.cc index bab93c49e..ecc58b27 100644 --- a/ash/session/session_controller_unittest.cc +++ b/ash/session/session_controller_unittest.cc
@@ -91,10 +91,11 @@ void UpdateSession(uint32_t session_id, const std::string& email) { mojom::UserSessionPtr session = mojom::UserSession::New(); session->session_id = session_id; - session->type = user_manager::USER_TYPE_REGULAR; - session->account_id = AccountId::FromUserEmail(email); - session->display_name = email; - session->display_email = email; + session->user_info = mojom::UserInfo::New(); + session->user_info->type = user_manager::USER_TYPE_REGULAR; + session->user_info->account_id = AccountId::FromUserEmail(email); + session->user_info->display_name = email; + session->user_info->display_email = email; controller_->UpdateUserSession(std::move(session)); } @@ -102,7 +103,7 @@ std::string GetUserSessionEmails() const { std::string emails; for (const auto& session : controller_->GetUserSessions()) { - emails += session->display_email + ","; + emails += session->user_info->display_email + ","; } return emails; } @@ -256,10 +257,11 @@ for (const auto& test_case : kTestCases) { mojom::UserSessionPtr session = mojom::UserSession::New(); session->session_id = 1u; - session->type = test_case.user_type; - session->account_id = AccountId::FromUserEmail("user1@test.com"); - session->display_name = "User 1"; - session->display_email = "user1@test.com"; + session->user_info = mojom::UserInfo::New(); + session->user_info->type = test_case.user_type; + session->user_info->account_id = AccountId::FromUserEmail("user1@test.com"); + session->user_info->display_name = "User 1"; + session->user_info->display_email = "user1@test.com"; controller()->UpdateUserSession(std::move(session)); EXPECT_EQ(test_case.expected_status, controller()->login_status()) @@ -349,7 +351,8 @@ TEST_F(SessionControllerTest, IsUserSupervised) { mojom::UserSessionPtr session = mojom::UserSession::New(); session->session_id = 1u; - session->type = user_manager::USER_TYPE_SUPERVISED; + session->user_info = mojom::UserInfo::New(); + session->user_info->type = user_manager::USER_TYPE_SUPERVISED; controller()->UpdateUserSession(std::move(session)); EXPECT_TRUE(controller()->IsUserSupervised()); @@ -358,7 +361,8 @@ TEST_F(SessionControllerTest, IsUserChild) { mojom::UserSessionPtr session = mojom::UserSession::New(); session->session_id = 1u; - session->type = user_manager::USER_TYPE_CHILD; + session->user_info = mojom::UserInfo::New(); + session->user_info->type = user_manager::USER_TYPE_CHILD; controller()->UpdateUserSession(std::move(session)); EXPECT_TRUE(controller()->IsUserChild());
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc index 90d4912..4209ba0 100644 --- a/ash/shelf/shelf.cc +++ b/ash/shelf/shelf.cc
@@ -274,13 +274,18 @@ // static void Shelf::ActivateShelfItem(int item_index) { + ActivateShelfItemOnDisplay(item_index, display::kInvalidDisplayId); +} + +// static +void Shelf::ActivateShelfItemOnDisplay(int item_index, int64_t display_id) { ShelfModel* shelf_model = Shell::Get()->shelf_model(); const ShelfItem& item = shelf_model->items()[item_index]; ShelfItemDelegate* item_delegate = shelf_model->GetShelfItemDelegate(item.id); std::unique_ptr<ui::Event> event = base::MakeUnique<ui::KeyEvent>( ui::ET_KEY_RELEASED, ui::VKEY_UNKNOWN, ui::EF_NONE); - item_delegate->ItemSelected(std::move(event), display::kInvalidDisplayId, - LAUNCH_FROM_UNKNOWN, base::Bind(&NoopCallback)); + item_delegate->ItemSelected(std::move(event), display_id, LAUNCH_FROM_UNKNOWN, + base::Bind(&NoopCallback)); } bool Shelf::ProcessGestureEvent(const ui::GestureEvent& event) {
diff --git a/ash/shelf/shelf.h b/ash/shelf/shelf.h index 9467a37..e9bfc15 100644 --- a/ash/shelf/shelf.h +++ b/ash/shelf/shelf.h
@@ -118,6 +118,10 @@ // Activates the shelf item specified by the index in the list of shelf items. static void ActivateShelfItem(int item_index); + // Activates the shelf item specified by the index in the list of shelf items + // on the display identified by |display_id|. + static void ActivateShelfItemOnDisplay(int item_index, int64_t display_id); + // Handles a gesture |event| coming from a source outside the shelf widget // (e.g. the status area widget). Allows support for behaviors like toggling // auto-hide with a swipe, even if that gesture event hits another window.
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 70450454..429fd15 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc
@@ -530,9 +530,9 @@ // Do not animate the background when: // - Going from a hidden / auto hidden shelf in fullscreen to a visible shelf - // in tablet mode. - // - Going from an auto hidden shelf in tablet mode to a visible shelf in - // tablet mode. + // in maximized mode. + // - Going from an auto hidden shelf in maximized mode to a visible shelf in + // maximized mode. if (state.visibility_state == SHELF_VISIBLE && state.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED && old_state.visibility_state != SHELF_VISIBLE) {
diff --git a/ash/shelf/shelf_window_targeter.cc b/ash/shelf/shelf_window_targeter.cc index eb377a1..06836bee 100644 --- a/ash/shelf/shelf_window_targeter.cc +++ b/ash/shelf/shelf_window_targeter.cc
@@ -7,7 +7,6 @@ #include "ash/public/cpp/shelf_types.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_constants.h" -#include "ash/wm_window.h" #include "ui/aura/window.h" namespace ash { @@ -24,13 +23,11 @@ } // namespace -ShelfWindowTargeter::ShelfWindowTargeter(WmWindow* container, Shelf* shelf) - : ::wm::EasyResizeWindowTargeter(WmWindow::GetAuraWindow(container), - gfx::Insets(), - gfx::Insets()), +ShelfWindowTargeter::ShelfWindowTargeter(aura::Window* container, Shelf* shelf) + : ::wm::EasyResizeWindowTargeter(container, gfx::Insets(), gfx::Insets()), shelf_(shelf) { WillChangeVisibilityState(shelf_->GetVisibilityState()); - container->aura_window()->AddObserver(this); + container->AddObserver(this); shelf_->AddObserver(this); }
diff --git a/ash/shelf/shelf_window_targeter.h b/ash/shelf/shelf_window_targeter.h index b1f090dc..6889131 100644 --- a/ash/shelf/shelf_window_targeter.h +++ b/ash/shelf/shelf_window_targeter.h
@@ -13,7 +13,6 @@ namespace ash { class Shelf; -class WmWindow; // ShelfWindowTargeter makes it easier to resize windows with the mouse when the // window-edge slightly overlaps with the shelf edge. The targeter also makes it @@ -22,7 +21,7 @@ public aura::WindowObserver, public ShelfObserver { public: - ShelfWindowTargeter(WmWindow* container, Shelf* shelf); + ShelfWindowTargeter(aura::Window* container, Shelf* shelf); ~ShelfWindowTargeter() override; private:
diff --git a/ash/shell.cc b/ash/shell.cc index 3ddcef2..92616f6 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -98,6 +98,8 @@ #include "ash/wm/immersive_context_ash.h" #include "ash/wm/immersive_handler_factory_ash.h" #include "ash/wm/lock_state_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overlay_event_filter.h" #include "ash/wm/overview/window_selector_controller.h" @@ -108,8 +110,6 @@ #include "ash/wm/system_gesture_event_filter.h" #include "ash/wm/system_modal_container_event_filter.h" #include "ash/wm/system_modal_container_layout_manager.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" #include "ash/wm/toplevel_window_event_handler.h" #include "ash/wm/video_detector.h" #include "ash/wm/window_animations.h" @@ -487,19 +487,19 @@ } } -void Shell::NotifyTabletModeStarted() { +void Shell::NotifyMaximizeModeStarted() { for (auto& observer : shell_observers_) - observer.OnTabletModeStarted(); + observer.OnMaximizeModeStarted(); } -void Shell::NotifyTabletModeEnding() { +void Shell::NotifyMaximizeModeEnding() { for (auto& observer : shell_observers_) - observer.OnTabletModeEnding(); + observer.OnMaximizeModeEnding(); } -void Shell::NotifyTabletModeEnded() { +void Shell::NotifyMaximizeModeEnded() { for (auto& observer : shell_observers_) - observer.OnTabletModeEnded(); + observer.OnMaximizeModeEnded(); } void Shell::NotifyOverviewModeStarting() { @@ -647,14 +647,14 @@ screen_orientation_controller_.reset(); screen_layout_observer_.reset(); - // Destroy the virtual keyboard controller before the tablet mode controller + // Destroy the virtual keyboard controller before the maximize mode controller // since the latters destructor triggers events that the former is listening // to but no longer cares about. virtual_keyboard_controller_.reset(); - // Destroy tablet mode controller early on since it has some observers which + // Destroy maximize mode controller early on since it has some observers which // need to be removed. - tablet_mode_controller_.reset(); + maximize_mode_controller_.reset(); // Destroy the keyboard before closing the shelf, since it will invoke a shelf // layout. @@ -949,7 +949,7 @@ } accelerator_controller_ = shell_port_->CreateAcceleratorController(); - tablet_mode_controller_ = base::MakeUnique<TabletModeController>(); + maximize_mode_controller_ = base::MakeUnique<MaximizeModeController>(); magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); AddPreTargetHandler(magnifier_key_scroll_handler_.get());
diff --git a/ash/shell.h b/ash/shell.h index 6274048..da3e7d69 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -121,7 +121,7 @@ class LogoutConfirmationController; class LockScreenController; class MagnificationController; -class TabletModeController; +class MaximizeModeController; class MediaController; class MouseCursorEventFilter; class MruWindowTracker; @@ -293,8 +293,8 @@ // Deactivates the virtual keyboard. void DeactivateKeyboard(); - // Test if TabletModeWindowManager is not enabled, and if - // TabletModeController is not currently setting a display rotation. Or if + // Test if MaximizeModeWindowManager is not enabled, and if + // MaximizeModeController is not currently setting a display rotation. Or if // the |resolution_notification_controller_| is not showing its confirmation // dialog. If true then changes to display settings can be saved. bool ShouldSaveDisplaySettings(); @@ -332,8 +332,8 @@ LockScreenController* lock_screen_controller() { return lock_screen_controller_.get(); } - TabletModeController* tablet_mode_controller() { - return tablet_mode_controller_.get(); + MaximizeModeController* maximize_mode_controller() { + return maximize_mode_controller_.get(); } MediaController* media_controller() { return media_controller_.get(); } MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } @@ -566,16 +566,16 @@ // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. void UpdateAfterLoginStatusChange(LoginStatus status); - // Notifies observers that tablet mode has started, windows might still + // Notifies observers that maximize mode has started, windows might still // animate. - void NotifyTabletModeStarted(); + void NotifyMaximizeModeStarted(); - // Notifies observers that tablet mode is about to end. - void NotifyTabletModeEnding(); + // Notifies observers that maximize mode is about to end. + void NotifyMaximizeModeEnding(); - // Notifies observers that tablet mode has ended, windows might still be + // Notifies observers that maximize mode has ended, windows might still be // returning to their original position. - void NotifyTabletModeEnded(); + void NotifyMaximizeModeEnded(); // Notifies observers that overview mode is about to be started (before the // windows get re-arranged). @@ -698,7 +698,7 @@ std::unique_ptr<LocaleNotificationController> locale_notification_controller_; std::unique_ptr<LockScreenController> lock_screen_controller_; std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; - std::unique_ptr<TabletModeController> tablet_mode_controller_; + std::unique_ptr<MaximizeModeController> maximize_mode_controller_; std::unique_ptr<MediaController> media_controller_; std::unique_ptr<MruWindowTracker> mru_window_tracker_; std::unique_ptr<NewWindowController> new_window_controller_;
diff --git a/ash/shell_observer.h b/ash/shell_observer.h index 1e51c321..5937bb2 100644 --- a/ash/shell_observer.h +++ b/ash/shell_observer.h
@@ -48,16 +48,16 @@ // Called after overview mode has ended. virtual void OnOverviewModeEnded() {} - // Called when the always tablet mode has started. Windows might still + // Called when the always maximize mode has started. Windows might still // animate though. - virtual void OnTabletModeStarted() {} + virtual void OnMaximizeModeStarted() {} - // Called when the tablet mode is about to end. - virtual void OnTabletModeEnding() {} + // Called when the maximize mode is about to end. + virtual void OnMaximizeModeEnding() {} - // Called when the tablet mode has ended. Windows may still be + // Called when the maximize mode has ended. Windows may still be // animating but have been restored. - virtual void OnTabletModeEnded() {} + virtual void OnMaximizeModeEnded() {} // Called when keyboard is activated/deactivated in |root_window|. virtual void OnVirtualKeyboardStateChanged(bool activated,
diff --git a/ash/shell_port.h b/ash/shell_port.h index 1c3376a..a7ade800 100644 --- a/ash/shell_port.h +++ b/ash/shell_port.h
@@ -61,7 +61,7 @@ enum class TaskSwitchSource; namespace wm { -class TabletModeEventHandler; +class MaximizeModeEventHandler; class WindowState; } @@ -167,8 +167,8 @@ virtual std::unique_ptr<WindowCycleEventFilter> CreateWindowCycleEventFilter() = 0; - virtual std::unique_ptr<wm::TabletModeEventHandler> - CreateTabletModeEventHandler() = 0; + virtual std::unique_ptr<wm::MaximizeModeEventHandler> + CreateMaximizeModeEventHandler() = 0; virtual std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( aura::Window* workspace_window) = 0;
diff --git a/ash/system/brightness/tray_brightness.cc b/ash/system/brightness/tray_brightness.cc index 4cefa66..9560b45 100644 --- a/ash/system/brightness/tray_brightness.cc +++ b/ash/system/brightness/tray_brightness.cc
@@ -16,7 +16,7 @@ #include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tri_view.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/bind.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" @@ -57,8 +57,8 @@ void SetBrightnessPercent(double percent); // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; private: // views::View: @@ -115,8 +115,8 @@ if (is_default_view_) { Shell::Get()->AddShellObserver(this); SetVisible(Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()); } tri_view->SetContainerVisible(TriView::Container::END, false); } @@ -132,11 +132,11 @@ slider_->SetValue(static_cast<float>(percent / 100.0)); } -void BrightnessView::OnTabletModeStarted() { +void BrightnessView::OnMaximizeModeStarted() { SetVisible(true); } -void BrightnessView::OnTabletModeEnded() { +void BrightnessView::OnMaximizeModeEnded() { SetVisible(false); }
diff --git a/ash/system/brightness/tray_brightness_unittest.cc b/ash/system/brightness/tray_brightness_unittest.cc index 3ae39da..e1f4e08 100644 --- a/ash/system/brightness/tray_brightness_unittest.cc +++ b/ash/system/brightness/tray_brightness_unittest.cc
@@ -10,7 +10,7 @@ #include "ash/system/tray/system_tray_delegate.h" #include "ash/system/tray/system_tray_item.h" #include "ash/test/ash_test_base.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ui/views/view.h" namespace ash { @@ -44,22 +44,26 @@ EXPECT_FALSE(tray->visible()); } -// Tests the construction of the default view while TabletMode is active. +// Tests the construction of the default view while MaximizeMode is active. // The BrightnessView should be visible. -TEST_F(TrayBrightnessTest, CreateDefaultViewDuringTabletMode) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); +TEST_F(TrayBrightnessTest, CreateDefaultViewDuringMaximizeMode) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); std::unique_ptr<views::View> tray(CreateDefaultView()); EXPECT_TRUE(tray->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } -// Tests that the enabling of TabletMode affects a previously created +// Tests that the enabling of MaximizeMode affects a previously created // BrightnessView, changing the visibility. -TEST_F(TrayBrightnessTest, DefaultViewVisibilityChangesDuringTabletMode) { +TEST_F(TrayBrightnessTest, DefaultViewVisibilityChangesDuringMaximizeMode) { std::unique_ptr<views::View> tray(CreateDefaultView()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(tray->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(tray->visible()); } @@ -70,22 +74,26 @@ EXPECT_TRUE(tray->visible()); } -// Tests that when the detailed view is created during TabletMode that its +// Tests that when the detailed view is created during MaximizeMode that its // BrightnessView is visible. -TEST_F(TrayBrightnessTest, CreateDetailedViewDuringTabletMode) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); +TEST_F(TrayBrightnessTest, CreateDetailedViewDuringMaximizeMode) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); std::unique_ptr<views::View> tray(CreateDetailedView()); EXPECT_TRUE(tray->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } -// Tests that the enabling of TabletMode has no affect on the visibility of a +// Tests that the enabling of MaximizeMode has no affect on the visibility of a // previously created BrightnessView that belongs to a detailed view. -TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringTabletMode) { +TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringMaximizeMode) { std::unique_ptr<views::View> tray(CreateDetailedView()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(tray->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_TRUE(tray->visible()); }
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc index 8f116b1..fe543b53 100644 --- a/ash/system/overview/overview_button_tray.cc +++ b/ash/system/overview/overview_button_tray.cc
@@ -12,9 +12,9 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_container.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" @@ -90,11 +90,11 @@ UpdateIconVisibility(); } -void OverviewButtonTray::OnTabletModeStarted() { +void OverviewButtonTray::OnMaximizeModeStarted() { UpdateIconVisibility(); } -void OverviewButtonTray::OnTabletModeEnded() { +void OverviewButtonTray::OnMaximizeModeEnded() { UpdateIconVisibility(); } @@ -126,7 +126,7 @@ Shell* shell = Shell::Get(); SetVisible( - shell->tablet_mode_controller()->IsTabletModeWindowManagerEnabled() && + shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() && session_controller->IsActiveUserSessionStarted() && !session_controller->IsScreenLocked() && session_controller->GetSessionState() ==
diff --git a/ash/system/overview/overview_button_tray.h b/ash/system/overview/overview_button_tray.h index 18563f3..ba45fb9 100644 --- a/ash/system/overview/overview_button_tray.h +++ b/ash/system/overview/overview_button_tray.h
@@ -30,7 +30,7 @@ ~OverviewButtonTray() override; // Updates the tray's visibility based on the LoginStatus and the current - // state of TabletMode + // state of MaximizeMode virtual void UpdateAfterLoginStatusChange(LoginStatus status); // ActionableView: @@ -40,8 +40,8 @@ void OnSessionStateChanged(session_manager::SessionState state) override; // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; void OnOverviewModeStarting() override; void OnOverviewModeEnded() override; @@ -53,7 +53,7 @@ private: friend class OverviewButtonTrayTest; - // Sets the icon to visible if tablet mode is enabled and + // Sets the icon to visible if maximize mode is enabled and // WindowSelectorController::CanSelect. void UpdateIconVisibility();
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc index 2606106..44cb7ea 100644 --- a/ash/system/overview/overview_button_tray_unittest.cc +++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -16,8 +16,8 @@ #include "ash/test/ash_test_base.h" #include "ash/test/ash_test_helper.h" #include "ash/test/status_area_widget_test_helper.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/test/user_action_tester.h" @@ -98,15 +98,17 @@ EXPECT_TRUE(GetImageView(GetTray()) != NULL); } -// Test that tablet mode toggle changes visibility. -// OverviewButtonTray should only be visible when TabletMode is enabled. -// By default the system should not have TabletMode enabled. -TEST_F(OverviewButtonTrayTest, TabletModeObserverOnTabletModeToggled) { +// Test that maximize mode toggle changes visibility. +// OverviewButtonTray should only be visible when MaximizeMode is enabled. +// By default the system should not have MaximizeMode enabled. +TEST_F(OverviewButtonTrayTest, MaximizeModeObserverOnMaximizeModeToggled) { ASSERT_FALSE(GetTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(GetTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(GetTray()->visible()); } @@ -188,31 +190,36 @@ } // Tests that a second OverviewButtonTray has been created, and only shows -// when TabletMode has been enabled, when we are using multiple displays. +// when MaximizeMode has been enabled, when we are using multiple displays. // By default the DisplayManger is in extended mode. TEST_F(OverviewButtonTrayTest, DisplaysOnBothDisplays) { UpdateDisplay("400x400,200x200"); EXPECT_FALSE(GetTray()->visible()); EXPECT_FALSE(GetSecondaryTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(GetTray()->visible()); EXPECT_TRUE(GetSecondaryTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } // Tests if Maximize Mode is enabled before a secondary display is attached // that the second OverviewButtonTray should be created in a visible state. TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); UpdateDisplay("400x400,200x200"); EXPECT_TRUE(GetSecondaryTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } // Tests that the tray loses visibility when a user logs out, and that it // regains visibility when a user logs back in. TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); SetUserLoggedIn(false); Shell::Get()->UpdateAfterLoginStatusChange(LoginStatus::NOT_LOGGED_IN); EXPECT_FALSE(GetTray()->visible()); @@ -226,7 +233,8 @@ SetUserAddingScreenRunning(false); NotifySessionStateChanged(); EXPECT_TRUE(GetTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } // Tests that the tray only renders as active while selection is ongoing. Any @@ -256,7 +264,8 @@ if (Shell::GetAshConfig() == Config::MASH) return; - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); // Long duration for hide animation, to allow it to be interrupted. std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration( @@ -278,8 +287,8 @@ } // Tests that the overview button becomes visible when the user enters -// tablet mode with a system modal window open, and that it hides once -// the user exits tablet mode. +// maximize mode with a system modal window open, and that it hides once +// the user exits maximize mode. TEST_F(OverviewButtonTrayTest, VisibilityChangesForSystemModalWindow) { // TODO(jonross): When CreateTestWindow*() have been unified, use the // appropriate method to replace this setup. (crbug.com/483503) @@ -291,9 +300,11 @@ ParentWindowInPrimaryRootWindow(window.get()); ASSERT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(GetTray()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(GetTray()->visible()); }
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc index 00f402e..b4ed4f18 100644 --- a/ash/system/power/tablet_power_button_controller.cc +++ b/ash/system/power/tablet_power_button_controller.cc
@@ -9,7 +9,7 @@ #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/wm/lock_state_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/time/default_tick_clock.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "ui/events/devices/input_device_manager.h" @@ -41,17 +41,18 @@ // Returns true if device is a convertible/tablet device, otherwise false. bool IsTabletModeSupported() { - TabletModeController* tablet_mode_controller = - Shell::Get()->tablet_mode_controller(); - return tablet_mode_controller && tablet_mode_controller->CanEnterTabletMode(); + MaximizeModeController* maximize_mode_controller = + Shell::Get()->maximize_mode_controller(); + return maximize_mode_controller && + maximize_mode_controller->CanEnterMaximizeMode(); } -// Returns true if device is currently in tablet/tablet mode, otherwise false. +// Returns true if device is currently in tablet/maximize mode, otherwise false. bool IsTabletModeActive() { - TabletModeController* tablet_mode_controller = - Shell::Get()->tablet_mode_controller(); - return tablet_mode_controller && - tablet_mode_controller->IsTabletModeWindowManagerEnabled(); + MaximizeModeController* maximize_mode_controller = + Shell::Get()->maximize_mode_controller(); + return maximize_mode_controller && + maximize_mode_controller->IsMaximizeModeWindowManagerEnabled(); } } // namespace @@ -166,13 +167,13 @@ SetDisplayForcedOff(false); } -void TabletPowerButtonController::OnTabletModeStarted() { +void TabletPowerButtonController::OnMaximizeModeStarted() { shutdown_timer_.Stop(); if (controller_->CanCancelShutdownAnimation()) controller_->CancelShutdownAnimation(); } -void TabletPowerButtonController::OnTabletModeEnded() { +void TabletPowerButtonController::OnMaximizeModeEnded() { shutdown_timer_.Stop(); if (controller_->CanCancelShutdownAnimation()) controller_->CancelShutdownAnimation();
diff --git a/ash/system/power/tablet_power_button_controller.h b/ash/system/power/tablet_power_button_controller.h index d440e68f..69d32cc1 100644 --- a/ash/system/power/tablet_power_button_controller.h +++ b/ash/system/power/tablet_power_button_controller.h
@@ -66,8 +66,8 @@ const base::TimeTicks& timestamp) override; // Overridden from ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // Overridden from ui::EventHandler: void OnKeyEvent(ui::KeyEvent* event) override;
diff --git a/ash/system/power/tablet_power_button_controller_unittest.cc b/ash/system/power/tablet_power_button_controller_unittest.cc index f3ea4a2..a0bfcda 100644 --- a/ash/system/power/tablet_power_button_controller_unittest.cc +++ b/ash/system/power/tablet_power_button_controller_unittest.cc
@@ -16,8 +16,8 @@ #include "ash/test/test_session_controller_client.h" #include "ash/test/test_shell_delegate.h" #include "ash/wm/lock_state_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/power_button_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/memory/ptr_util.h" @@ -112,8 +112,8 @@ SetUserLoggedIn(status != LoginStatus::NOT_LOGGED_IN); } - void EnableTabletMode(bool enabled) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( + void EnableMaximizeMode(bool enabled) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( enabled); } @@ -302,7 +302,7 @@ // For convertible device working on laptop mode, tests keyboard/mouse event // when screen is off. TEST_F(TabletPowerButtonControllerTest, ConvertibleOnLaptopMode) { - EnableTabletMode(false); + EnableMaximizeMode(false); // KeyEvent should SetBacklightsForcedOff(false). PressPowerButton(); @@ -335,8 +335,8 @@ // For convertible device working on tablet mode, keyboard/mouse event should // not SetBacklightsForcedOff(false) when screen is off. -TEST_F(TabletPowerButtonControllerTest, ConvertibleOnTabletMode) { - EnableTabletMode(true); +TEST_F(TabletPowerButtonControllerTest, ConvertibleOnMaximizeMode) { + EnableMaximizeMode(true); PressPowerButton(); ReleasePowerButton(); @@ -389,7 +389,7 @@ ReleasePowerButton(); EXPECT_TRUE(shell_delegate_->IsTouchscreenEnabledInPrefs(true)); - EnableTabletMode(false); + EnableMaximizeMode(false); // KeyEvent on laptop mode when screen is off. PressPowerButton(); ReleasePowerButton(); @@ -414,14 +414,14 @@ // When user switches convertible device between laptop mode and tablet mode, // power button may be pressed and held, which may cause unwanted shutdown. TEST_F(TabletPowerButtonControllerTest, - EnterOrLeaveTabletModeWhilePressingPowerButton) { + EnterOrLeaveMaximizeModeWhilePressingPowerButton) { Initialize(LoginStatus::USER); SetShouldLockScreenAutomatically(true); ASSERT_FALSE(GetLockedState()); power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); EXPECT_TRUE(test_api_->ShutdownTimerIsRunning()); - tablet_controller_->OnTabletModeStarted(); + tablet_controller_->OnMaximizeModeStarted(); EXPECT_FALSE(test_api_->ShutdownTimerIsRunning()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(1500)); power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); @@ -431,7 +431,7 @@ power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); test_api_->TriggerShutdownTimeout(); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); - tablet_controller_->OnTabletModeStarted(); + tablet_controller_->OnMaximizeModeStarted(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(2500)); power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); @@ -440,7 +440,7 @@ power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); EXPECT_TRUE(test_api_->ShutdownTimerIsRunning()); - tablet_controller_->OnTabletModeEnded(); + tablet_controller_->OnMaximizeModeEnded(); EXPECT_FALSE(test_api_->ShutdownTimerIsRunning()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(3500)); power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); @@ -450,7 +450,7 @@ power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); test_api_->TriggerShutdownTimeout(); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); - tablet_controller_->OnTabletModeEnded(); + tablet_controller_->OnMaximizeModeEnded(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(4500)); power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks());
diff --git a/ash/system/rotation/tray_rotation_lock.cc b/ash/system/rotation/tray_rotation_lock.cc index e3254f3..1c6a3e6 100644 --- a/ash/system/rotation/tray_rotation_lock.cc +++ b/ash/system/rotation/tray_rotation_lock.cc
@@ -15,7 +15,7 @@ #include "ash/system/tray/tray_popup_item_style.h" #include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tri_view.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/display/display.h" @@ -29,10 +29,10 @@ namespace { -bool IsTabletModeWindowManagerEnabled() { +bool IsMaximizeModeWindowManagerEnabled() { return Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); } bool IsUserRotationLocked() { @@ -71,8 +71,8 @@ bool PerformAction(const ui::Event& event) override; // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // ScreenOrientationController::Obsever: void OnUserRotationLockChanged() override; @@ -100,9 +100,9 @@ SetInkDropMode(InkDropHostView::InkDropMode::ON); - SetVisible(IsTabletModeWindowManagerEnabled()); + SetVisible(IsMaximizeModeWindowManagerEnabled()); Shell::Get()->AddShellObserver(this); - if (IsTabletModeWindowManagerEnabled()) + if (IsMaximizeModeWindowManagerEnabled()) Shell::Get()->screen_orientation_controller()->AddObserver(this); } @@ -153,13 +153,13 @@ return true; } -void RotationLockDefaultView::OnTabletModeStarted() { +void RotationLockDefaultView::OnMaximizeModeStarted() { Update(); SetVisible(true); Shell::Get()->screen_orientation_controller()->AddObserver(this); } -void RotationLockDefaultView::OnTabletModeEnded() { +void RotationLockDefaultView::OnMaximizeModeEnded() { SetVisible(false); StopObservingRotation(); } @@ -191,13 +191,13 @@ return nullptr; } -void TrayRotationLock::OnTabletModeStarted() { +void TrayRotationLock::OnMaximizeModeStarted() { tray_view()->SetVisible(ShouldBeVisible()); UpdateTrayImage(); Shell::Get()->screen_orientation_controller()->AddObserver(this); } -void TrayRotationLock::OnTabletModeEnded() { +void TrayRotationLock::OnMaximizeModeEnded() { tray_view()->SetVisible(false); StopObservingRotation(); } @@ -219,7 +219,7 @@ } bool TrayRotationLock::ShouldBeVisible() { - return OnPrimaryDisplay() && IsTabletModeWindowManagerEnabled(); + return OnPrimaryDisplay() && IsMaximizeModeWindowManagerEnabled(); } bool TrayRotationLock::OnPrimaryDisplay() const {
diff --git a/ash/system/rotation/tray_rotation_lock.h b/ash/system/rotation/tray_rotation_lock.h index fdfc5a2c..1dbe7a7 100644 --- a/ash/system/rotation/tray_rotation_lock.h +++ b/ash/system/rotation/tray_rotation_lock.h
@@ -32,8 +32,8 @@ views::View* CreateDefaultView(LoginStatus status) override; // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // TrayImageItem: void DestroyTrayView() override; @@ -48,7 +48,7 @@ // Update tray image based on whether user rotation lock is enabled. void UpdateTrayImage(); - // True if |on_primary_display_|, tablet mode is enabled. + // True if |on_primary_display_|, maximize mode is enabled. bool ShouldBeVisible(); // True if this is owned by a SystemTray on the primary display.
diff --git a/ash/system/rotation/tray_rotation_lock_unittest.cc b/ash/system/rotation/tray_rotation_lock_unittest.cc index 703b678..4101e250 100644 --- a/ash/system/rotation/tray_rotation_lock_unittest.cc +++ b/ash/system/rotation/tray_rotation_lock_unittest.cc
@@ -14,7 +14,7 @@ #include "ash/system/tray/system_tray_delegate.h" #include "ash/test/ash_test_base.h" #include "ash/test/status_area_widget_test_helper.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/command_line.h" #include "base/time/time.h" #include "ui/display/display_switches.h" @@ -114,39 +114,45 @@ EXPECT_FALSE(tray_view()->visible()); } -// Tests that when the tray view is created, while TabletMode is active, that -// it must be visible, and becomes invisible exiting TabletMode. -TEST_F(TrayRotationLockTest, CreateTrayViewDuringTabletMode) { +// Tests that when the tray view is created, while MaximizeMode is active, that +// it must be visible, and becomes invisible exiting MaximizeMode. +TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeMode) { TearDownViews(); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); EXPECT_TRUE(tray_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(tray_view()->visible()); } -// Tests that the enabling of TabletMode affects a previously created tray +// Tests that the enabling of MaximizeMode affects a previously created tray // view, changing the visibility. -TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringTabletMode) { +TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) { ASSERT_FALSE(tray_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock(); EXPECT_TRUE(tray_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(tray_view()->visible()); } // Tests that when the tray view is created for a secondary display, that it is -// not visible, and that TabletMode does not affect visibility. +// not visible, and that MaximizeMode does not affect visibility. TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) { UpdateDisplay("400x400,200x200"); SetUpForStatusAreaWidget( StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget()); EXPECT_FALSE(tray_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_FALSE(tray_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(tray_view()->visible()); } @@ -156,23 +162,27 @@ EXPECT_FALSE(default_view()->visible()); } -// Tests that when the default view is created, while TabletMode is active, +// Tests that when the default view is created, while MaximizeMode is active, // that it is visible. -TEST_F(TrayRotationLockTest, CreateDefaultViewDuringTabletMode) { +TEST_F(TrayRotationLockTest, CreateDefaultViewDuringMaximizeMode) { TearDownViews(); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); EXPECT_TRUE(default_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(default_view()->visible()); } -// Tests that the enabling of TabletMode affects a previously created default +// Tests that the enabling of MaximizeMode affects a previously created default // view, changing the visibility. -TEST_F(TrayRotationLockTest, DefaultViewVisibilityChangesDuringTabletMode) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); +TEST_F(TrayRotationLockTest, DefaultViewVisibilityChangesDuringMaximizeMode) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(default_view()->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(default_view()->visible()); } @@ -190,12 +200,12 @@ // Tests that activating the default view causes the display to have its // rotation locked. TEST_F(TrayRotationLockTest, PerformActionOnDefaultView) { - TabletModeController* tablet_mode_controller = - Shell::Get()->tablet_mode_controller(); + MaximizeModeController* maximize_mode_controller = + Shell::Get()->maximize_mode_controller(); ScreenOrientationController* screen_orientation_controller = Shell::Get()->screen_orientation_controller(); ASSERT_FALSE(screen_orientation_controller->rotation_locked()); - tablet_mode_controller->EnableTabletModeWindowManager(true); + maximize_mode_controller->EnableMaximizeModeWindowManager(true); ASSERT_TRUE(tray_view()->visible()); ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), @@ -204,7 +214,7 @@ EXPECT_TRUE(screen_orientation_controller->rotation_locked()); EXPECT_TRUE(tray_view()->visible()); - tablet_mode_controller->EnableTabletModeWindowManager(false); + maximize_mode_controller->EnableMaximizeModeWindowManager(false); } // Tests that when the tray is created without the internal display being known, @@ -222,18 +232,22 @@ std::unique_ptr<views::View> default_view(tray->CreateDefaultView( StatusAreaWidgetTestHelper::GetUserLoginStatus())); EXPECT_TRUE(default_view); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(default_view->visible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } // Tests that when the tray view is deleted, while TrayRotationLock has not been // deleted, that updates to the rotation lock state do not crash. TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); DestroyTrayView(); Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock(); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); } } // namespace ash
diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc index 6a5122a7..ab68c185 100644 --- a/ash/system/screen_layout_observer.cc +++ b/ash/system/screen_layout_observer.cc
@@ -19,7 +19,7 @@ #include "ash/system/system_notifier.h" #include "ash/system/tray/system_tray_controller.h" #include "ash/system/tray/tray_constants.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/bind.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -282,8 +282,8 @@ } // c) if the device is in tablet mode, and source is not user. if (Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled() && + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled() && iter.second.active_rotation_source() != display::Display::ROTATION_SOURCE_USER) { continue;
diff --git a/ash/system/screen_layout_observer_unittest.cc b/ash/system/screen_layout_observer_unittest.cc index dd2d9ec..08e71ff 100644 --- a/ash/system/screen_layout_observer_unittest.cc +++ b/ash/system/screen_layout_observer_unittest.cc
@@ -10,7 +10,7 @@ #include "ash/system/tray/system_tray.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_system_tray_delegate.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -468,7 +468,8 @@ GetDisplayNotificationAdditionalText()); // Switch to Tablet - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); // The accelerometer source. display_manager()->SetDisplayRotation(
diff --git a/ash/system/supervised/tray_supervised_user.cc b/ash/system/supervised/tray_supervised_user.cc index d725ec8..c9cc151 100644 --- a/ash/system/supervised/tray_supervised_user.cc +++ b/ash/system/supervised/tray_supervised_user.cc
@@ -76,7 +76,7 @@ DCHECK(user_session); // Only respond to updates for the active user. - if (user_session->account_id != account_id) + if (user_session->user_info->account_id != account_id) return; // Show notifications when custodian data first becomes available on login
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index e1e90c8..04517be 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc
@@ -206,7 +206,7 @@ const mojom::UserSession* const user_session = session_controller->GetUserSession(0); - avatar_->SetImage(user_session->avatar, + avatar_->SetImage(user_session->user_info->avatar, gfx::Size(kTrayItemSize, kTrayItemSize)); // Unit tests might come here with no images for some users.
diff --git a/ash/system/user/tray_user_unittest.cc b/ash/system/user/tray_user_unittest.cc index 5ceda02..82918c5 100644 --- a/ash/system/user/tray_user_unittest.cc +++ b/ash/system/user/tray_user_unittest.cc
@@ -257,10 +257,12 @@ RunAllPendingInMessageLoop(); const mojom::UserSession* active_user = controller()->GetUserSession(0); - EXPECT_EQ(active_user->account_id, second_user->account_id); + EXPECT_EQ(active_user->user_info->account_id, + second_user->user_info->account_id); // Since the name is capitalized, the email should be different than the // user_id. - EXPECT_NE(active_user->account_id.GetUserEmail(), second_user->display_email); + EXPECT_NE(active_user->user_info->account_id.GetUserEmail(), + second_user->user_info->display_email); tray()->CloseSystemBubble(); } @@ -275,7 +277,7 @@ const gfx::ImageSkia red_icon = CreateImageSkiaWithColor(kTrayItemSize, kTrayItemSize, SK_ColorRED); mojom::UserSessionPtr user = controller()->GetUserSession(0)->Clone(); - user->avatar = red_icon; + user->user_info->avatar = red_icon; controller()->UpdateUserSession(std::move(user)); EXPECT_TRUE(gfx::test::AreImagesEqual( gfx::Image(red_icon),
diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc index 9bbbec5..0cd6512 100644 --- a/ash/system/user/user_card_view.cc +++ b/ash/system/user/user_card_view.cc
@@ -65,8 +65,9 @@ image_view->SetImage(icon, icon.size()); } else { SessionController* controller = Shell::Get()->session_controller(); - image_view->SetImage(controller->GetUserSession(user_index)->avatar, - gfx::Size(kTrayItemSize, kTrayItemSize)); + image_view->SetImage( + controller->GetUserSession(user_index)->user_info->avatar, + gfx::Size(kTrayItemSize, kTrayItemSize)); } image_view->SetBorder(views::CreateEmptyBorder(gfx::Insets( @@ -116,8 +117,11 @@ // Retrieve the user's display name and wrap it with markers. // Note that since this is a public account it always has to be the primary // user. - base::string16 display_name = base::UTF8ToUTF16( - Shell::Get()->session_controller()->GetUserSession(0)->display_name); + base::string16 display_name = + base::UTF8ToUTF16(Shell::Get() + ->session_controller() + ->GetUserSession(0) + ->user_info->display_name); base::RemoveChars(display_name, kDisplayNameMark, &display_name); display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0]; // Retrieve the domain managing the device and wrap it with markers. @@ -382,8 +386,8 @@ base::string16 user_name_string = login_status == LoginStatus::GUEST ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_GUEST_LABEL) - : base::UTF8ToUTF16( - controller->GetUserSession(user_index_)->display_name); + : base::UTF8ToUTF16(controller->GetUserSession(user_index_) + ->user_info->display_name); user_name_ = new views::Label(user_name_string); user_name_->SetHorizontalAlignment(gfx::ALIGN_LEFT); TrayPopupItemStyle user_name_style( @@ -398,8 +402,8 @@ user_email_string = Shell::Get()->session_controller()->IsUserSupervised() ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) - : base::UTF8ToUTF16( - controller->GetUserSession(user_index_)->display_email); + : base::UTF8ToUTF16(controller->GetUserSession(user_index_) + ->user_info->display_email); } user_email->SetText(user_email_string); user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT);
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index f61be38c..f45abed 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc
@@ -65,7 +65,7 @@ MultiProfileUMA::RecordSwitchActiveUser( MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY); controller->SwitchActiveUser( - controller->GetUserSession(user_index)->account_id); + controller->GetUserSession(user_index)->user_info->account_id); } bool IsMultiProfileSupportedAndUserActive() {
diff --git a/ash/test/shell_test_api.h b/ash/test/shell_test_api.h index c5e0817c..f1eb5d4 100644 --- a/ash/test/shell_test_api.h +++ b/ash/test/shell_test_api.h
@@ -12,7 +12,7 @@ namespace ash { class AshNativeCursorManager; class DragDropController; -class TabletModeWindowManager; +class MaximizeModeWindowManager; class PaletteDelegate; class SessionStateDelegate; class ScreenPositionController; @@ -33,7 +33,7 @@ ScreenPositionController* screen_position_controller(); AshNativeCursorManager* ash_native_cursor_manager(); DragDropController* drag_drop_controller(); - TabletModeWindowManager* tablet_mode_window_manager(); + MaximizeModeWindowManager* maximize_mode_window_manager(); void SetPaletteDelegate(std::unique_ptr<PaletteDelegate> palette_delegate); void SetSessionStateDelegate(SessionStateDelegate* session_state_delegate);
diff --git a/ash/test/test_session_controller_client.cc b/ash/test/test_session_controller_client.cc index 19f98b7..8b9fc481 100644 --- a/ash/test/test_session_controller_client.cc +++ b/ash/test/test_session_controller_client.cc
@@ -101,11 +101,12 @@ bool enable_settings) { mojom::UserSessionPtr session = mojom::UserSession::New(); session->session_id = ++fake_session_id_; - session->type = user_type; - session->account_id = + session->user_info = mojom::UserInfo::New(); + session->user_info->type = user_type; + session->user_info->account_id = AccountId::FromUserEmail(GetUserIdFromEmail(display_email)); - session->display_name = "Über tray Über tray Über tray Über tray"; - session->display_email = display_email; + session->user_info->display_name = "Über tray Über tray Über tray Über tray"; + session->user_info->display_email = display_email; session->should_enable_settings = enable_settings; session->should_show_notification_tray = true; controller_->UpdateUserSession(std::move(session)); @@ -125,7 +126,7 @@ session_order.reserve(controller_->GetUserSessions().size()); for (const auto& user_session : controller_->GetUserSessions()) { - if (user_session->account_id == account_id) { + if (user_session->user_info->account_id == account_id) { session_order.insert(session_order.begin(), user_session->session_id); } else { session_order.push_back(user_session->session_id); @@ -173,7 +174,7 @@ return; } - SwitchActiveUser((*it)->account_id); + SwitchActiveUser((*it)->user_info->account_id); } } // namespace test
diff --git a/ash/virtual_keyboard_controller.cc b/ash/virtual_keyboard_controller.cc index d13dffb..2d1443c 100644 --- a/ash/virtual_keyboard_controller.cc +++ b/ash/virtual_keyboard_controller.cc
@@ -10,7 +10,7 @@ #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_notifier.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_util.h" #include "ash/wm_window.h" #include "base/command_line.h" @@ -79,7 +79,7 @@ ui::InputDeviceManager::GetInstance()->RemoveObserver(this); } -void VirtualKeyboardController::OnTabletModeStarted() { +void VirtualKeyboardController::OnMaximizeModeStarted() { if (!IsSmartVirtualKeyboardEnabled()) { SetKeyboardEnabled(true); } else { @@ -87,7 +87,7 @@ } } -void VirtualKeyboardController::OnTabletModeEnded() { +void VirtualKeyboardController::OnMaximizeModeEnded() { if (!IsSmartVirtualKeyboardEnabled()) { SetKeyboardEnabled(false); } else { @@ -182,13 +182,13 @@ void VirtualKeyboardController::UpdateKeyboardEnabled() { if (!IsSmartVirtualKeyboardEnabled()) { SetKeyboardEnabled(Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()); return; } bool ignore_internal_keyboard = Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); bool is_internal_keyboard_active = has_internal_keyboard_ && !ignore_internal_keyboard; SetKeyboardEnabled(!is_internal_keyboard_active && has_touchscreen_ &&
diff --git a/ash/virtual_keyboard_controller.h b/ash/virtual_keyboard_controller.h index 240aa37..20c6e02 100644 --- a/ash/virtual_keyboard_controller.h +++ b/ash/virtual_keyboard_controller.h
@@ -26,8 +26,8 @@ // ShellObserver: // TODO(rsadam@): Remove when autovirtual keyboard flag is on by default. - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // ui::InputDeviceObserver: void OnTouchscreenDeviceConfigurationChanged() override;
diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc index 220a1444..3956022 100644 --- a/ash/virtual_keyboard_controller_unittest.cc +++ b/ash/virtual_keyboard_controller_unittest.cc
@@ -11,8 +11,8 @@ #include "ash/system/tray/system_tray_notifier.h" #include "ash/system/virtual_keyboard/virtual_keyboard_observer.h" #include "ash/test/ash_test_base.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" #include "base/command_line.h" #include "ui/events/devices/device_data_manager.h" #include "ui/events/devices/device_hotplug_event_observer.h" @@ -46,7 +46,8 @@ // Sets the event blocker on the maximized window controller. void SetEventBlocker( std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) { - Shell::Get()->tablet_mode_controller()->event_blocker_ = std::move(blocker); + Shell::Get()->maximize_mode_controller()->event_blocker_ = + std::move(blocker); } void SetUp() override { @@ -80,8 +81,9 @@ // Tests that reenabling keyboard devices while shutting down does not // cause the Virtual Keyboard Controller to crash. See crbug.com/446204. TEST_F(VirtualKeyboardControllerTest, RestoreKeyboardDevices) { - // Toggle tablet mode on. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + // Toggle maximized mode on. + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker( new MockEventBlocker); SetEventBlocker(std::move(blocker)); @@ -132,7 +134,7 @@ }; // Tests that the onscreen keyboard is disabled if an internal keyboard is -// present and tablet mode is disabled. +// present and maximized mode is disabled. TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) { std::vector<ui::TouchscreenDevice> screens; screens.push_back( @@ -212,8 +214,8 @@ ASSERT_FALSE(keyboard::IsKeyboardEnabled()); } -// Tests tablet mode interaction without disabling the internal keyboard. -TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringTabletMode) { +// Tests maximized mode interaction without disabling the internal keyboard. +TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringMaximizeMode) { std::vector<ui::TouchscreenDevice> screens; screens.push_back( ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, @@ -224,15 +226,17 @@ 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); UpdateKeyboardDevices(keyboard_devices); ASSERT_FALSE(keyboard::IsKeyboardEnabled()); - // Toggle tablet mode on. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + // Toggle maximized mode on. + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); ASSERT_TRUE(keyboard::IsKeyboardEnabled()); - // Toggle tablet mode off. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + // Toggle maximized mode off. + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); ASSERT_FALSE(keyboard::IsKeyboardEnabled()); } -// Tests that keyboard gets suppressed in tablet mode. +// Tests that keyboard gets suppressed in maximized mode. TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) { std::vector<ui::TouchscreenDevice> screens; screens.push_back( @@ -245,8 +249,9 @@ keyboard_devices.push_back(ui::InputDevice( 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard")); UpdateKeyboardDevices(keyboard_devices); - // Toggle tablet mode on. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + // Toggle maximized mode on. + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); ASSERT_FALSE(keyboard::IsKeyboardEnabled()); ASSERT_TRUE(notified()); ASSERT_TRUE(IsVirtualKeyboardSuppressed()); @@ -270,8 +275,9 @@ ASSERT_TRUE(keyboard::IsKeyboardEnabled()); ASSERT_TRUE(notified()); ASSERT_FALSE(IsVirtualKeyboardSuppressed()); - // Toggle tablet mode oFF. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + // Toggle maximized mode oFF. + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); ASSERT_FALSE(keyboard::IsKeyboardEnabled()); }
diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc index 88495b2..e2111158 100644 --- a/ash/wm/lock_state_controller_unittest.cc +++ b/ash/wm/lock_state_controller_unittest.cc
@@ -17,9 +17,9 @@ #include "ash/test/test_session_controller_client.h" #include "ash/test/test_session_state_animator.h" #include "ash/test/test_shell_delegate.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/power_button_controller.h" #include "ash/wm/session_state_animator.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/memory/ptr_util.h" #include "base/memory/scoped_vector.h" #include "base/time/time.h" @@ -327,8 +327,8 @@ GetSessionControllerClient()->UnlockScreen(); } - void EnableTabletMode(bool enable) { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( + void EnableMaximizeMode(bool enable) { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( enable); } @@ -1035,9 +1035,9 @@ test::TestScreenshotDelegate* delegate = GetScreenshotDelegate(); delegate->set_can_take_screenshot(true); - EnableTabletMode(false); + EnableMaximizeMode(false); - // Screenshot handling should not be active when not in tablet mode. + // Screenshot handling should not be active when not in maximize mode. ASSERT_EQ(0, delegate->handle_take_screenshot_count()); PressVolumeDown(); PressPowerButton(); @@ -1045,7 +1045,7 @@ ReleaseVolumeDown(); EXPECT_EQ(0, delegate->handle_take_screenshot_count()); - EnableTabletMode(true); + EnableMaximizeMode(true); // Pressing power alone does not take a screenshot. PressPowerButton();
diff --git a/ash/wm/tablet_mode/OWNERS b/ash/wm/maximize_mode/OWNERS similarity index 100% rename from ash/wm/tablet_mode/OWNERS rename to ash/wm/maximize_mode/OWNERS
diff --git a/ash/wm/tablet_mode/accelerometer_test_data_literals.cc b/ash/wm/maximize_mode/accelerometer_test_data_literals.cc similarity index 100% rename from ash/wm/tablet_mode/accelerometer_test_data_literals.cc rename to ash/wm/maximize_mode/accelerometer_test_data_literals.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.cc b/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.cc new file mode 100644 index 0000000..7330564 --- /dev/null +++ b/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.cc
@@ -0,0 +1,17 @@ +// 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. + +#include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h" + +namespace ash { + +MaximizeModeBackdropDelegateImpl::MaximizeModeBackdropDelegateImpl() = default; + +MaximizeModeBackdropDelegateImpl::~MaximizeModeBackdropDelegateImpl() = default; + +bool MaximizeModeBackdropDelegateImpl::HasBackdrop(aura::Window* window) { + return true; +} + +} // namespace ash
diff --git a/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h b/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h new file mode 100644 index 0000000..010b9ec --- /dev/null +++ b/ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h
@@ -0,0 +1,27 @@ +// 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. + +#include "ash/wm/workspace/backdrop_delegate.h" + +#include "ash/ash_export.h" +#include "base/macros.h" + +namespace ash { + +// A backdrop delegate for MaximizedMode, which always creates a backdrop. +// This is also used in the WorkspaceLayoutManagerBackdropTest, hence +// is public. +class ASH_EXPORT MaximizeModeBackdropDelegateImpl : public BackdropDelegate { + public: + MaximizeModeBackdropDelegateImpl(); + ~MaximizeModeBackdropDelegateImpl() override; + + protected: + bool HasBackdrop(aura::Window* window) override; + + private: + DISALLOW_COPY_AND_ASSIGN(MaximizeModeBackdropDelegateImpl); +}; + +} // namespace ash
diff --git a/ash/wm/tablet_mode/tablet_mode_controller.cc b/ash/wm/maximize_mode/maximize_mode_controller.cc similarity index 71% rename from ash/wm/tablet_mode/tablet_mode_controller.cc rename to ash/wm/maximize_mode/maximize_mode_controller.cc index 5525e463..39b21cd 100644 --- a/ash/wm/tablet_mode/tablet_mode_controller.cc +++ b/ash/wm/maximize_mode/maximize_mode_controller.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include <utility> #include "ash/ash_switches.h" #include "ash/shell.h" #include "ash/shell_port.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" -#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" #include "base/bind.h" #include "base/command_line.h" #include "base/metrics/histogram_macros.h" @@ -28,12 +28,12 @@ namespace { -// The hinge angle at which to enter tablet mode. -const float kEnterTabletModeAngle = 200.0f; +// The hinge angle at which to enter maximize mode. +const float kEnterMaximizeModeAngle = 200.0f; -// The angle at which to exit tablet mode, this is specifically less than the -// angle to enter tablet mode to prevent rapid toggling when near the angle. -const float kExitTabletModeAngle = 160.0f; +// The angle at which to exit maximize mode, this is specifically less than the +// angle to enter maximize mode to prevent rapid toggling when near the angle. +const float kExitMaximizeModeAngle = 160.0f; // Defines a range for which accelerometer readings are considered accurate. // When the lid is near open (or near closed) the accelerometer readings may be @@ -43,7 +43,7 @@ const float kMaxStableAngle = 340.0f; // The time duration to consider the lid to be recently opened. -// This is used to prevent entering tablet mode if an erroneous accelerometer +// This is used to prevent entering maximize mode if an erroneous accelerometer // reading makes the lid appear to be fully open when the user is opening the // lid from a closed position. const int kLidRecentlyOpenedDurationSeconds = 2; @@ -85,25 +85,25 @@ switches::kAshEnableTouchView); } -// Checks the command line to see which force tablet mode is turned on, if +// Checks the command line to see which force maximize mode is turned on, if // any. -TabletModeController::ForceTabletMode GetTabletMode() { +MaximizeModeController::ForceTabletMode GetMaximizeMode() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAshForceTabletMode)) { std::string switch_value = command_line->GetSwitchValueASCII(switches::kAshForceTabletMode); if (switch_value == switches::kAshForceTabletModeClamshell) - return TabletModeController::ForceTabletMode::CLAMSHELL; + return MaximizeModeController::ForceTabletMode::CLAMSHELL; if (switch_value == switches::kAshForceTabletModeTouchView) - return TabletModeController::ForceTabletMode::TOUCHVIEW; + return MaximizeModeController::ForceTabletMode::TOUCHVIEW; } - return TabletModeController::ForceTabletMode::NONE; + return MaximizeModeController::ForceTabletMode::NONE; } } // namespace -TabletModeController::TabletModeController() +MaximizeModeController::MaximizeModeController() : have_seen_accelerometer_data_(false), can_detect_lid_angle_(false), touchview_usage_interval_start_time_(base::Time::Now()), @@ -116,9 +116,9 @@ ShellPort::Get()->RecordUserMetricsAction( UMA_MAXIMIZE_MODE_INITIALLY_DISABLED); - // TODO(jonross): Do not create TabletModeController if the flag is + // TODO(jonross): Do not create MaximizeModeController if the flag is // unavailable. This will require refactoring - // IsTabletModeWindowManagerEnabled to check for the existance of the + // IsMaximizeModeWindowManagerEnabled to check for the existance of the // controller. if (IsEnabled()) { ShellPort::Get()->AddDisplayObserver(this); @@ -128,10 +128,10 @@ chromeos::DBusThreadManager::Get()->GetPowerManagerClient(); power_manager_client->AddObserver(this); power_manager_client->GetSwitchStates(base::Bind( - &TabletModeController::OnGetSwitchStates, weak_factory_.GetWeakPtr())); + &MaximizeModeController::OnGetSwitchStates, weak_factory_.GetWeakPtr())); } -TabletModeController::~TabletModeController() { +MaximizeModeController::~MaximizeModeController() { Shell::Get()->RemoveShellObserver(this); if (IsEnabled()) { @@ -142,37 +142,38 @@ this); } -bool TabletModeController::CanEnterTabletMode() { +bool MaximizeModeController::CanEnterMaximizeMode() { // If we have ever seen accelerometer data, then HandleHingeRotation may - // trigger tablet mode at some point in the future. - // All TouchView-enabled devices can enter tablet mode. + // trigger maximize mode at some point in the future. + // All TouchView-enabled devices can enter maximized mode. return have_seen_accelerometer_data_ || IsEnabled(); } -// TODO(jcliang): Hide or remove EnableTabletModeWindowManager +// TODO(jcliang): Hide or remove EnableMaximizeModeWindowManager // (http://crbug.com/620241). -void TabletModeController::EnableTabletModeWindowManager(bool should_enable) { - bool is_enabled = !!tablet_mode_window_manager_.get(); +void MaximizeModeController::EnableMaximizeModeWindowManager( + bool should_enable) { + bool is_enabled = !!maximize_mode_window_manager_.get(); if (should_enable == is_enabled) return; if (should_enable) { - tablet_mode_window_manager_.reset(new TabletModeWindowManager()); - // TODO(jonross): Move the tablet mode notifications from ShellObserver - // to TabletModeController::Observer + maximize_mode_window_manager_.reset(new MaximizeModeWindowManager()); + // TODO(jonross): Move the maximize mode notifications from ShellObserver + // to MaximizeModeController::Observer ShellPort::Get()->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED); - Shell::Get()->NotifyTabletModeStarted(); + Shell::Get()->NotifyMaximizeModeStarted(); observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) { observer->OnTouchViewToggled(true); }); } else { - tablet_mode_window_manager_->SetIgnoreWmEventsForExit(); - Shell::Get()->NotifyTabletModeEnding(); - tablet_mode_window_manager_.reset(); + maximize_mode_window_manager_->SetIgnoreWmEventsForExit(); + Shell::Get()->NotifyMaximizeModeEnding(); + maximize_mode_window_manager_.reset(); ShellPort::Get()->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED); - Shell::Get()->NotifyTabletModeEnded(); + Shell::Get()->NotifyMaximizeModeEnded(); observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) { observer->OnTouchViewToggled(false); @@ -180,22 +181,23 @@ } } -bool TabletModeController::IsTabletModeWindowManagerEnabled() const { - return tablet_mode_window_manager_.get() != NULL; +bool MaximizeModeController::IsMaximizeModeWindowManagerEnabled() const { + return maximize_mode_window_manager_.get() != NULL; } -void TabletModeController::AddWindow(aura::Window* window) { - if (IsTabletModeWindowManagerEnabled()) - tablet_mode_window_manager_->AddWindow(window); +void MaximizeModeController::AddWindow(aura::Window* window) { + if (IsMaximizeModeWindowManagerEnabled()) + maximize_mode_window_manager_->AddWindow(window); } -void TabletModeController::BindRequest(mojom::TouchViewManagerRequest request) { +void MaximizeModeController::BindRequest( + mojom::TouchViewManagerRequest request) { bindings_.AddBinding(this, std::move(request)); } -void TabletModeController::OnAccelerometerUpdated( +void MaximizeModeController::OnAccelerometerUpdated( scoped_refptr<const chromeos::AccelerometerUpdate> update) { - if (!AllowEnterExitTabletMode()) + if (!AllowEnterExitMaximizeMode()) return; have_seen_accelerometer_data_ = true; @@ -214,8 +216,8 @@ return; } - // Whether or not we enter tablet mode affects whether we handle screen - // rotation, so determine whether to enter tablet mode first. + // Whether or not we enter maximize mode affects whether we handle screen + // rotation, so determine whether to enter maximize mode first. if (ui::IsAccelerometerReadingStable(*update, chromeos::ACCELEROMETER_SOURCE_SCREEN) && ui::IsAccelerometerReadingStable( @@ -229,23 +231,23 @@ } } -void TabletModeController::LidEventReceived( +void MaximizeModeController::LidEventReceived( chromeos::PowerManagerClient::LidState state, const base::TimeTicks& time) { - if (!AllowEnterExitTabletMode()) + if (!AllowEnterExitMaximizeMode()) return; const bool open = state == chromeos::PowerManagerClient::LidState::OPEN; if (open) last_lid_open_time_ = time; lid_is_closed_ = !open; - LeaveTabletMode(); + LeaveMaximizeMode(); } -void TabletModeController::TabletModeEventReceived( +void MaximizeModeController::TabletModeEventReceived( chromeos::PowerManagerClient::TabletMode mode, const base::TimeTicks& time) { - if (!AllowEnterExitTabletMode()) + if (!AllowEnterExitMaximizeMode()) return; const bool on = mode == chromeos::PowerManagerClient::TabletMode::ON; @@ -257,28 +259,29 @@ return; } // The tablet mode switch activates at 300 degrees, so it is always reliable - // when |on|. However we wish to exit tablet mode at a smaller angle, so + // when |on|. However we wish to exit maximize mode at a smaller angle, so // when |on| is false we ignore if it is possible to calculate the lid angle. - if (on && !IsTabletModeWindowManagerEnabled()) { - EnterTabletMode(); - } else if (!on && IsTabletModeWindowManagerEnabled() && + if (on && !IsMaximizeModeWindowManagerEnabled()) { + EnterMaximizeMode(); + } else if (!on && IsMaximizeModeWindowManagerEnabled() && !can_detect_lid_angle_) { - LeaveTabletMode(); + LeaveMaximizeMode(); } } -void TabletModeController::SuspendImminent() { +void MaximizeModeController::SuspendImminent() { // The system is about to suspend, so record TouchView usage interval metrics // based on whether TouchView mode is currently active. RecordTouchViewUsageInterval(CurrentTouchViewIntervalType()); } -void TabletModeController::SuspendDone(const base::TimeDelta& sleep_duration) { +void MaximizeModeController::SuspendDone( + const base::TimeDelta& sleep_duration) { // We do not want TouchView usage metrics to include time spent in suspend. touchview_usage_interval_start_time_ = base::Time::Now(); } -void TabletModeController::HandleHingeRotation( +void MaximizeModeController::HandleHingeRotation( scoped_refptr<const chromeos::AccelerometerUpdate> update) { static const gfx::Vector3dF hinge_vector(1.0f, 0.0f, 0.0f); gfx::Vector3dF base_reading(ui::ConvertAccelerometerReadingToVector3dF( @@ -335,71 +338,72 @@ if (is_angle_stable) last_lid_open_time_ = base::TimeTicks(); - // Toggle tablet mode on or off when corresponding thresholds are passed. - if (IsTabletModeWindowManagerEnabled() && is_angle_stable && - lid_angle <= kExitTabletModeAngle) { - LeaveTabletMode(); - } else if (!IsTabletModeWindowManagerEnabled() && !lid_is_closed_ && - lid_angle >= kEnterTabletModeAngle && + // Toggle maximize mode on or off when corresponding thresholds are passed. + if (IsMaximizeModeWindowManagerEnabled() && is_angle_stable && + lid_angle <= kExitMaximizeModeAngle) { + LeaveMaximizeMode(); + } else if (!IsMaximizeModeWindowManagerEnabled() && !lid_is_closed_ && + lid_angle >= kEnterMaximizeModeAngle && (is_angle_stable || !WasLidOpenedRecently())) { - EnterTabletMode(); + EnterMaximizeMode(); } } -void TabletModeController::EnterTabletMode() { +void MaximizeModeController::EnterMaximizeMode() { // Always reset first to avoid creation before destruction of a previous // object. event_blocker_ = ShellPort::Get()->CreateScopedDisableInternalMouseAndKeyboard(); - if (IsTabletModeWindowManagerEnabled()) + if (IsMaximizeModeWindowManagerEnabled()) return; - EnableTabletModeWindowManager(true); + EnableMaximizeModeWindowManager(true); } -void TabletModeController::LeaveTabletMode() { +void MaximizeModeController::LeaveMaximizeMode() { event_blocker_.reset(); - if (!IsTabletModeWindowManagerEnabled()) + if (!IsMaximizeModeWindowManagerEnabled()) return; - EnableTabletModeWindowManager(false); + EnableMaximizeModeWindowManager(false); } -// Called after tablet mode has started, windows might still animate though. -void TabletModeController::OnTabletModeStarted() { +// Called after maximize mode has started, windows might still animate though. +void MaximizeModeController::OnMaximizeModeStarted() { RecordTouchViewUsageInterval(TOUCH_VIEW_INTERVAL_INACTIVE); } -// Called after tablet mode has ended, windows might still be returning to +// Called after maximize mode has ended, windows might still be returning to // their original position. -void TabletModeController::OnTabletModeEnded() { +void MaximizeModeController::OnMaximizeModeEnded() { RecordTouchViewUsageInterval(TOUCH_VIEW_INTERVAL_ACTIVE); } -void TabletModeController::OnShellInitialized() { - force_tablet_mode_ = GetTabletMode(); +void MaximizeModeController::OnShellInitialized() { + force_tablet_mode_ = GetMaximizeMode(); if (force_tablet_mode_ == ForceTabletMode::TOUCHVIEW) - EnterTabletMode(); + EnterMaximizeMode(); } -void TabletModeController::OnDisplayConfigurationChanged() { +void MaximizeModeController::OnDisplayConfigurationChanged() { if (!display::Display::HasInternalDisplay() || !ShellPort::Get()->IsActiveDisplayId( display::Display::InternalDisplayId())) { - LeaveTabletMode(); - } else if (tablet_mode_switch_is_on_ && !IsTabletModeWindowManagerEnabled()) { + LeaveMaximizeMode(); + } else if (tablet_mode_switch_is_on_ && + !IsMaximizeModeWindowManagerEnabled()) { // The internal display has returned, as we are exiting docked mode. - // The device is still in tablet mode, so trigger tablet mode, as this + // The device is still in tablet mode, so trigger maximize mode, as this // switch leads to the ignoring of accelerometer events. When the switch is // not set the next stable accelerometer readings will trigger maximize // mode. - EnterTabletMode(); + EnterMaximizeMode(); } } -void TabletModeController::RecordTouchViewUsageInterval( +void MaximizeModeController::RecordTouchViewUsageInterval( TouchViewIntervalType type) { - if (!CanEnterTabletMode()) + if (!CanEnterMaximizeMode()) return; base::Time current_time = base::Time::Now(); @@ -418,28 +422,28 @@ touchview_usage_interval_start_time_ = current_time; } -TabletModeController::TouchViewIntervalType -TabletModeController::CurrentTouchViewIntervalType() { - if (IsTabletModeWindowManagerEnabled()) +MaximizeModeController::TouchViewIntervalType +MaximizeModeController::CurrentTouchViewIntervalType() { + if (IsMaximizeModeWindowManagerEnabled()) return TOUCH_VIEW_INTERVAL_ACTIVE; return TOUCH_VIEW_INTERVAL_INACTIVE; } -void TabletModeController::AddObserver(mojom::TouchViewObserverPtr observer) { - observer->OnTouchViewToggled(IsTabletModeWindowManagerEnabled()); +void MaximizeModeController::AddObserver(mojom::TouchViewObserverPtr observer) { + observer->OnTouchViewToggled(IsMaximizeModeWindowManagerEnabled()); observers_.AddPtr(std::move(observer)); } -bool TabletModeController::AllowEnterExitTabletMode() const { +bool MaximizeModeController::AllowEnterExitMaximizeMode() const { return force_tablet_mode_ == ForceTabletMode::NONE; } -void TabletModeController::OnChromeTerminating() { +void MaximizeModeController::OnChromeTerminating() { // The system is about to shut down, so record TouchView usage interval // metrics based on whether TouchView mode is currently active. RecordTouchViewUsageInterval(CurrentTouchViewIntervalType()); - if (CanEnterTabletMode()) { + if (CanEnterMaximizeMode()) { UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchView.TouchViewActiveTotal", total_touchview_time_.InMinutes(), 1, base::TimeDelta::FromDays(7).InMinutes(), 50); @@ -456,14 +460,14 @@ } } -void TabletModeController::OnGetSwitchStates( +void MaximizeModeController::OnGetSwitchStates( chromeos::PowerManagerClient::LidState lid_state, chromeos::PowerManagerClient::TabletMode tablet_mode) { LidEventReceived(lid_state, base::TimeTicks::Now()); TabletModeEventReceived(tablet_mode, base::TimeTicks::Now()); } -bool TabletModeController::WasLidOpenedRecently() const { +bool MaximizeModeController::WasLidOpenedRecently() const { if (last_lid_open_time_.is_null()) return false; @@ -473,7 +477,7 @@ return elapsed_time.InSeconds() <= kLidRecentlyOpenedDurationSeconds; } -void TabletModeController::SetTickClockForTest( +void MaximizeModeController::SetTickClockForTest( std::unique_ptr<base::TickClock> tick_clock) { DCHECK(tick_clock_); tick_clock_ = std::move(tick_clock);
diff --git a/ash/wm/tablet_mode/tablet_mode_controller.h b/ash/wm/maximize_mode/maximize_mode_controller.h similarity index 74% rename from ash/wm/tablet_mode/tablet_mode_controller.h rename to ash/wm/maximize_mode/maximize_mode_controller.h index 8df527a..7ce9549 100644 --- a/ash/wm/tablet_mode/tablet_mode_controller.h +++ b/ash/wm/maximize_mode/maximize_mode_controller.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_ +#ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ +#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ #include <memory> @@ -37,20 +37,20 @@ namespace ash { -class TabletModeControllerTest; +class MaximizeModeControllerTest; class ScopedDisableInternalMouseAndKeyboard; -class TabletModeWindowManager; -class TabletModeWindowManagerTest; +class MaximizeModeWindowManager; +class MaximizeModeWindowManagerTest; namespace test { class MultiUserWindowManagerChromeOSTest; class VirtualKeyboardControllerTest; } -// TabletModeController listens to accelerometer events and automatically -// enters and exits tablet mode when the lid is opened beyond the triggering -// angle and rotates the display to match the device when in tablet mode. -class ASH_EXPORT TabletModeController +// MaximizeModeController listens to accelerometer events and automatically +// enters and exits maximize mode when the lid is opened beyond the triggering +// angle and rotates the display to match the device when in maximize mode. +class ASH_EXPORT MaximizeModeController : public chromeos::AccelerometerReader::Observer, public chromeos::PowerManagerClient::Observer, NON_EXPORTED_BASE(public mojom::TouchViewManager), @@ -66,36 +66,36 @@ TOUCHVIEW, }; - TabletModeController(); - ~TabletModeController() override; + MaximizeModeController(); + ~MaximizeModeController() override; - // True if it is possible to enter tablet mode in the current + // True if it is possible to enter maximize mode in the current // configuration. If this returns false, it should never be the case that - // tablet mode becomes enabled. - bool CanEnterTabletMode(); + // maximize mode becomes enabled. + bool CanEnterMaximizeMode(); - // TODO(jonross): Merge this with EnterTabletMode. Currently these are + // TODO(jonross): Merge this with EnterMaximizeMode. Currently these are // separate for several reasons: there is no internal display when running // unittests; the event blocker prevents keyboard input when running ChromeOS // on linux. http://crbug.com/362881 - // Turn the always tablet mode window manager on or off. - void EnableTabletModeWindowManager(bool should_enable); + // Turn the always maximize mode window manager on or off. + void EnableMaximizeModeWindowManager(bool should_enable); - // Test if the TabletModeWindowManager is enabled or not. - bool IsTabletModeWindowManagerEnabled() const; + // Test if the MaximizeModeWindowManager is enabled or not. + bool IsMaximizeModeWindowManagerEnabled() const; - // Add a special window to the TabletModeWindowManager for tracking. This is + // Add a special window to the MaximizeModeWindowManager for tracking. This is // only required for special windows which are handled by other window // managers like the |MultiUserWindowManager|. - // If the tablet mode is not enabled no action will be performed. + // If the maximize mode is not enabled no action will be performed. void AddWindow(aura::Window* window); // Binds the mojom::TouchViewManager interface request to this object. void BindRequest(mojom::TouchViewManagerRequest request); // ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; void OnShellInitialized() override; // WmDisplayObserver: @@ -117,8 +117,8 @@ void SuspendDone(const base::TimeDelta& sleep_duration) override; private: - friend class TabletModeControllerTest; - friend class TabletModeWindowManagerTest; + friend class MaximizeModeControllerTest; + friend class MaximizeModeWindowManagerTest; friend class test::MultiUserWindowManagerChromeOSTest; friend class test::VirtualKeyboardControllerTest; @@ -134,7 +134,7 @@ void SetTickClockForTest(std::unique_ptr<base::TickClock> tick_clock); // Detect hinge rotation from base and lid accelerometers and automatically - // start / stop tablet mode. + // start / stop maximize mode. void HandleHingeRotation( scoped_refptr<const chromeos::AccelerometerUpdate> update); @@ -144,13 +144,13 @@ // Returns true if the lid was recently opened. bool WasLidOpenedRecently() const; - // Enables TabletModeWindowManager, and determines the current state of + // Enables MaximizeModeWindowManager, and determines the current state of // rotation lock. - void EnterTabletMode(); + void EnterMaximizeMode(); - // Removes TabletModeWindowManager and resets the display rotation if there + // Removes MaximizeModeWindowManager and resets the display rotation if there // is no rotation lock. - void LeaveTabletMode(); + void LeaveMaximizeMode(); // Record UMA stats tracking TouchView usage. If |type| is // TOUCH_VIEW_INTERVAL_INACTIVE, then record that TouchView has been @@ -166,13 +166,13 @@ // mojom::TouchViewManager: void AddObserver(mojom::TouchViewObserverPtr observer) override; - // Checks whether we want to allow entering and exiting tablet mode. This + // Checks whether we want to allow entering and exiting maximize mode. This // returns false if the user set a flag for the software to behave in a // certain way regardless of configuration. - bool AllowEnterExitTabletMode() const; + bool AllowEnterExitMaximizeMode() const; // The maximized window manager (if enabled). - std::unique_ptr<TabletModeWindowManager> tablet_mode_window_manager_; + std::unique_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_; // A helper class which when instantiated will block native events from the // internal keyboard and touchpad. @@ -197,10 +197,10 @@ // Source for the current time in base::TimeTicks. std::unique_ptr<base::TickClock> tick_clock_; - // Set when tablet mode switch is on. This is used to force tablet mode. + // Set when tablet mode switch is on. This is used to force maximize mode. bool tablet_mode_switch_is_on_; - // Tracks when the lid is closed. Used to prevent entering tablet mode. + // Tracks when the lid is closed. Used to prevent entering maximize mode. bool lid_is_closed_; // Tracks smoothed accelerometer data over time. This is done when the hinge @@ -215,16 +215,16 @@ // The set of touchview observers to be notified about mode changes. mojo::InterfacePtrSet<mojom::TouchViewObserver> observers_; - // Tracks whether a flag is used to force tablet mode. + // Tracks whether a flag is used to force maximize mode. ForceTabletMode force_tablet_mode_ = ForceTabletMode::NONE; ScopedSessionObserver scoped_session_observer_; - base::WeakPtrFactory<TabletModeController> weak_factory_; + base::WeakPtrFactory<MaximizeModeController> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(TabletModeController); + DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); }; } // namespace ash -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_ +#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc similarity index 71% rename from ash/wm/tablet_mode/tablet_mode_controller_unittest.cc rename to ash/wm/maximize_mode/maximize_mode_controller_unittest.cc index 3fd1f731..cf6bb66 100644 --- a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.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 "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include <math.h> #include <utility> @@ -71,17 +71,17 @@ extern const float kAccelerometerVerticalHingeUnstableAnglesTestData[]; extern const size_t kAccelerometerVerticalHingeUnstableAnglesTestDataLength; -class TabletModeControllerTest : public test::AshTestBase { +class MaximizeModeControllerTest : public test::AshTestBase { public: - TabletModeControllerTest() {} - ~TabletModeControllerTest() override {} + MaximizeModeControllerTest() {} + ~MaximizeModeControllerTest() override {} void SetUp() override { base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAshEnableTouchView); test::AshTestBase::SetUp(); chromeos::AccelerometerReader::GetInstance()->RemoveObserver( - tablet_mode_controller()); + maximize_mode_controller()); // Set the first display to be the internal display for the accelerometer // screen rotation tests. @@ -91,12 +91,12 @@ void TearDown() override { chromeos::AccelerometerReader::GetInstance()->AddObserver( - tablet_mode_controller()); + maximize_mode_controller()); test::AshTestBase::TearDown(); } - TabletModeController* tablet_mode_controller() { - return Shell::Get()->tablet_mode_controller(); + MaximizeModeController* maximize_mode_controller() { + return Shell::Get()->maximize_mode_controller(); } void TriggerLidUpdate(const gfx::Vector3dF& lid) { @@ -104,7 +104,7 @@ new chromeos::AccelerometerUpdate()); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), lid.z()); - tablet_mode_controller()->OnAccelerometerUpdated(update); + maximize_mode_controller()->OnAccelerometerUpdated(update); } void TriggerBaseAndLidUpdate(const gfx::Vector3dF& base, @@ -115,20 +115,20 @@ base.y(), base.z()); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), lid.z()); - tablet_mode_controller()->OnAccelerometerUpdated(update); + maximize_mode_controller()->OnAccelerometerUpdated(update); } - bool IsTabletModeStarted() { - return tablet_mode_controller()->IsTabletModeWindowManagerEnabled(); + bool IsMaximizeModeStarted() { + return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); } - // Attaches a SimpleTestTickClock to the TabletModeController with a non + // Attaches a SimpleTestTickClock to the MaximizeModeController with a non // null value initial value. void AttachTickClockForTest() { std::unique_ptr<base::TickClock> tick_clock( test_tick_clock_ = new base::SimpleTestTickClock()); test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); - tablet_mode_controller()->SetTickClockForTest(std::move(tick_clock)); + maximize_mode_controller()->SetTickClockForTest(std::move(tick_clock)); } void AdvanceTickClock(const base::TimeDelta& delta) { @@ -154,34 +154,34 @@ } void OpenLid() { - tablet_mode_controller()->LidEventReceived( + maximize_mode_controller()->LidEventReceived( chromeos::PowerManagerClient::LidState::OPEN, - tablet_mode_controller()->tick_clock_->NowTicks()); + maximize_mode_controller()->tick_clock_->NowTicks()); } void CloseLid() { - tablet_mode_controller()->LidEventReceived( + maximize_mode_controller()->LidEventReceived( chromeos::PowerManagerClient::LidState::CLOSED, - tablet_mode_controller()->tick_clock_->NowTicks()); + maximize_mode_controller()->tick_clock_->NowTicks()); } bool WasLidOpenedRecently() { - return tablet_mode_controller()->WasLidOpenedRecently(); + return maximize_mode_controller()->WasLidOpenedRecently(); } void SetTabletMode(bool on) { - tablet_mode_controller()->TabletModeEventReceived( + maximize_mode_controller()->TabletModeEventReceived( on ? chromeos::PowerManagerClient::TabletMode::ON : chromeos::PowerManagerClient::TabletMode::OFF, - tablet_mode_controller()->tick_clock_->NowTicks()); + maximize_mode_controller()->tick_clock_->NowTicks()); } bool AreEventsBlocked() { - return !!tablet_mode_controller()->event_blocker_.get(); + return !!maximize_mode_controller()->event_blocker_.get(); } - TabletModeController::ForceTabletMode forced_tablet_mode() { - return tablet_mode_controller()->force_tablet_mode_; + MaximizeModeController::ForceTabletMode forced_tablet_mode() { + return maximize_mode_controller()->force_tablet_mode_; } base::UserActionTester* user_action_tester() { return &user_action_tester_; } @@ -192,83 +192,83 @@ // Tracks user action counts. base::UserActionTester user_action_tester_; - DISALLOW_COPY_AND_ASSIGN(TabletModeControllerTest); + DISALLOW_COPY_AND_ASSIGN(MaximizeModeControllerTest); }; // Verify TouchView enabled/disabled user action metrics are recorded. -TEST_F(TabletModeControllerTest, VerifyTouchViewEnabledDisabledCounts) { +TEST_F(MaximizeModeControllerTest, VerifyTouchViewEnabledDisabledCounts) { ASSERT_EQ(1, user_action_tester()->GetActionCount(kTouchViewInitiallyDisabled)); ASSERT_EQ(0, user_action_tester()->GetActionCount(kTouchViewEnabled)); ASSERT_EQ(0, user_action_tester()->GetActionCount(kTouchViewDisabled)); user_action_tester()->ResetCounts(); - tablet_mode_controller()->EnableTabletModeWindowManager(true); + maximize_mode_controller()->EnableMaximizeModeWindowManager(true); EXPECT_EQ(1, user_action_tester()->GetActionCount(kTouchViewEnabled)); EXPECT_EQ(0, user_action_tester()->GetActionCount(kTouchViewDisabled)); - tablet_mode_controller()->EnableTabletModeWindowManager(true); + maximize_mode_controller()->EnableMaximizeModeWindowManager(true); EXPECT_EQ(1, user_action_tester()->GetActionCount(kTouchViewEnabled)); EXPECT_EQ(0, user_action_tester()->GetActionCount(kTouchViewDisabled)); user_action_tester()->ResetCounts(); - tablet_mode_controller()->EnableTabletModeWindowManager(false); + maximize_mode_controller()->EnableMaximizeModeWindowManager(false); EXPECT_EQ(0, user_action_tester()->GetActionCount(kTouchViewEnabled)); EXPECT_EQ(1, user_action_tester()->GetActionCount(kTouchViewDisabled)); - tablet_mode_controller()->EnableTabletModeWindowManager(false); + maximize_mode_controller()->EnableMaximizeModeWindowManager(false); EXPECT_EQ(0, user_action_tester()->GetActionCount(kTouchViewEnabled)); EXPECT_EQ(1, user_action_tester()->GetActionCount(kTouchViewDisabled)); } -// Verify that closing the lid will exit tablet mode. -TEST_F(TabletModeControllerTest, CloseLidWhileInTabletMode) { +// Verify that closing the lid will exit maximize mode. +TEST_F(MaximizeModeControllerTest, CloseLidWhileInMaximizeMode) { OpenLidToAngle(315.0f); - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); CloseLid(); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); } -// Verify that tablet mode will not be entered when the lid is closed. -TEST_F(TabletModeControllerTest, HingeAnglesWithLidClosed) { +// Verify that maximize mode will not be entered when the lid is closed. +TEST_F(MaximizeModeControllerTest, HingeAnglesWithLidClosed) { AttachTickClockForTest(); CloseLid(); OpenLidToAngle(270.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(315.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(355.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); } -// Verify the tablet mode state for unstable hinge angles when the lid was +// Verify the maximize mode state for unstable hinge angles when the lid was // recently open. -TEST_F(TabletModeControllerTest, UnstableHingeAnglesWhenLidRecentlyOpened) { +TEST_F(MaximizeModeControllerTest, UnstableHingeAnglesWhenLidRecentlyOpened) { AttachTickClockForTest(); OpenLid(); ASSERT_TRUE(WasLidOpenedRecently()); OpenLidToAngle(5.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(355.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); // This is a stable reading and should clear the last lid opened time. OpenLidToAngle(45.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(WasLidOpenedRecently()); OpenLidToAngle(355.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); } // Verify the WasLidOpenedRecently signal with respect to time. -TEST_F(TabletModeControllerTest, WasLidOpenedRecentlyOverTime) { +TEST_F(MaximizeModeControllerTest, WasLidOpenedRecentlyOverTime) { AttachTickClockForTest(); // No lid open time initially. @@ -289,127 +289,128 @@ EXPECT_FALSE(WasLidOpenedRecently()); } -TEST_F(TabletModeControllerTest, TabletModeTransition) { +TEST_F(MaximizeModeControllerTest, TabletModeTransition) { OpenLidToAngle(90.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); - // Unstable reading. This should not trigger tablet mode. + // Unstable reading. This should not trigger maximize mode. HoldDeviceVertical(); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); - // When tablet mode switch is on it should force tablet mode even if the + // When tablet mode switch is on it should force maximize mode even if the // reading is not stable. SetTabletMode(true); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); - // After tablet mode switch is off it should stay in tablet mode if the + // After tablet mode switch is off it should stay in maximize mode if the // reading is not stable. SetTabletMode(false); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); - // Should leave tablet mode when the lid angle is small enough. + // Should leave maximize mode when the lid angle is small enough. OpenLidToAngle(90.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(300.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); } -// When there is no keyboard accelerometer available tablet mode should solely +// When there is no keyboard accelerometer available maximize mode should solely // rely on the tablet mode switch. -TEST_F(TabletModeControllerTest, TabletModeTransitionNoKeyboardAccelerometer) { - ASSERT_FALSE(IsTabletModeStarted()); +TEST_F(MaximizeModeControllerTest, + TabletModeTransitionNoKeyboardAccelerometer) { + ASSERT_FALSE(IsMaximizeModeStarted()); TriggerLidUpdate(gfx::Vector3dF(0.0f, 0.0f, kMeanGravity)); - ASSERT_FALSE(IsTabletModeStarted()); + ASSERT_FALSE(IsMaximizeModeStarted()); SetTabletMode(true); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); // Single sensor reading should not change mode. TriggerLidUpdate(gfx::Vector3dF(0.0f, 0.0f, kMeanGravity)); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); // With a single sensor we should exit immediately on the tablet mode switch // rather than waiting for stabilized accelerometer readings. SetTabletMode(false); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); } -// Verify the tablet mode enter/exit thresholds for stable angles. -TEST_F(TabletModeControllerTest, StableHingeAnglesWithLidOpened) { - ASSERT_FALSE(IsTabletModeStarted()); +// Verify the maximize mode enter/exit thresholds for stable angles. +TEST_F(MaximizeModeControllerTest, StableHingeAnglesWithLidOpened) { + ASSERT_FALSE(IsMaximizeModeStarted()); ASSERT_FALSE(WasLidOpenedRecently()); OpenLidToAngle(180.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(315.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); OpenLidToAngle(180.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); OpenLidToAngle(45.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(270.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); OpenLidToAngle(90.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); } -// Verify the tablet mode state for unstable hinge angles when the lid is open +// Verify the maximize mode state for unstable hinge angles when the lid is open // but not recently. -TEST_F(TabletModeControllerTest, UnstableHingeAnglesWithLidOpened) { +TEST_F(MaximizeModeControllerTest, UnstableHingeAnglesWithLidOpened) { AttachTickClockForTest(); ASSERT_FALSE(WasLidOpenedRecently()); - ASSERT_FALSE(IsTabletModeStarted()); + ASSERT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(5.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(355.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); OpenLidToAngle(5.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); } // Tests that when the hinge is nearly vertically aligned, the current state // persists as the computed angle is highly inaccurate in this orientation. -TEST_F(TabletModeControllerTest, HingeAligned) { +TEST_F(MaximizeModeControllerTest, HingeAligned) { // Laptop in normal orientation lid open 90 degrees. TriggerBaseAndLidUpdate(gfx::Vector3dF(0.0f, 0.0f, -kMeanGravity), gfx::Vector3dF(0.0f, -kMeanGravity, 0.0f)); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); // Completely vertical. TriggerBaseAndLidUpdate(gfx::Vector3dF(kMeanGravity, 0.0f, 0.0f), gfx::Vector3dF(kMeanGravity, 0.0f, 0.0f)); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); // Close to vertical but with hinge appearing to be open 270 degrees. TriggerBaseAndLidUpdate(gfx::Vector3dF(kMeanGravity, 0.0f, -0.1f), gfx::Vector3dF(kMeanGravity, 0.1f, 0.0f)); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); - // Flat and open 270 degrees should start tablet mode. + // Flat and open 270 degrees should start maximize mode. TriggerBaseAndLidUpdate(gfx::Vector3dF(0.0f, 0.0f, -kMeanGravity), gfx::Vector3dF(0.0f, kMeanGravity, 0.0f)); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); // Normal 90 degree orientation but near vertical should stay in maximize // mode. TriggerBaseAndLidUpdate(gfx::Vector3dF(kMeanGravity, 0.0f, -0.1f), gfx::Vector3dF(kMeanGravity, -0.1f, 0.0f)); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); } -TEST_F(TabletModeControllerTest, LaptopTest) { +TEST_F(MaximizeModeControllerTest, LaptopTest) { // Feeds in sample accelerometer data and verifies that there are no - // transitions into touchview / tablet mode while shaking the device around + // transitions into touchview / maximize mode while shaking the device around // with the hinge at less than 180 degrees. Note the conversion from device // data to accelerometer updates consistent with accelerometer_reader.cc. ASSERT_EQ(0u, kAccelerometerLaptopModeTestDataLength % 6); @@ -425,18 +426,18 @@ TriggerBaseAndLidUpdate(base, lid); // There are a lot of samples, so ASSERT rather than EXPECT to only generate // one failure rather than potentially hundreds. - ASSERT_FALSE(IsTabletModeStarted()); + ASSERT_FALSE(IsMaximizeModeStarted()); } } -TEST_F(TabletModeControllerTest, TabletModeTest) { - // Trigger tablet mode by opening to 270 to begin the test in tablet mode. +TEST_F(MaximizeModeControllerTest, MaximizeModeTest) { + // Trigger maximize mode by opening to 270 to begin the test in maximize mode. TriggerBaseAndLidUpdate(gfx::Vector3dF(0.0f, 0.0f, kMeanGravity), gfx::Vector3dF(0.0f, -kMeanGravity, 0.0f)); - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); // Feeds in sample accelerometer data and verifies that there are no - // transitions out of touchview / tablet mode while shaking the device + // transitions out of touchview / maximize mode while shaking the device // around. Note the conversion from device data to accelerometer updates // consistent with accelerometer_reader.cc. ASSERT_EQ(0u, kAccelerometerFullyOpenTestDataLength % 6); @@ -452,13 +453,13 @@ TriggerBaseAndLidUpdate(base, lid); // There are a lot of samples, so ASSERT rather than EXPECT to only generate // one failure rather than potentially hundreds. - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); } } -TEST_F(TabletModeControllerTest, VerticalHingeTest) { +TEST_F(MaximizeModeControllerTest, VerticalHingeTest) { // Feeds in sample accelerometer data and verifies that there are no - // transitions out of touchview / tablet mode while shaking the device + // transitions out of touchview / maximize mode while shaking the device // around, while the hinge is nearly vertical. The data was captured from // maxmimize_mode_controller.cc and does not require conversion. ASSERT_EQ(0u, kAccelerometerVerticalHingeTestDataLength % 6); @@ -472,12 +473,12 @@ TriggerBaseAndLidUpdate(base, lid); // There are a lot of samples, so ASSERT rather than EXPECT to only generate // one failure rather than potentially hundreds. - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); } } // Test if this case does not crash. See http://crbug.com/462806 -TEST_F(TabletModeControllerTest, DisplayDisconnectionDuringOverview) { +TEST_F(MaximizeModeControllerTest, DisplayDisconnectionDuringOverview) { UpdateDisplay("800x600,800x600"); std::unique_ptr<aura::Window> w1( CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 100, 100))); @@ -485,7 +486,7 @@ CreateTestWindowInShellWithBounds(gfx::Rect(800, 0, 100, 100))); ASSERT_NE(w1->GetRootWindow(), w2->GetRootWindow()); - tablet_mode_controller()->EnableTabletModeWindowManager(true); + maximize_mode_controller()->EnableMaximizeModeWindowManager(true); EXPECT_TRUE(Shell::Get()->window_selector_controller()->ToggleOverview()); UpdateDisplay("800x600"); @@ -493,17 +494,17 @@ EXPECT_EQ(w1->GetRootWindow(), w2->GetRootWindow()); } -// Test that the disabling of the internal display exits tablet mode, and that -// while disabled we do not re-enter tablet mode. -TEST_F(TabletModeControllerTest, NoTabletModeWithDisabledInternalDisplay) { +// Test that the disabling of the internal display exits maximize mode, and that +// while disabled we do not re-enter maximize mode. +TEST_F(MaximizeModeControllerTest, NoMaximizeModeWithDisabledInternalDisplay) { UpdateDisplay("200x200, 200x200"); const int64_t internal_display_id = display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); - ASSERT_FALSE(IsTabletModeStarted()); + ASSERT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(270.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); EXPECT_TRUE(AreEventsBlocked()); // Deactivate internal display to simulate Docked Mode. @@ -512,27 +513,27 @@ display_manager()->GetDisplayAt(1).id())); display_manager()->OnNativeDisplaysChanged(secondary_only); ASSERT_FALSE(display_manager()->IsActiveDisplayId(internal_display_id)); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); OpenLidToAngle(270.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); // Tablet mode signal should also be ignored. SetTabletMode(true); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); } // Tests that is a tablet mode signal is received while docked, that maximize // mode is enabled upon exiting docked mode. -TEST_F(TabletModeControllerTest, TabletModeAfterExitingDockedMode) { +TEST_F(MaximizeModeControllerTest, MaximizeModeAfterExitingDockedMode) { UpdateDisplay("200x200, 200x200"); const int64_t internal_display_id = display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); - ASSERT_FALSE(IsTabletModeStarted()); + ASSERT_FALSE(IsMaximizeModeStarted()); // Deactivate internal display to simulate Docked Mode. std::vector<display::ManagedDisplayInfo> all_displays; @@ -549,26 +550,26 @@ // Tablet mode signal should also be ignored. SetTabletMode(true); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); // Exiting docked state display_manager()->OnNativeDisplaysChanged(all_displays); display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); } -// Verify that the device won't exit touchview / tablet mode for unstable +// Verify that the device won't exit touchview / maximize mode for unstable // angles when hinge is nearly vertical -TEST_F(TabletModeControllerTest, VerticalHingeUnstableAnglesTest) { - // Trigger tablet mode by opening to 270 to begin the test in tablet mode. +TEST_F(MaximizeModeControllerTest, VerticalHingeUnstableAnglesTest) { + // Trigger maximize mode by opening to 270 to begin the test in maximize mode. TriggerBaseAndLidUpdate(gfx::Vector3dF(0.0f, 0.0f, kMeanGravity), gfx::Vector3dF(0.0f, -kMeanGravity, 0.0f)); - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); // Feeds in sample accelerometer data and verifies that there are no - // transitions out of touchview / tablet mode while shaking the device + // transitions out of touchview / maximize mode while shaking the device // around, while the hinge is nearly vertical. The data was captured // from maxmimize_mode_controller.cc and does not require conversion. ASSERT_EQ(0u, kAccelerometerVerticalHingeUnstableAnglesTestDataLength % 6); @@ -585,13 +586,13 @@ TriggerBaseAndLidUpdate(base, lid); // There are a lot of samples, so ASSERT rather than EXPECT to only generate // one failure rather than potentially hundreds. - ASSERT_TRUE(IsTabletModeStarted()); + ASSERT_TRUE(IsMaximizeModeStarted()); } } -// Tests that when a TabletModeController is created that cached tablet mode +// Tests that when a MaximizeModeController is created that cached tablet mode // state will trigger a mode update. -TEST_F(TabletModeControllerTest, InitializedWhileTabletModeSwitchOn) { +TEST_F(MaximizeModeControllerTest, InitializedWhileTabletModeSwitchOn) { base::RunLoop().RunUntilIdle(); // FakePowerManagerClient is always installed for tests chromeos::FakePowerManagerClient* power_manager_client = @@ -599,64 +600,64 @@ chromeos::DBusThreadManager::Get()->GetPowerManagerClient()); power_manager_client->set_tablet_mode( chromeos::PowerManagerClient::TabletMode::ON); - TabletModeController controller; - EXPECT_FALSE(controller.IsTabletModeWindowManagerEnabled()); + MaximizeModeController controller; + EXPECT_FALSE(controller.IsMaximizeModeWindowManagerEnabled()); // PowerManagerClient callback is a posted task. base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(controller.IsTabletModeWindowManagerEnabled()); + EXPECT_TRUE(controller.IsMaximizeModeWindowManagerEnabled()); } // Verify when the force clamshell mode flag is turned on, opening the lid past -// 180 degrees or setting tablet mode to true will no turn on tablet mode. -TEST_F(TabletModeControllerTest, ForceClamshellModeTest) { +// 180 degrees or setting tablet mode to true will no turn on maximize mode. +TEST_F(MaximizeModeControllerTest, ForceClamshellModeTest) { base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAshForceTabletMode, switches::kAshForceTabletModeClamshell); - tablet_mode_controller()->OnShellInitialized(); - EXPECT_EQ(TabletModeController::ForceTabletMode::CLAMSHELL, + maximize_mode_controller()->OnShellInitialized(); + EXPECT_EQ(MaximizeModeController::ForceTabletMode::CLAMSHELL, forced_tablet_mode()); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); OpenLidToAngle(300.0f); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); SetTabletMode(true); - EXPECT_FALSE(IsTabletModeStarted()); + EXPECT_FALSE(IsMaximizeModeStarted()); EXPECT_FALSE(AreEventsBlocked()); } -// Verify when the force touch view mode flag is turned on, tablet mode is on +// Verify when the force touch view mode flag is turned on, maximize mode is on // intially, and opening the lid to less than 180 degress or setting tablet mode -// to off will not turn off tablet mode. -TEST_F(TabletModeControllerTest, ForceTouchViewModeTest) { +// to off will not turn off maximize mode. +TEST_F(MaximizeModeControllerTest, ForceTouchViewModeTest) { base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAshForceTabletMode, switches::kAshForceTabletModeTouchView); - tablet_mode_controller()->OnShellInitialized(); - EXPECT_EQ(TabletModeController::ForceTabletMode::TOUCHVIEW, + maximize_mode_controller()->OnShellInitialized(); + EXPECT_EQ(MaximizeModeController::ForceTabletMode::TOUCHVIEW, forced_tablet_mode()); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); EXPECT_TRUE(AreEventsBlocked()); OpenLidToAngle(30.0f); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); EXPECT_TRUE(AreEventsBlocked()); SetTabletMode(false); - EXPECT_TRUE(IsTabletModeStarted()); + EXPECT_TRUE(IsMaximizeModeStarted()); EXPECT_TRUE(AreEventsBlocked()); } -TEST_F(TabletModeControllerTest, RestoreAfterExit) { +TEST_F(MaximizeModeControllerTest, RestoreAfterExit) { UpdateDisplay("1000x600"); std::unique_ptr<aura::Window> w1( CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 900, 300))); - tablet_mode_controller()->EnableTabletModeWindowManager(true); + maximize_mode_controller()->EnableMaximizeModeWindowManager(true); Shell::Get()->screen_orientation_controller()->SetLockToRotation( display::Display::ROTATE_90); display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); EXPECT_EQ(display::Display::ROTATE_90, display.rotation()); EXPECT_LT(display.size().width(), display.size().height()); - tablet_mode_controller()->EnableTabletModeWindowManager(false); + maximize_mode_controller()->EnableMaximizeModeWindowManager(false); display = display::Screen::GetScreen()->GetPrimaryDisplay(); // Sanity checks. EXPECT_EQ(display::Display::ROTATE_0, display.rotation());
diff --git a/ash/wm/tablet_mode/tablet_mode_event_handler.cc b/ash/wm/maximize_mode/maximize_mode_event_handler.cc similarity index 72% rename from ash/wm/tablet_mode/tablet_mode_event_handler.cc rename to ash/wm/maximize_mode/maximize_mode_event_handler.cc index 73aead1..0a38ac8 100644 --- a/ash/wm/tablet_mode/tablet_mode_event_handler.cc +++ b/ash/wm/maximize_mode/maximize_mode_event_handler.cc
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/wm/tablet_mode/tablet_mode_event_handler.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" +#include "ash/wm_window.h" #include "ui/events/event.h" namespace ash { @@ -21,11 +22,11 @@ } // namespace -TabletModeEventHandler::TabletModeEventHandler() {} +MaximizeModeEventHandler::MaximizeModeEventHandler() {} -TabletModeEventHandler::~TabletModeEventHandler() {} +MaximizeModeEventHandler::~MaximizeModeEventHandler() {} -bool TabletModeEventHandler::ToggleFullscreen(const ui::TouchEvent& event) { +bool MaximizeModeEventHandler::ToggleFullscreen(const ui::TouchEvent& event) { if (event.type() != ui::ET_TOUCH_PRESSED) return false; @@ -37,18 +38,18 @@ } // Find the active window (from the primary screen) to un-fullscreen. - aura::Window* window = GetActiveWindow(); + WmWindow* window = WmWindow::Get(GetActiveWindow()); if (!window) return false; - WindowState* window_state = GetWindowState(window); + WindowState* window_state = window->GetWindowState(); if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) return false; // Test that the touch happened in the top or bottom lines. int y = event.y(); if (y >= kLeaveFullScreenAreaHeightInPixel && - y < (window->bounds().height() - kLeaveFullScreenAreaHeightInPixel)) { + y < (window->GetBounds().height() - kLeaveFullScreenAreaHeightInPixel)) { return false; } @@ -57,7 +58,7 @@ return false; WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN); - GetWindowState(window)->OnWMEvent(&toggle_fullscreen); + window->GetWindowState()->OnWMEvent(&toggle_fullscreen); return true; }
diff --git a/ash/wm/maximize_mode/maximize_mode_event_handler.h b/ash/wm/maximize_mode/maximize_mode_event_handler.h new file mode 100644 index 0000000..658be05 --- /dev/null +++ b/ash/wm/maximize_mode/maximize_mode_event_handler.h
@@ -0,0 +1,37 @@ +// 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 ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_H_ +#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_H_ + +#include "base/macros.h" + +namespace ui { +class TouchEvent; +} + +namespace ash { +namespace wm { + +// MaximizeModeEventHandler handles toggling fullscreen when appropriate. +// MaximizeModeEventHandler installs event handlers in an environment specific +// way, e.g. EventHandler for aura. +class MaximizeModeEventHandler { + public: + MaximizeModeEventHandler(); + virtual ~MaximizeModeEventHandler(); + + protected: + // Subclasses call this to toggle fullscreen. If a toggle happened returns + // true. + bool ToggleFullscreen(const ui::TouchEvent& event); + + private: + DISALLOW_COPY_AND_ASSIGN(MaximizeModeEventHandler); +}; + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc b/ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc similarity index 62% rename from ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc rename to ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc index e3263585..35e5902 100644 --- a/ash/wm/tablet_mode/tablet_mode_event_handler_aura.cc +++ b/ash/wm/maximize_mode/maximize_mode_event_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 "ash/wm/tablet_mode/tablet_mode_event_handler_aura.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" #include "ash/shell.h" #include "ui/events/event.h" @@ -10,15 +10,15 @@ namespace ash { namespace wm { -TabletModeEventHandlerAura::TabletModeEventHandlerAura() { +MaximizeModeEventHandlerAura::MaximizeModeEventHandlerAura() { Shell::Get()->AddPreTargetHandler(this); } -TabletModeEventHandlerAura::~TabletModeEventHandlerAura() { +MaximizeModeEventHandlerAura::~MaximizeModeEventHandlerAura() { Shell::Get()->RemovePreTargetHandler(this); } -void TabletModeEventHandlerAura::OnTouchEvent(ui::TouchEvent* event) { +void MaximizeModeEventHandlerAura::OnTouchEvent(ui::TouchEvent* event) { if (ToggleFullscreen(*event)) event->StopPropagation(); }
diff --git a/ash/wm/maximize_mode/maximize_mode_event_handler_aura.h b/ash/wm/maximize_mode/maximize_mode_event_handler_aura.h new file mode 100644 index 0000000..4cc7e23 --- /dev/null +++ b/ash/wm/maximize_mode/maximize_mode_event_handler_aura.h
@@ -0,0 +1,32 @@ +// 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 ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_AURA_H_ +#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_AURA_H_ + +#include "ash/ash_export.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler.h" +#include "ui/events/event_handler.h" + +namespace ash { +namespace wm { + +// Implementation of MaximizeModeEventHandler for aura. Uses ui::EventHandler. +class ASH_EXPORT MaximizeModeEventHandlerAura : public MaximizeModeEventHandler, + public ui::EventHandler { + public: + MaximizeModeEventHandlerAura(); + ~MaximizeModeEventHandlerAura() override; + + private: + // ui::EventHandler override: + void OnTouchEvent(ui::TouchEvent* event) override; + + DISALLOW_COPY_AND_ASSIGN(MaximizeModeEventHandlerAura); +}; + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_HANDLER_AURA_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager.cc b/ash/wm/maximize_mode/maximize_mode_window_manager.cc similarity index 73% rename from ash/wm/tablet_mode/tablet_mode_window_manager.cc rename to ash/wm/maximize_mode/maximize_mode_window_manager.cc index ee032c03..32dd2eba 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_manager.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_manager.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 "ash/wm/tablet_mode/tablet_mode_window_manager.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include "ash/ash_switches.h" #include "ash/public/cpp/shell_window_ids.h" @@ -10,11 +10,11 @@ #include "ash/session/session_state_delegate.h" #include "ash/shell.h" #include "ash/shell_port.h" +#include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h" +#include "ash/wm/maximize_mode/maximize_mode_event_handler.h" +#include "ash/wm/maximize_mode/maximize_mode_window_state.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" -#include "ash/wm/tablet_mode/tablet_mode_event_handler.h" -#include "ash/wm/tablet_mode/tablet_mode_window_state.h" #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h" #include "ash/wm/workspace_controller.h" @@ -38,8 +38,8 @@ } // namespace -TabletModeWindowManager::~TabletModeWindowManager() { - // Overview mode needs to be ended before exiting tablet mode to prevent +MaximizeModeWindowManager::~MaximizeModeWindowManager() { + // Overview mode needs to be ended before exiting maximize mode to prevent // transforming windows which are currently in // overview: http://crbug.com/366605 CancelOverview(); @@ -53,11 +53,11 @@ RestoreAllWindows(); } -int TabletModeWindowManager::GetNumberOfManagedWindows() { +int MaximizeModeWindowManager::GetNumberOfManagedWindows() { return window_state_map_.size(); } -void TabletModeWindowManager::AddWindow(aura::Window* window) { +void MaximizeModeWindowManager::AddWindow(aura::Window* window) { // Only add the window if it is a direct dependent of a container window // and not yet tracked. if (!ShouldHandleWindow(window) || @@ -69,7 +69,7 @@ MaximizeAndTrackWindow(window); } -void TabletModeWindowManager::WindowStateDestroyed(aura::Window* window) { +void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) { // At this time ForgetWindow() should already have been called. If not, // someone else must have replaced the "window manager's state object". DCHECK(!window->HasObserver(this)); @@ -79,15 +79,15 @@ window_state_map_.erase(it); } -void TabletModeWindowManager::OnOverviewModeStarting() { +void MaximizeModeWindowManager::OnOverviewModeStarting() { SetDeferBoundsUpdates(true); } -void TabletModeWindowManager::OnOverviewModeEnded() { +void MaximizeModeWindowManager::OnOverviewModeEnded() { SetDeferBoundsUpdates(false); } -void TabletModeWindowManager::OnWindowDestroying(aura::Window* window) { +void MaximizeModeWindowManager::OnWindowDestroying(aura::Window* window) { if (IsContainerWindow(window)) { // container window can be removed on display destruction. window->RemoveObserver(this); @@ -103,7 +103,7 @@ } } -void TabletModeWindowManager::OnWindowHierarchyChanged( +void MaximizeModeWindowManager::OnWindowHierarchyChanged( const HierarchyChangeParams& params) { // A window can get removed and then re-added by a drag and drop operation. if (params.new_parent && IsContainerWindow(params.new_parent) && @@ -128,9 +128,9 @@ } } -void TabletModeWindowManager::OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) { +void MaximizeModeWindowManager::OnWindowPropertyChanged(aura::Window* window, + const void* key, + intptr_t old) { // Stop managing |window| if the always-on-top property is added. if (key == aura::client::kAlwaysOnTopKey && window->GetProperty(aura::client::kAlwaysOnTopKey)) { @@ -138,7 +138,7 @@ } } -void TabletModeWindowManager::OnWindowBoundsChanged( +void MaximizeModeWindowManager::OnWindowBoundsChanged( aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { @@ -149,8 +149,8 @@ pair.second->UpdateWindowPosition(wm::GetWindowState(pair.first)); } -void TabletModeWindowManager::OnWindowVisibilityChanged(aura::Window* window, - bool visible) { +void MaximizeModeWindowManager::OnWindowVisibilityChanged(aura::Window* window, + bool visible) { // Skip if it's already managed. if (base::ContainsKey(window_state_map_, window)) return; @@ -169,28 +169,29 @@ } } -void TabletModeWindowManager::OnDisplayAdded(const display::Display& display) { - DisplayConfigurationChanged(); -} - -void TabletModeWindowManager::OnDisplayRemoved( +void MaximizeModeWindowManager::OnDisplayAdded( const display::Display& display) { DisplayConfigurationChanged(); } -void TabletModeWindowManager::OnDisplayMetricsChanged(const display::Display&, - uint32_t) { +void MaximizeModeWindowManager::OnDisplayRemoved( + const display::Display& display) { + DisplayConfigurationChanged(); +} + +void MaximizeModeWindowManager::OnDisplayMetricsChanged(const display::Display&, + uint32_t) { // Nothing to do here. } -void TabletModeWindowManager::SetIgnoreWmEventsForExit() { +void MaximizeModeWindowManager::SetIgnoreWmEventsForExit() { for (auto& pair : window_state_map_) { pair.second->set_ignore_wm_events(true); } } -TabletModeWindowManager::TabletModeWindowManager() { - // The overview mode needs to be ended before the tablet mode is started. To +MaximizeModeWindowManager::MaximizeModeWindowManager() { + // The overview mode needs to be ended before the maximize mode is started. To // guarantee the proper order, it will be turned off from here. CancelOverview(); @@ -199,10 +200,10 @@ EnableBackdropBehindTopWindowOnEachDisplay(true); display::Screen::GetScreen()->AddObserver(this); Shell::Get()->AddShellObserver(this); - event_handler_ = ShellPort::Get()->CreateTabletModeEventHandler(); + event_handler_ = ShellPort::Get()->CreateMaximizeModeEventHandler(); } -void TabletModeWindowManager::MaximizeAllWindows() { +void MaximizeModeWindowManager::MaximizeAllWindows() { MruWindowTracker::WindowList windows = Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); // Add all existing MRU windows. @@ -210,29 +211,30 @@ MaximizeAndTrackWindow(window); } -void TabletModeWindowManager::RestoreAllWindows() { +void MaximizeModeWindowManager::RestoreAllWindows() { while (window_state_map_.size()) ForgetWindow(window_state_map_.begin()->first); } -void TabletModeWindowManager::SetDeferBoundsUpdates(bool defer_bounds_updates) { +void MaximizeModeWindowManager::SetDeferBoundsUpdates( + bool defer_bounds_updates) { for (auto& pair : window_state_map_) pair.second->SetDeferBoundsUpdates(defer_bounds_updates); } -void TabletModeWindowManager::MaximizeAndTrackWindow(aura::Window* window) { +void MaximizeModeWindowManager::MaximizeAndTrackWindow(aura::Window* window) { if (!ShouldHandleWindow(window)) return; DCHECK(!base::ContainsKey(window_state_map_, window)); window->AddObserver(this); - // We create and remember a tablet mode state which will attach itself to + // We create and remember a maximize mode state which will attach itself to // the provided state object. - window_state_map_[window] = new TabletModeWindowState(window, this); + window_state_map_[window] = new MaximizeModeWindowState(window, this); } -void TabletModeWindowManager::ForgetWindow(aura::Window* window) { +void MaximizeModeWindowManager::ForgetWindow(aura::Window* window) { WindowToState::iterator it = window_state_map_.find(window); // The following DCHECK could fail if our window state object was destroyed @@ -243,11 +245,11 @@ // By telling the state object to revert, it will switch back the old // State object and destroy itself, calling WindowStateDestroyed(). - it->second->LeaveTabletMode(wm::GetWindowState(it->first)); + it->second->LeaveMaximizeMode(wm::GetWindowState(it->first)); DCHECK(!base::ContainsKey(window_state_map_, window)); } -bool TabletModeWindowManager::ShouldHandleWindow(aura::Window* window) { +bool MaximizeModeWindowManager::ShouldHandleWindow(aura::Window* window) { DCHECK(window); // Windows with the always-on-top property should be free-floating and thus @@ -256,14 +258,14 @@ return false; // If the changing bounds in the maximized/fullscreen is allowed, then - // let the client manage it even in tablet mode. + // let the client manage it even in maximized mode. if (wm::GetWindowState(window)->allow_set_bounds_direct()) return false; return window->type() == aura::client::WINDOW_TYPE_NORMAL; } -void TabletModeWindowManager::AddWindowCreationObservers() { +void MaximizeModeWindowManager::AddWindowCreationObservers() { DCHECK(observed_container_windows_.empty()); // Observe window activations/creations in the default containers on all root // windows. @@ -276,30 +278,31 @@ } } -void TabletModeWindowManager::RemoveWindowCreationObservers() { +void MaximizeModeWindowManager::RemoveWindowCreationObservers() { for (aura::Window* window : observed_container_windows_) window->RemoveObserver(this); observed_container_windows_.clear(); } -void TabletModeWindowManager::DisplayConfigurationChanged() { +void MaximizeModeWindowManager::DisplayConfigurationChanged() { EnableBackdropBehindTopWindowOnEachDisplay(false); RemoveWindowCreationObservers(); AddWindowCreationObservers(); EnableBackdropBehindTopWindowOnEachDisplay(true); } -bool TabletModeWindowManager::IsContainerWindow(aura::Window* window) { +bool MaximizeModeWindowManager::IsContainerWindow(aura::Window* window) { return base::ContainsKey(observed_container_windows_, window); } -void TabletModeWindowManager::EnableBackdropBehindTopWindowOnEachDisplay( +void MaximizeModeWindowManager::EnableBackdropBehindTopWindowOnEachDisplay( bool enable) { // Inform the WorkspaceLayoutManager that we want to show a backdrop behind // the topmost window of its container. for (auto* controller : Shell::GetAllRootWindowControllers()) { controller->workspace_controller()->SetBackdropDelegate( - enable ? base::MakeUnique<TabletModeBackdropDelegateImpl>() : nullptr); + enable ? base::MakeUnique<MaximizeModeBackdropDelegateImpl>() + : nullptr); } }
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager.h b/ash/wm/maximize_mode/maximize_mode_window_manager.h similarity index 84% rename from ash/wm/tablet_mode/tablet_mode_window_manager.h rename to ash/wm/maximize_mode/maximize_mode_window_manager.h index bdf552173..fbdedccf 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_manager.h +++ b/ash/wm/maximize_mode/maximize_mode_window_manager.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_MANAGER_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_MANAGER_H_ +#ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ +#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ #include <stdint.h> @@ -22,25 +22,25 @@ } namespace ash { -class TabletModeController; -class TabletModeWindowState; +class MaximizeModeController; +class MaximizeModeWindowState; namespace wm { -class TabletModeEventHandler; +class MaximizeModeEventHandler; } -// A window manager which - when created - will force all windows into tablet +// A window manager which - when created - will force all windows into maximized // mode. Exception are panels and windows which cannot be maximized. // Windows which cannot be maximized / resized are centered with a layer placed // behind the window so that no other windows are visible and/or obscured. // With the destruction of the manager all windows will be restored to their // original state. -class ASH_EXPORT TabletModeWindowManager : public aura::WindowObserver, - public display::DisplayObserver, - public ShellObserver { +class ASH_EXPORT MaximizeModeWindowManager : public aura::WindowObserver, + public display::DisplayObserver, + public ShellObserver { public: // This should only be deleted by the creator (ash::Shell). - ~TabletModeWindowManager() override; + ~MaximizeModeWindowManager() override; // Returns the number of maximized & tracked windows by this manager. int GetNumberOfManagedWindows(); @@ -79,13 +79,13 @@ void SetIgnoreWmEventsForExit(); protected: - friend class TabletModeController; + friend class MaximizeModeController; // The object should only be created by the ash::Shell. - TabletModeWindowManager(); + MaximizeModeWindowManager(); private: - using WindowToState = std::map<aura::Window*, TabletModeWindowState*>; + using WindowToState = std::map<aura::Window*, MaximizeModeWindowState*>; // Maximize all windows and restore their current state. void MaximizeAllWindows(); @@ -135,11 +135,11 @@ // Windows added to the container, but not yet shown. std::unordered_set<aura::Window*> added_windows_; - std::unique_ptr<wm::TabletModeEventHandler> event_handler_; + std::unique_ptr<wm::MaximizeModeEventHandler> event_handler_; - DISALLOW_COPY_AND_ASSIGN(TabletModeWindowManager); + DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManager); }; } // namespace ash -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_MANAGER_H_ +#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc similarity index 86% rename from ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc rename to ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc index e59ffbb..53816512 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.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 "ash/wm/tablet_mode/tablet_mode_window_manager.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include <string> @@ -15,15 +15,16 @@ #include "ash/shell_port.h" #include "ash/test/ash_test_base.h" #include "ash/test/shell_test_api.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/switchable_windows.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_observer.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" +#include "ash/wm_window.h" #include "base/command_line.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -39,10 +40,10 @@ namespace ash { -class TabletModeWindowManagerTest : public test::AshTestBase { +class MaximizeModeWindowManagerTest : public test::AshTestBase { public: - TabletModeWindowManagerTest() {} - ~TabletModeWindowManagerTest() override {} + MaximizeModeWindowManagerTest() {} + ~MaximizeModeWindowManagerTest() override {} // Creates a window which has a fixed size. aura::Window* CreateFixedSizeNonMaximizableWindow( @@ -84,24 +85,25 @@ } // Create the Maximized mode window manager. - TabletModeWindowManager* CreateTabletModeWindowManager() { - EXPECT_FALSE(tablet_mode_window_manager()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); - return tablet_mode_window_manager(); + MaximizeModeWindowManager* CreateMaximizeModeWindowManager() { + EXPECT_FALSE(maximize_mode_window_manager()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); + return maximize_mode_window_manager(); } - // Destroy the tablet mode window manager. - void DestroyTabletModeWindowManager() { - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( + // Destroy the maximized mode window manager. + void DestroyMaximizeModeWindowManager() { + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( false); - EXPECT_FALSE(tablet_mode_window_manager()); + EXPECT_FALSE(maximize_mode_window_manager()); } // Get the maximze window manager. - TabletModeWindowManager* tablet_mode_window_manager() { + MaximizeModeWindowManager* maximize_mode_window_manager() { return Shell::Get() - ->tablet_mode_controller() - ->tablet_mode_window_manager_.get(); + ->maximize_mode_controller() + ->maximize_mode_window_manager_.get(); } // Resize our desktop. @@ -116,7 +118,7 @@ private: // Create a window in one of the containers which are watched by the - // TabletModeWindowManager. Note that this only works with one root window. + // MaximizeModeWindowManager. Note that this only works with one root window. // If |can_maximize| is not set, |max_size| is the upper limiting size for // the window, whereas an empty size means that there is no limit. aura::Window* CreateWindowInWatchedContainer(aura::client::WindowType type, @@ -143,21 +145,21 @@ return window; } - DISALLOW_COPY_AND_ASSIGN(TabletModeWindowManagerTest); + DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManagerTest); }; // Test that creating the object and destroying it without any windows should // not cause any problems. -TEST_F(TabletModeWindowManagerTest, SimpleStart) { - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); +TEST_F(MaximizeModeWindowManagerTest, SimpleStart) { + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that existing windows will handled properly when going into maximized // mode. -TEST_F(TabletModeWindowManagerTest, PreCreateWindows) { +TEST_F(MaximizeModeWindowManagerTest, PreCreateWindows) { // Bounds for windows we know can be controlled. gfx::Rect rect1(10, 10, 200, 50); gfx::Rect rect2(10, 60, 200, 50); @@ -189,7 +191,7 @@ // Create the manager and make sure that all qualifying windows were detected // and changed. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMaximized()); @@ -212,7 +214,7 @@ // Destroy the manager again and check that the windows return to their // previous state. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); @@ -227,7 +229,7 @@ } // The same test as the above but while a system modal dialog is shown. -TEST_F(TabletModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { +TEST_F(MaximizeModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { // Bounds for windows we know can be controlled. gfx::Rect rect1(10, 10, 200, 50); gfx::Rect rect2(10, 60, 200, 50); @@ -263,7 +265,7 @@ // Create the manager and make sure that all qualifying windows were detected // and changed. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMaximized()); @@ -286,7 +288,7 @@ // Destroy the manager again and check that the windows return to their // previous state. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); @@ -301,8 +303,8 @@ } // Test that non-maximizable windows get properly handled when going into -// tablet mode. -TEST_F(TabletModeWindowManagerTest, +// maximized mode. +TEST_F(MaximizeModeWindowManagerTest, PreCreateNonMaximizableButResizableWindows) { // The window bounds. gfx::Rect rect(10, 10, 200, 50); @@ -328,7 +330,7 @@ // Create the manager and make sure that all qualifying windows were detected // and changed. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); // The unlimited window should have the size of the workspace / parent window. @@ -349,7 +351,7 @@ // Destroy the manager again and check that the windows return to their // previous state. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(unlimited_window.get())->IsMaximized()); EXPECT_EQ(rect.ToString(), unlimited_window->bounds().ToString()); EXPECT_FALSE(wm::GetWindowState(limited_window.get())->IsMaximized()); @@ -359,8 +361,8 @@ } // Test that creating windows while a maximizer exists picks them properly up. -TEST_F(TabletModeWindowManagerTest, CreateWindows) { - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); +TEST_F(MaximizeModeWindowManagerTest, CreateWindows) { + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); @@ -414,9 +416,9 @@ EXPECT_EQ(rect.ToString(), w7->bounds().ToString()); EXPECT_EQ(rect.ToString(), w8->bounds().ToString()); - // After the tablet mode was disabled all windows fall back into the mode + // After the maximize mode was disabled all windows fall back into the mode // they were created for. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); @@ -430,11 +432,11 @@ EXPECT_EQ(rect.ToString(), w8->bounds().ToString()); } -// Test that a window which got created while the tablet mode window manager +// Test that a window which got created while the maximize mode window manager // is active gets restored to a usable (non tiny) size upon switching back. -TEST_F(TabletModeWindowManagerTest, +TEST_F(MaximizeModeWindowManagerTest, CreateWindowInMaximizedModeRestoresToUsefulSize) { - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); @@ -447,20 +449,20 @@ EXPECT_NE(empty_rect.ToString(), window->bounds().ToString()); gfx::Rect maximized_size = window->bounds(); - // Destroy the tablet mode and check that the resulting size of the window + // Destroy the maximize mode and check that the resulting size of the window // is remaining as it is (but not maximized). - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); EXPECT_EQ(maximized_size.ToString(), window->bounds().ToString()); } // Test that non-maximizable windows get properly handled when created in -// tablet mode. -TEST_F(TabletModeWindowManagerTest, CreateNonMaximizableButResizableWindows) { +// maximized mode. +TEST_F(MaximizeModeWindowManagerTest, CreateNonMaximizableButResizableWindows) { // Create the manager and make sure that all qualifying windows were detected // and changed. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); gfx::Rect rect(10, 10, 200, 50); @@ -498,7 +500,7 @@ // Destroy the manager again and check that the windows return to their // creation state. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(unlimited_window.get())->IsMaximized()); EXPECT_EQ(rect.ToString(), unlimited_window->bounds().ToString()); @@ -529,7 +531,7 @@ // Test that the restore state will be kept at its original value for // session restauration purposes. -TEST_F(TabletModeWindowManagerTest, TestRestoreIntegrety) { +TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { gfx::Rect bounds(10, 10, 200, 50); gfx::Size empty_size; gfx::Rect empty_bounds; @@ -541,7 +543,7 @@ EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); // With the maximization the override states should be returned in its @@ -557,7 +559,7 @@ GetPlacementOverride(maximized_window.get())); // Destroy the manager again and check that the overrides get reset. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); @@ -571,8 +573,8 @@ // Test that windows which got created before the maximizer was created can be // destroyed while the maximizer is still running. -TEST_F(TabletModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { - TabletModeWindowManager* manager = NULL; +TEST_F(MaximizeModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { + MaximizeModeWindowManager* manager = NULL; { // Bounds for windows we know can be controlled. gfx::Rect rect1(10, 10, 200, 50); @@ -589,18 +591,18 @@ // Create the manager and make sure that all qualifying windows were // detected and changed. - manager = CreateTabletModeWindowManager(); + manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); } EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that windows which got created while the maximizer was running can get // destroyed before the maximizer gets destroyed. -TEST_F(TabletModeWindowManagerTest, CreateWindowsAndDeleteWhileActive) { - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); +TEST_F(MaximizeModeWindowManagerTest, CreateWindowsAndDeleteWhileActive) { + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); { @@ -621,11 +623,11 @@ EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); } EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that windows which were maximized stay maximized. -TEST_F(TabletModeWindowManagerTest, MaximizedShouldRemainMaximized) { +TEST_F(MaximizeModeWindowManagerTest, MaximizedShouldRemainMaximized) { // Bounds for windows we know can be controlled. gfx::Rect rect(10, 10, 200, 50); std::unique_ptr<aura::Window> window( @@ -633,22 +635,22 @@ wm::GetWindowState(window.get())->Maximize(); // Create the manager and make sure that the window gets detected. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(1, manager->GetNumberOfManagedWindows()); EXPECT_TRUE(wm::GetWindowState(window.get())->IsMaximized()); // Destroy the manager again and check that the window will remain maximized. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(wm::GetWindowState(window.get())->IsMaximized()); wm::GetWindowState(window.get())->Restore(); EXPECT_EQ(rect.ToString(), window->bounds().ToString()); } // Test that minimized windows do neither get maximized nor restored upon -// entering tablet mode and get restored to their previous state after +// entering maximized mode and get restored to their previous state after // leaving. -TEST_F(TabletModeWindowManagerTest, MinimizedWindowBehavior) { +TEST_F(MaximizeModeWindowManagerTest, MinimizedWindowBehavior) { // Bounds for windows we know can be controlled. gfx::Rect rect(10, 10, 200, 50); std::unique_ptr<aura::Window> initially_minimized_window( @@ -661,7 +663,7 @@ wm::GetWindowState(initially_maximized_window.get())->Maximize(); // Create the manager and make sure that the window gets detected. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); EXPECT_TRUE( @@ -680,7 +682,7 @@ wm::GetWindowState(initially_maximized_window.get())->IsMinimized()); // Destroy the manager again and check that the window will get minimized. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE( wm::GetWindowState(initially_minimized_window.get())->IsMinimized()); EXPECT_FALSE( @@ -691,7 +693,7 @@ // Check that resizing the desktop does reposition unmaximizable, unresizable & // managed windows. -TEST_F(TabletModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { +TEST_F(MaximizeModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { UpdateDisplay("400x400"); // This window will move because it does not fit the new bounds. gfx::Rect rect(20, 300, 100, 100); @@ -705,7 +707,7 @@ aura::client::WINDOW_TYPE_NORMAL, rect2)); // Turning on the manager will reposition (but not resize) the window. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(2, manager->GetNumberOfManagedWindows()); gfx::Rect moved_bounds(window1->bounds()); @@ -721,20 +723,20 @@ // Turning off the mode should not restore to the initial coordinates since // the new resolution is smaller and the window was on the edge. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_NE(rect.ToString(), window1->bounds().ToString()); EXPECT_EQ(rect2.ToString(), window2->bounds().ToString()); } // Check that windows return to original location if desktop size changes to -// something else and back while in tablet mode. -TEST_F(TabletModeWindowManagerTest, SizeChangeReturnWindowToOriginalPos) { +// something else and back while in maximize mode. +TEST_F(MaximizeModeWindowManagerTest, SizeChangeReturnWindowToOriginalPos) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> window(CreateFixedSizeNonMaximizableWindow( aura::client::WINDOW_TYPE_NORMAL, rect)); // Turning on the manager will reposition (but not resize) the window. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(1, manager->GetNumberOfManagedWindows()); gfx::Rect moved_bounds(window->bounds()); @@ -749,15 +751,15 @@ EXPECT_NE(moved_bounds.origin().ToString(), new_moved_bounds.ToString()); // Then resize back to the original desktop size which should move windows - // to their original location after leaving the tablet mode. + // to their original location after leaving the maximize mode. ResizeDesktop(10); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_EQ(rect.ToString(), window->bounds().ToString()); } -// Check that enabling of the tablet mode does not have an impact on the MRU +// Check that enabling of the maximize mode does not have an impact on the MRU // order of windows. -TEST_F(TabletModeWindowManagerTest, ModeChangeKeepsMRUOrder) { +TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1(CreateFixedSizeNonMaximizableWindow( aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -783,7 +785,7 @@ } // Activating the window manager should keep the order. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(5, manager->GetNumberOfManagedWindows()); { @@ -798,7 +800,7 @@ } // Destroying should still keep the order. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); { aura::Window::Windows windows = Shell::Get()->mru_window_tracker()->BuildMruWindowList(); @@ -812,12 +814,12 @@ } // Check that a restore state change does always restore to maximized. -TEST_F(TabletModeWindowManagerTest, IgnoreRestoreStateChages) { +TEST_F(MaximizeModeWindowManagerTest, IgnoreRestoreStateChages) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); wm::WindowState* window_state = wm::GetWindowState(w1.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsMaximized()); window_state->Minimize(); EXPECT_TRUE(window_state->IsMinimized()); @@ -825,17 +827,18 @@ EXPECT_TRUE(window_state->IsMaximized()); window_state->Restore(); EXPECT_TRUE(window_state->IsMaximized()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Check that minimize and restore do the right thing. -TEST_F(TabletModeWindowManagerTest, TestMinimize) { +TEST_F(MaximizeModeWindowManagerTest, TestMinimize) { gfx::Rect rect(10, 10, 100, 100); std::unique_ptr<aura::Window> window( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); wm::WindowState* window_state = wm::GetWindowState(window.get()); EXPECT_EQ(rect.ToString(), window->bounds().ToString()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); EXPECT_TRUE(window_state->IsMaximized()); EXPECT_FALSE(window_state->IsMinimized()); EXPECT_TRUE(window->IsVisible()); @@ -850,7 +853,8 @@ EXPECT_FALSE(window_state->IsMinimized()); EXPECT_TRUE(window->IsVisible()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); EXPECT_FALSE(window_state->IsMaximized()); EXPECT_FALSE(window_state->IsMinimized()); EXPECT_TRUE(window->IsVisible()); @@ -858,8 +862,8 @@ // Check that a full screen window remains full screen upon entering maximize // mode. Furthermore, checks that this window is not full screen upon exiting -// tablet mode if it was un-full-screened while in tablet mode. -TEST_F(TabletModeWindowManagerTest, KeepFullScreenModeOn) { +// maximize mode if it was un-full-screened while in maximize mode. +TEST_F(MaximizeModeWindowManagerTest, KeepFullScreenModeOn) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -878,32 +882,32 @@ EXPECT_TRUE(window_state->IsFullscreen()); EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // The Full screen mode should continue to be on. EXPECT_TRUE(window_state->IsFullscreen()); EXPECT_FALSE(window_state->IsMaximized()); EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); - // With leaving the fullscreen mode, the tablet mode should return and the - // shelf should maintain its state from before tablet mode. + // With leaving the fullscreen mode, the maximized mode should return and the + // shelf should maintain its state from before maximize mode. window_state->OnWMEvent(&event); EXPECT_FALSE(window_state->IsFullscreen()); EXPECT_TRUE(window_state->IsMaximized()); EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); - // We left fullscreen mode while in tablet mode, so the window should + // We left fullscreen mode while in maximize mode, so the window should // remain maximized and the shelf should not change state upon exiting - // tablet mode. - DestroyTabletModeWindowManager(); + // maximize mode. + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsFullscreen()); EXPECT_TRUE(window_state->IsMaximized()); EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); } // Similar to the fullscreen mode, the pinned mode should be kept as well. -TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case1) { - // Scenario: in the default state, pin a window, enter to the tablet mode, +TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case1) { + // Scenario: in the default state, pin a window, enter to the maximized mode, // then unpin. gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( @@ -920,7 +924,7 @@ // Enter to Maximized mode. // The pinned mode should continue to be on. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Then unpin. @@ -929,12 +933,12 @@ // Exit from Maximized mode. // The window should not be back to the pinned mode. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); } -TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case2) { - // Scenario: in the tablet mode, pin a window, exit from the maximized +TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case2) { + // Scenario: in the maximized mode, pin a window, exit from the maximized // mode, then unpin. gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( @@ -943,7 +947,7 @@ EXPECT_FALSE(window_state->IsPinned()); // Enter to Maximized mode. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); // Pin the window. @@ -955,7 +959,7 @@ // Exit from Maximized mode. // The pinned mode should continue to be on. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Then unpin. @@ -964,17 +968,17 @@ // Enter again to Maximized mode for verification. // The window should not be back to the pinned mode. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); // Exit from Maximized mode. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); } -TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case3) { - // Scenario: in the default state, pin a window, enter to the tablet mode, - // exit from the tablet mode, then unpin. +TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case3) { + // Scenario: in the default state, pin a window, enter to the maximized mode, + // exit from the maximized mode, then unpin. gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -990,12 +994,12 @@ // Enter to Maximized mode. // The pinned mode should continue to be on. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Exit from Maximized mode. // The pinned mode should continue to be on, too. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Then unpin. @@ -1004,16 +1008,16 @@ // Enter again to Maximized mode for verification. // The window should not be back to the pinned mode. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); // Exit from Maximized mode. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } -TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case4) { - // Scenario: in the tablet mode, pin a window, exit from the maximized - // mode, enter back to the tablet mode, then unpin. +TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case4) { + // Scenario: in the maximized mode, pin a window, exit from the maximized + // mode, enter back to the maximized mode, then unpin. gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1021,7 +1025,7 @@ EXPECT_FALSE(window_state->IsPinned()); // Enter to Maximized mode. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); // Pin the window. @@ -1033,12 +1037,12 @@ // Exit from Maximized mode. // The pinned mode should continue to be on. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Enter again to Maximized mode. // The pinned mode should continue to be on, too. - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsPinned()); // Then unpin. @@ -1047,14 +1051,14 @@ // Exit from Maximized mode. // The window should not be back to the pinned mode. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsPinned()); } -// Verifies that if a window is un-full-screened while in tablet mode, +// Verifies that if a window is un-full-screened while in maximize mode, // other changes to that window's state (such as minimizing it) are -// preserved upon exiting tablet mode. -TEST_F(TabletModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) { +// preserved upon exiting maximize mode. +TEST_F(MaximizeModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1068,20 +1072,20 @@ window_state->OnWMEvent(&event); ASSERT_FALSE(window_state->IsMinimized()); - // Enter tablet mode, exit full screen, and then minimize the window. - CreateTabletModeWindowManager(); + // Enter maximize mode, exit full screen, and then minimize the window. + CreateMaximizeModeWindowManager(); window_state->OnWMEvent(&event); window_state->Minimize(); ASSERT_TRUE(window_state->IsMinimized()); - // The window should remain minimized when exiting tablet mode. - DestroyTabletModeWindowManager(); + // The window should remain minimized when exiting maximize mode. + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsMinimized()); } -// Check that full screen mode can be turned on in tablet mode and remains +// Check that full screen mode can be turned on in maximized mode and remains // upon coming back. -TEST_F(TabletModeWindowManagerTest, AllowFullScreenMode) { +TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1096,7 +1100,7 @@ EXPECT_FALSE(window_state->IsMaximized()); EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen mode should still be off and the shelf should maintain its // state. @@ -1112,17 +1116,17 @@ EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); // With the destruction of the manager we should remain in full screen. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsFullscreen()); EXPECT_FALSE(window_state->IsMaximized()); EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); } -// Check that the full screen mode will stay active when the tablet mode is +// Check that the full screen mode will stay active when the maximize mode is // ended. -TEST_F(TabletModeWindowManagerTest, +TEST_F(MaximizeModeWindowManagerTest, FullScreenModeRemainsWhenCreatedInMaximizedMode) { - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( @@ -1132,15 +1136,15 @@ window_state->OnWMEvent(&event_full_screen); EXPECT_TRUE(window_state->IsFullscreen()); - // After the tablet mode manager is ended, full screen will remain. - DestroyTabletModeWindowManager(); + // After the maximize mode manager is ended, full screen will remain. + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsFullscreen()); } // Check that the full screen mode will stay active throughout a maximzied mode // session. -TEST_F(TabletModeWindowManagerTest, - FullScreenModeRemainsThroughTabletModeSwitch) { +TEST_F(MaximizeModeWindowManagerTest, + FullScreenModeRemainsThroughMaximizeModeSwitch) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1149,16 +1153,16 @@ window_state->OnWMEvent(&event_full_screen); EXPECT_TRUE(window_state->IsFullscreen()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsFullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsFullscreen()); } // Check that an empty window does not get restored to a tiny size. -TEST_F(TabletModeWindowManagerTest, - CreateAndMaximizeInTabletModeShouldRetoreToGoodSizeGoingToDefault) { - CreateTabletModeWindowManager(); +TEST_F(MaximizeModeWindowManagerTest, + CreateAndMaximizeInMaximizeModeShouldRetoreToGoodSizeGoingToDefault) { + CreateMaximizeModeWindowManager(); gfx::Rect rect; std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1180,14 +1184,14 @@ EXPECT_EQ(requested_bounds.ToString(), window_state->GetRestoreBoundsInScreen().ToString()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_state->IsMaximized()); EXPECT_EQ(w1->bounds().ToString(), requested_bounds.ToString()); } // Check that snapping operations get ignored. -TEST_F(TabletModeWindowManagerTest, SnapModeTests) { +TEST_F(MaximizeModeWindowManagerTest, SnapModeTests) { gfx::Rect rect(20, 140, 100, 100); std::unique_ptr<aura::Window> w1( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1197,10 +1201,10 @@ window_state->OnWMEvent(&event_left); EXPECT_TRUE(window_state->IsSnapped()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen mode should now be off and it should not come back while in - // tablet mode. + // maximize mode. EXPECT_FALSE(window_state->IsSnapped()); EXPECT_TRUE(window_state->IsMaximized()); window_state->OnWMEvent(&event_left); @@ -1210,12 +1214,12 @@ EXPECT_FALSE(window_state->IsSnapped()); EXPECT_TRUE(window_state->IsMaximized()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_TRUE(window_state->IsSnapped()); } // Check that non maximizable windows cannot be dragged by the user. -TEST_F(TabletModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { +TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { gfx::Rect rect(10, 10, 100, 100); std::unique_ptr<aura::Window> window(CreateFixedSizeNonMaximizableWindow( aura::client::WINDOW_TYPE_NORMAL, rect)); @@ -1235,7 +1239,8 @@ // 2. Check that turning on the manager will stop allowing the window from // dragging. - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); gfx::Rect center_bounds(window->bounds()); EXPECT_NE(rect.origin().ToString(), center_bounds.origin().ToString()); generator.MoveMouseTo( @@ -1246,7 +1251,8 @@ generator.ReleaseLeftButton(); EXPECT_EQ(center_bounds.x(), window->bounds().x()); EXPECT_EQ(center_bounds.y(), window->bounds().y()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + false); // 3. Releasing the mazimize manager again will restore the window to its // previous bounds and @@ -1260,10 +1266,10 @@ EXPECT_EQ(first_dragged_origin.y() + 5, window->bounds().y()); } -// Test that overview is exited before entering / exiting tablet mode so that -// the window changes made by TabletModeWindowManager do not conflict with +// Test that overview is exited before entering / exiting maximize mode so that +// the window changes made by MaximizeModeWindowManager do not conflict with // those made in WindowOverview. -TEST_F(TabletModeWindowManagerTest, ExitsOverview) { +TEST_F(MaximizeModeWindowManagerTest, ExitsOverview) { // Bounds for windows we know can be controlled. gfx::Rect rect1(10, 10, 200, 50); gfx::Rect rect2(10, 60, 200, 50); @@ -1276,7 +1282,7 @@ Shell::Get()->window_selector_controller(); ASSERT_TRUE(window_selector_controller->ToggleOverview()); ASSERT_TRUE(window_selector_controller->IsSelecting()); - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_FALSE(window_selector_controller->IsSelecting()); @@ -1284,12 +1290,12 @@ ASSERT_TRUE(window_selector_controller->IsSelecting()); // Destroy the manager again and check that the windows return to their // previous state. - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(window_selector_controller->IsSelecting()); } // Test that an edge swipe from the top will end full screen mode. -TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { +TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { // TODO: investigate failure. http://crbug.com/698093. if (Shell::GetAshConfig() == Config::MASH) return; @@ -1304,7 +1310,7 @@ wm::WindowState* foreground_window_state = wm::GetWindowState(foreground_window.get()); wm::ActivateWindow(foreground_window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen both windows. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1329,11 +1335,11 @@ EXPECT_FALSE(foreground_window_state->IsFullscreen()); EXPECT_TRUE(background_window_state->IsFullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that an edge swipe from the bottom will end full screen mode. -TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { +TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { // TODO: investigate failure. http://crbug.com/698093. if (Shell::GetAshConfig() == Config::MASH) return; @@ -1348,7 +1354,7 @@ wm::WindowState* foreground_window_state = wm::GetWindowState(foreground_window.get()); wm::ActivateWindow(foreground_window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen both windows. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1367,11 +1373,11 @@ EXPECT_FALSE(foreground_window_state->IsFullscreen()); EXPECT_TRUE(background_window_state->IsFullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that an edge touch press at the top will end full screen mode. -TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { +TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { // TODO: investigate failure. http://crbug.com/698093. if (Shell::GetAshConfig() == Config::MASH) return; @@ -1386,7 +1392,7 @@ wm::WindowState* foreground_window_state = wm::GetWindowState(foreground_window.get()); wm::ActivateWindow(foreground_window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen both windows. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1407,11 +1413,11 @@ EXPECT_FALSE(foreground_window_state->IsFullscreen()); EXPECT_TRUE(background_window_state->IsFullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that an edge touch press at the bottom will end full screen mode. -TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { +TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { // TODO: investigate failure. http://crbug.com/698093. if (Shell::GetAshConfig() == Config::MASH) return; @@ -1426,7 +1432,7 @@ wm::WindowState* foreground_window_state = wm::GetWindowState(foreground_window.get()); wm::ActivateWindow(foreground_window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen both windows. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1449,17 +1455,17 @@ EXPECT_FALSE(foreground_window_state->IsFullscreen()); EXPECT_TRUE(background_window_state->IsFullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that an edge swipe from the top on an immersive mode window will not end // full screen mode. -TEST_F(TabletModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { +TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { std::unique_ptr<aura::Window> window(CreateWindow( aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(10, 10, 200, 50))); wm::WindowState* window_state = wm::GetWindowState(window.get()); wm::ActivateWindow(window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen the window. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1479,17 +1485,17 @@ EXPECT_TRUE(window_state->IsFullscreen()); EXPECT_TRUE(window_state->in_immersive_fullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Test that an edge swipe from the bottom will not end immersive mode. -TEST_F(TabletModeWindowManagerTest, +TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromBottom) { std::unique_ptr<aura::Window> window(CreateWindow( aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(10, 10, 200, 50))); wm::WindowState* window_state = wm::GetWindowState(window.get()); wm::ActivateWindow(window.get()); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); // Fullscreen the window. wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); @@ -1510,13 +1516,13 @@ EXPECT_TRUE(window_state->IsFullscreen()); EXPECT_TRUE(window_state->in_immersive_fullscreen()); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } // Tests that windows with the always-on-top property are not managed by -// the TabletModeWindowManager while tablet mode is engaged (i.e., +// the MaximizeModeWindowManager while maximize mode is engaged (i.e., // they remain free-floating). -TEST_F(TabletModeWindowManagerTest, AlwaysOnTopWindows) { +TEST_F(MaximizeModeWindowManagerTest, AlwaysOnTopWindows) { gfx::Rect rect1(10, 10, 200, 50); gfx::Rect rect2(20, 140, 100, 100); @@ -1534,10 +1540,10 @@ EXPECT_TRUE(wm::GetWindowState(w1.get())->can_be_dragged()); EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); - // Enter tablet mode. Neither window should be managed because they have + // Enter maximize mode. Neither window should be managed because they have // the always-on-top property set, which means that none of their properties // should change. - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); @@ -1575,8 +1581,8 @@ EXPECT_TRUE(wm::GetWindowState(w1.get())->can_be_dragged()); EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); - // The always-on-top windows should not change when leaving tablet mode. - DestroyTabletModeWindowManager(); + // The always-on-top windows should not change when leaving maximize mode. + DestroyMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); EXPECT_EQ(rect1.ToString(), w1->bounds().ToString()); @@ -1587,14 +1593,14 @@ // Tests that windows that can control maximized bounds are not maximized // and not tracked. -TEST_F(TabletModeWindowManagerTest, DontMaximizeClientManagedWindows) { +TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { gfx::Rect rect(10, 10, 200, 50); std::unique_ptr<aura::Window> window( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); wm::GetWindowState(window.get())->set_allow_set_bounds_direct(true); - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); } @@ -1647,13 +1653,13 @@ } // namespace -TEST_F(TabletModeWindowManagerTest, StateTyepChange) { +TEST_F(MaximizeModeWindowManagerTest, StateTyepChange) { TestObserver observer; gfx::Rect rect(10, 10, 200, 50); std::unique_ptr<aura::Window> window( CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); - CreateTabletModeWindowManager(); + CreateMaximizeModeWindowManager(); wm::WindowState* window_state = wm::GetWindowState(window.get()); window_state->AddObserver(&observer); @@ -1663,7 +1669,7 @@ EXPECT_EQ(0, observer.GetPreCountAndReset()); EXPECT_EQ(0, observer.GetPostCountAndReset()); - // Window is already in tablet mode. + // Window is already in maximized mode. wm::WMEvent maximize_event(wm::WM_EVENT_MAXIMIZE); window_state->OnWMEvent(&maximize_event); EXPECT_EQ(0, observer.GetPreCountAndReset()); @@ -1698,7 +1704,7 @@ window_state->RemoveObserver(&observer); - DestroyTabletModeWindowManager(); + DestroyMaximizeModeWindowManager(); } } // namespace ash
diff --git a/ash/wm/tablet_mode/tablet_mode_window_state.cc b/ash/wm/maximize_mode/maximize_mode_window_state.cc similarity index 89% rename from ash/wm/tablet_mode/tablet_mode_window_state.cc rename to ash/wm/maximize_mode/maximize_mode_window_state.cc index ab0e7bc..be0df25 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_state.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc
@@ -2,19 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/wm/tablet_mode/tablet_mode_window_state.h" +#include "ash/wm/maximize_mode/maximize_mode_window_state.h" #include <utility> #include "ash/public/cpp/shell_window_ids.h" #include "ash/screen_util.h" #include "ash/shell.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include "ash/wm/screen_pinning_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" #include "ash/wm/window_animation_types.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_state_util.h" #include "ash/wm/wm_event.h" +#include "ash/wm_window.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" #include "ui/compositor/layer.h" @@ -101,7 +102,7 @@ } // namespace // static -void TabletModeWindowState::UpdateWindowPosition( +void MaximizeModeWindowState::UpdateWindowPosition( wm::WindowState* window_state) { gfx::Rect bounds_in_parent = GetBoundsInMaximizedMode(window_state); if (bounds_in_parent == window_state->window()->bounds()) @@ -109,8 +110,9 @@ window_state->SetBoundsDirect(bounds_in_parent); } -TabletModeWindowState::TabletModeWindowState(aura::Window* window, - TabletModeWindowManager* creator) +MaximizeModeWindowState::MaximizeModeWindowState( + aura::Window* window, + MaximizeModeWindowManager* creator) : window_(window), creator_(creator), current_state_type_(wm::GetWindowState(window)->GetStateType()), @@ -120,17 +122,17 @@ .release()); } -TabletModeWindowState::~TabletModeWindowState() { +MaximizeModeWindowState::~MaximizeModeWindowState() { creator_->WindowStateDestroyed(window_); } -void TabletModeWindowState::LeaveTabletMode(wm::WindowState* window_state) { +void MaximizeModeWindowState::LeaveMaximizeMode(wm::WindowState* window_state) { // Note: When we return we will destroy ourselves with the |our_reference|. std::unique_ptr<wm::WindowState::State> our_reference = window_state->SetStateObject(std::move(old_state_)); } -void TabletModeWindowState::SetDeferBoundsUpdates(bool defer_bounds_updates) { +void MaximizeModeWindowState::SetDeferBoundsUpdates(bool defer_bounds_updates) { if (defer_bounds_updates_ == defer_bounds_updates) return; @@ -139,8 +141,8 @@ UpdateBounds(wm::GetWindowState(window_), true); } -void TabletModeWindowState::OnWMEvent(wm::WindowState* window_state, - const wm::WMEvent* event) { +void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state, + const wm::WMEvent* event) { // Ignore events that are sent during the exit transition. if (ignore_wm_events_) { return; @@ -227,11 +229,11 @@ } } -wm::WindowStateType TabletModeWindowState::GetType() const { +wm::WindowStateType MaximizeModeWindowState::GetType() const { return current_state_type_; } -void TabletModeWindowState::AttachState( +void MaximizeModeWindowState::AttachState( wm::WindowState* window_state, wm::WindowState::State* previous_state) { current_state_type_ = previous_state->GetType(); @@ -257,16 +259,16 @@ window_state->set_can_be_dragged(false); } -void TabletModeWindowState::DetachState(wm::WindowState* window_state) { +void MaximizeModeWindowState::DetachState(wm::WindowState* window_state) { // From now on, we can use the default session restore mechanism again. SetWindowRestoreOverrides(window_state->window(), gfx::Rect(), ui::SHOW_STATE_NORMAL); window_state->set_can_be_dragged(true); } -void TabletModeWindowState::UpdateWindow(wm::WindowState* window_state, - wm::WindowStateType target_state, - bool animated) { +void MaximizeModeWindowState::UpdateWindow(wm::WindowState* window_state, + wm::WindowStateType target_state, + bool animated) { DCHECK(target_state == wm::WINDOW_STATE_TYPE_MINIMIZED || target_state == wm::WINDOW_STATE_TYPE_MAXIMIZED || target_state == wm::WINDOW_STATE_TYPE_PINNED || @@ -305,7 +307,7 @@ old_state_type == wm::WINDOW_STATE_TYPE_TRUSTED_PINNED || target_state == wm::WINDOW_STATE_TYPE_TRUSTED_PINNED) { Shell::Get()->screen_pinning_controller()->SetPinnedWindow( - window_state->window()); + WmWindow::Get(window_state->window())); } if ((window_state->window()->layer()->GetTargetVisibility() || @@ -317,14 +319,14 @@ } } -wm::WindowStateType TabletModeWindowState::GetMaximizedOrCenteredWindowType( +wm::WindowStateType MaximizeModeWindowState::GetMaximizedOrCenteredWindowType( wm::WindowState* window_state) { return window_state->CanMaximize() ? wm::WINDOW_STATE_TYPE_MAXIMIZED : wm::WINDOW_STATE_TYPE_NORMAL; } -void TabletModeWindowState::UpdateBounds(wm::WindowState* window_state, - bool animated) { +void MaximizeModeWindowState::UpdateBounds(wm::WindowState* window_state, + bool animated) { if (defer_bounds_updates_) return; gfx::Rect bounds_in_parent = GetBoundsInMaximizedMode(window_state); @@ -336,7 +338,7 @@ !window_state->window()->IsVisible() || !animated) { window_state->SetBoundsDirect(bounds_in_parent); } else { - // If we animate (to) tablet mode, we want to use the cross fade to + // If we animate (to) maximized mode, we want to use the cross fade to // avoid flashing. if (window_state->IsMaximized()) window_state->SetBoundsDirectCrossFade(bounds_in_parent);
diff --git a/ash/wm/tablet_mode/tablet_mode_window_state.h b/ash/wm/maximize_mode/maximize_mode_window_state.h similarity index 80% rename from ash/wm/tablet_mode/tablet_mode_window_state.h rename to ash/wm/maximize_mode/maximize_mode_window_state.h index 7c4c630..4ab3d5a2 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_state.h +++ b/ash/wm/maximize_mode/maximize_mode_window_state.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_STATE_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_STATE_H_ +#ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ +#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ #include <memory> @@ -11,13 +11,13 @@ #include "base/macros.h" namespace ash { -class TabletModeWindowManager; +class MaximizeModeWindowManager; -// The TabletModeWindowState implementation which reduces all possible window +// The MaximizeModeWindowState implementation which reduces all possible window // states to minimized and maximized. If a window cannot be maximized it will be // set to normal. If a window cannot fill the entire workspace it will be // centered within the workspace. -class TabletModeWindowState : public wm::WindowState::State { +class MaximizeModeWindowState : public wm::WindowState::State { public: // Called when the window position might need to be updated. static void UpdateWindowPosition(wm::WindowState* window_state); @@ -26,13 +26,14 @@ // state handler. Upon destruction it will restore the previous state handler // and call |creator::WindowStateDestroyed()| to inform that the window mode // was reverted to the old window manager. - TabletModeWindowState(aura::Window* window, TabletModeWindowManager* creator); - ~TabletModeWindowState() override; + MaximizeModeWindowState(aura::Window* window, + MaximizeModeWindowManager* creator); + ~MaximizeModeWindowState() override; void set_ignore_wm_events(bool ignore) { ignore_wm_events_ = ignore; } - // Leaves the tablet mode by reverting to previous state object. - void LeaveTabletMode(wm::WindowState* window_state); + // Leaves the maximize mode by reverting to previous state object. + void LeaveMaximizeMode(wm::WindowState* window_state); // Sets whether to ignore bounds updates. If set to false, immediately does a // bounds update as the current window bounds may no longer be correct. @@ -72,7 +73,7 @@ aura::Window* window_; // The creator which needs to be informed when this state goes away. - TabletModeWindowManager* creator_; + MaximizeModeWindowManager* creator_; // The current state type. Due to the nature of this state, this can only be // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. @@ -84,9 +85,9 @@ // If true, the state will not process events. bool ignore_wm_events_ = false; - DISALLOW_COPY_AND_ASSIGN(TabletModeWindowState); + DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); }; } // namespace ash -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_WINDOW_STATE_H_ +#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_
diff --git a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h new file mode 100644 index 0000000..6a1cbde --- /dev/null +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h
@@ -0,0 +1,17 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_ +#define ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_ + +namespace ash { + +class ScopedDisableInternalMouseAndKeyboard { + public: + virtual ~ScopedDisableInternalMouseAndKeyboard() {} +}; + +} // namespace ash + +#endif // ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_
diff --git a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc similarity index 95% rename from ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc rename to ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc index c45c1d2..3007324 100644 --- a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.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 "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h" #include <set>
diff --git a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h similarity index 71% rename from ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h rename to ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h index 9bd307c..c6370aa9 100644 --- a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_ -#define ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_ +#ifndef ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_ +#define ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_ #include "ash/ash_export.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" #include "base/macros.h" namespace ash { @@ -29,4 +29,4 @@ } // namespace ash -#endif // ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_ +#endif // ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_OZONE_H_
diff --git a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc similarity index 98% rename from ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc rename to ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc index e9de2bd..cc7a99b490 100644 --- a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.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 "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" -#include <X11/Xlib.h> #include <X11/extensions/XInput2.h> +#include <X11/Xlib.h> #include <memory> #include <set>
diff --git a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h similarity index 79% rename from ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h rename to ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h index 63f97c5..6c8f47d 100644 --- a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard_x11.h +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.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 ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_ -#define ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_ +#ifndef ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_ +#define ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_ #include <vector> #include "ash/ash_export.h" -#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h" +#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h" #include "base/macros.h" #include "ui/events/platform/platform_event_observer.h" #include "ui/gfx/geometry/point.h" @@ -42,4 +42,4 @@ } // namespace ash -#endif // ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_ +#endif // ASH_WM_MAXIMIZE_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_X11_H_
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index c69caf2..ee95662 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc
@@ -17,12 +17,12 @@ #include "ash/test/shelf_view_test_api.h" #include "ash/test/shell_test_api.h" #include "ash/test/test_app_list_view_presenter_impl.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/overview/window_grid.h" #include "ash/wm/overview/window_selector.h" #include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/overview/window_selector_item.h" #include "ash/wm/panels/panel_layout_manager.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" @@ -887,11 +887,12 @@ // Tests that entering overview when a fullscreen window is active in maximized // mode correctly applies the transformations to the window and correctly // updates the window bounds on exiting overview mode: http://crbug.com/401664. -TEST_F(WindowSelectorTest, FullscreenWindowTabletMode) { +TEST_F(WindowSelectorTest, FullscreenWindowMaximizeMode) { gfx::Rect bounds(0, 0, 400, 400); std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); wm::ActivateWindow(window2.get()); wm::ActivateWindow(window1.get()); gfx::Rect normal_window_bounds(window1->bounds());
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc index 076c2c9..efbdbca2 100644 --- a/ash/wm/power_button_controller.cc +++ b/ash/wm/power_button_controller.cc
@@ -13,8 +13,8 @@ #include "ash/system/power/tablet_power_button_controller.h" #include "ash/system/tray/system_tray.h" #include "ash/wm/lock_state_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/session_state_animator.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/command_line.h" #include "chromeos/audio/cras_audio_handler.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -59,8 +59,8 @@ bool should_take_screenshot = down && volume_down_pressed_ && Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); if (!has_legacy_power_button_ && !should_take_screenshot && tablet_controller_ &&
diff --git a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h b/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h deleted file mode 100644 index 51b8426..0000000 --- a/ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_ -#define ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_ - -namespace ash { - -class ScopedDisableInternalMouseAndKeyboard { - public: - virtual ~ScopedDisableInternalMouseAndKeyboard() {} -}; - -} // namespace ash - -#endif // ASH_WM_TABLET_MODE_SCOPED_DISABLE_INTERNAL_MOUSE_AND_KEYBOARD_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.cc b/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.cc deleted file mode 100644 index f268763..0000000 --- a/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.cc +++ /dev/null
@@ -1,17 +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. - -#include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" - -namespace ash { - -TabletModeBackdropDelegateImpl::TabletModeBackdropDelegateImpl() = default; - -TabletModeBackdropDelegateImpl::~TabletModeBackdropDelegateImpl() = default; - -bool TabletModeBackdropDelegateImpl::HasBackdrop(aura::Window* window) { - return true; -} - -} // namespace ash
diff --git a/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h b/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h deleted file mode 100644 index 1e70719c..0000000 --- a/ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h +++ /dev/null
@@ -1,32 +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. - -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_BACKDROP_DELEGATE_IMPL_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_BACKDROP_DELEGATE_IMPL_H_ - -#include "ash/wm/workspace/backdrop_delegate.h" - -#include "ash/ash_export.h" -#include "base/macros.h" - -namespace ash { - -// A backdrop delegate for MaximizedMode, which always creates a backdrop. -// This is also used in the WorkspaceLayoutManagerBackdropTest, hence -// is public. -class ASH_EXPORT TabletModeBackdropDelegateImpl : public BackdropDelegate { - public: - TabletModeBackdropDelegateImpl(); - ~TabletModeBackdropDelegateImpl() override; - - protected: - bool HasBackdrop(aura::Window* window) override; - - private: - DISALLOW_COPY_AND_ASSIGN(TabletModeBackdropDelegateImpl); -}; - -} // namespace ash - -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_BACKDROP_DELEGATE_IMPL_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_event_handler.h b/ash/wm/tablet_mode/tablet_mode_event_handler.h deleted file mode 100644 index 8c30275..0000000 --- a/ash/wm/tablet_mode/tablet_mode_event_handler.h +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_H_ - -#include "base/macros.h" - -namespace ui { -class TouchEvent; -} - -namespace ash { -namespace wm { - -// TabletModeEventHandler handles toggling fullscreen when appropriate. -// TabletModeEventHandler installs event handlers in an environment specific -// way, e.g. EventHandler for aura. -class TabletModeEventHandler { - public: - TabletModeEventHandler(); - virtual ~TabletModeEventHandler(); - - protected: - // Subclasses call this to toggle fullscreen. If a toggle happened returns - // true. - bool ToggleFullscreen(const ui::TouchEvent& event); - - private: - DISALLOW_COPY_AND_ASSIGN(TabletModeEventHandler); -}; - -} // namespace wm -} // namespace ash - -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_H_
diff --git a/ash/wm/tablet_mode/tablet_mode_event_handler_aura.h b/ash/wm/tablet_mode/tablet_mode_event_handler_aura.h deleted file mode 100644 index 55536b4..0000000 --- a/ash/wm/tablet_mode/tablet_mode_event_handler_aura.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_AURA_H_ -#define ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_AURA_H_ - -#include "ash/ash_export.h" -#include "ash/wm/tablet_mode/tablet_mode_event_handler.h" -#include "ui/events/event_handler.h" - -namespace ash { -namespace wm { - -// Implementation of TabletModeEventHandler for aura. Uses ui::EventHandler. -class ASH_EXPORT TabletModeEventHandlerAura : public TabletModeEventHandler, - public ui::EventHandler { - public: - TabletModeEventHandlerAura(); - ~TabletModeEventHandlerAura() override; - - private: - // ui::EventHandler override: - void OnTouchEvent(ui::TouchEvent* event) override; - - DISALLOW_COPY_AND_ASSIGN(TabletModeEventHandlerAura); -}; - -} // namespace wm -} // namespace ash - -#endif // ASH_WM_TABLET_MODE_TABLET_MODE_EVENT_HANDLER_AURA_H_
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc index 577c45c3..81879dd 100644 --- a/ash/wm/window_positioner.cc +++ b/ash/wm/window_positioner.cc
@@ -35,7 +35,7 @@ namespace { // When a window gets opened in default mode and the screen is less than or -// equal to this width, the window will get opened in tablet mode. This value +// equal to this width, the window will get opened in maximized mode. This value // can be reduced to a "tame" number if the feature is disabled. const int kForceMaximizeWidthLimit = 1366;
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc index 4854ac8..d19f86ab 100644 --- a/ash/wm/window_positioner_unittest.cc +++ b/ash/wm/window_positioner_unittest.cc
@@ -137,7 +137,7 @@ // opened being not maximized. To enforce maximization for all screen // resolutions, one can set "ForceMaximizeBrowserWindowOnFirstRun" // policy. In the following tests we check if the window will be opened in -// tablet mode for low and high resolution when this policy is set. +// maximized mode for low and high resolution when this policy is set. TEST_F(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) { const int width = ash::WindowPositioner::GetForceMaximizedWidthLimit() + 100; // Set resolution to 1466x300.
diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc index 43bb2e7..e82530f 100644 --- a/ash/wm/window_properties.cc +++ b/ash/wm/window_properties.cc
@@ -11,6 +11,8 @@ namespace ash { +DEFINE_UI_CLASS_PROPERTY_KEY(bool, kChildrenUseExtendedHitRegion, false); + DEFINE_UI_CLASS_PROPERTY_KEY(bool, kLockedToRootKey, false); DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, kRestoreBoundsOverrideKey, NULL);
diff --git a/ash/wm/window_properties.h b/ash/wm/window_properties.h index 80b6438..bc412d0 100644 --- a/ash/wm/window_properties.h +++ b/ash/wm/window_properties.h
@@ -40,19 +40,24 @@ // Alphabetical sort. +// If this is set to true, the hit region for children is slightly larger for +// easier resizing. +ASH_EXPORT extern const aura::WindowProperty<bool>* const + kChildrenUseExtendedHitRegion; + // If this is set to true, the window stays in the same root window even if the // bounds outside of its root window is set. ASH_EXPORT extern const aura::WindowProperty<bool>* const kLockedToRootKey; // A property key which stores the bounds to restore a window to. These take // preference over the current bounds/state. This is used by e.g. the always -// tablet mode window manager. +// maximized mode window manager. ASH_EXPORT extern const aura::WindowProperty<gfx::Rect*>* const kRestoreBoundsOverrideKey; // A property key which stores the bounds to restore a window to. These take // preference over the current bounds/state if |kRestoreBoundsOverrideKey| is -// set. This is used by e.g. the always tablet mode window manager. +// set. This is used by e.g. the always maximized mode window manager. ASH_EXPORT extern const aura::WindowProperty<ui::WindowShowState>* const kRestoreShowStateOverrideKey;
diff --git a/ash/wm/window_state.h b/ash/wm/window_state.h index c0e32b5..a1dcbfb8 100644 --- a/ash/wm/window_state.h +++ b/ash/wm/window_state.h
@@ -22,7 +22,7 @@ namespace ash { class LockWindowState; -class TabletModeWindowState; +class MaximizeModeWindowState; namespace mojom { enum class WindowPinType; @@ -326,7 +326,7 @@ private: friend class DefaultState; friend class ash::LockWindowState; - friend class ash::TabletModeWindowState; + friend class ash::MaximizeModeWindowState; friend WindowState* GetWindowState(aura::Window*); FRIEND_TEST_ALL_PREFIXES(WindowAnimationsTest, CrossFadeToBounds); FRIEND_TEST_ALL_PREFIXES(WindowAnimationsTest,
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 6c033a6..b1bba1c 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc
@@ -31,6 +31,7 @@ #include "ui/gfx/geometry/size.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" +#include "ui/wm/core/easy_resize_window_targeter.h" #include "ui/wm/core/window_util.h" #include "ui/wm/public/activation_client.h" @@ -145,6 +146,27 @@ : HTNOWHERE; } +void SetChildrenUseExtendedHitRegionForWindow(aura::Window* window) { + window->SetProperty(kChildrenUseExtendedHitRegion, true); + gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, + -kResizeOutsideBoundsSize, + -kResizeOutsideBoundsSize); + gfx::Insets touch_extend = + mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); + // TODO: EasyResizeWindowTargeter makes it so children get events outside + // their bounds. This only works in mash when mash is providing the non-client + // frame. Mus needs to support an api for the WindowManager that enables + // events to be dispatched to windows outside the windows bounds that this + // function calls into. http://crbug.com/679056. + window->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( + window, mouse_extend, touch_extend)); +} + +bool ShouldUseExtendedHitRegionForWindow(const aura::Window* window) { + const aura::Window* parent = window->parent(); + return parent && parent->GetProperty(kChildrenUseExtendedHitRegion); +} + void CloseWidgetForWindow(aura::Window* window) { if (Shell::GetAshConfig() == Config::MASH && window->GetProperty(kWidgetCreationTypeKey) ==
diff --git a/ash/wm/window_util.h b/ash/wm/window_util.h index 1697eebc..d3fcf3d5 100644 --- a/ash/wm/window_util.h +++ b/ash/wm/window_util.h
@@ -77,6 +77,11 @@ ASH_EXPORT int GetNonClientComponent(aura::Window* window, const gfx::Point& location); +// When set, the child windows should get a slightly larger hit region to make +// resizing easier. +ASH_EXPORT void SetChildrenUseExtendedHitRegionForWindow(aura::Window* window); +ASH_EXPORT bool ShouldUseExtendedHitRegionForWindow(const aura::Window* window); + // Requests the |window| to close and destroy itself. This is intended to // forward to an associated widget. ASH_EXPORT void CloseWidgetForWindow(aura::Window* window);
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index e237be4..5a67d72 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -28,8 +28,8 @@ #include "ash/test/test_session_controller_client.h" #include "ash/test/workspace_controller_test_api.h" #include "ash/wm/fullscreen_window_finder.h" +#include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" @@ -981,7 +981,7 @@ void ShowTopWindowBackdrop(bool show) { std::unique_ptr<BackdropDelegate> backdrop; if (show) { - backdrop = base::MakeUnique<TabletModeBackdropDelegateImpl>(); + backdrop = base::MakeUnique<MaximizeModeBackdropDelegateImpl>(); } GetWorkspaceLayoutManager(default_container_) ->SetBackdropDelegate(std::move(backdrop)); @@ -1238,7 +1238,7 @@ EXPECT_EQ(children[3], window3.get()); } - // Enabling the backdrop delegate for tablet mode will put the + // Enabling the backdrop delegate for maximized mode will put the // backdrop on the top most window. ShowTopWindowBackdrop(true); {
diff --git a/ash/wm_window.cc b/ash/wm_window.cc index 256a1ab..07feeec 100644 --- a/ash/wm_window.cc +++ b/ash/wm_window.cc
@@ -97,13 +97,6 @@ : nullptr; } -bool WmWindow::ShouldUseExtendedHitRegion() const { - const WmWindow* parent = Get(window_->parent()); - return parent && - static_cast<const WmWindow*>(parent) - ->children_use_extended_hit_region_; -} - void WmWindow::Destroy() { delete window_; // WARNING: this has been deleted. @@ -515,22 +508,6 @@ wm::SnapWindowToPixelBoundary(window_); } -void WmWindow::SetChildrenUseExtendedHitRegion() { - children_use_extended_hit_region_ = true; - gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, - -kResizeOutsideBoundsSize, - -kResizeOutsideBoundsSize); - gfx::Insets touch_extend = - mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); - // TODO: EasyResizeWindowTargeter makes it so children get events outside - // their bounds. This only works in mash when mash is providing the non-client - // frame. Mus needs to support an api for the WindowManager that enables - // events to be dispatched to windows outside the windows bounds that this - // function calls into. http://crbug.com/679056. - window_->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( - window_, mouse_extend, touch_extend)); -} - void WmWindow::AddTransientWindowObserver(WmTransientWindowObserver* observer) { if (!added_transient_observer_) { added_transient_observer_ = true;
diff --git a/ash/wm_window.h b/ash/wm_window.h index 2e6595a..6aefd96 100644 --- a/ash/wm_window.h +++ b/ash/wm_window.h
@@ -87,9 +87,6 @@ aura::Window* aura_window() { return window_; } const aura::Window* aura_window() const { return window_; } - // See description of |children_use_extended_hit_region_|. - bool ShouldUseExtendedHitRegion() const; - void Destroy(); WmWindow* GetRootWindow() { @@ -279,9 +276,6 @@ // the ancestor. void SnapToPixelBoundaryIfNecessary(); - // Makes the hit region for children slightly larger for easier resizing. - void SetChildrenUseExtendedHitRegion(); - void AddTransientWindowObserver(WmTransientWindowObserver* observer); void RemoveTransientWindowObserver(WmTransientWindowObserver* observer); @@ -299,10 +293,6 @@ bool added_transient_observer_ = false; base::ObserverList<WmTransientWindowObserver> transient_observers_; - // If true child windows should get a slightly larger hit region to make - // resizing easier. - bool children_use_extended_hit_region_ = false; - DISALLOW_COPY_AND_ASSIGN(WmWindow); };
diff --git a/base/sys_info_android.cc b/base/sys_info_android.cc index 8b5a9da..b21bd2d 100644 --- a/base/sys_info_android.cc +++ b/base/sys_info_android.cc
@@ -66,11 +66,16 @@ const int kDefaultAndroidMinorVersion = 0; const int kDefaultAndroidBugfixVersion = 99; -// Parse out the OS version numbers from the system properties. -void ParseOSVersionNumbers(const char* os_version_str, - int32_t* major_version, - int32_t* minor_version, - int32_t* bugfix_version) { +// Get and parse out the OS version numbers from the system properties. +// Note if parse fails, the "default" version is returned as fallback. +void GetOsVersionStringAndNumbers(std::string* version_string, + int32_t* major_version, + int32_t* minor_version, + int32_t* bugfix_version) { + // Read the version number string out from the properties. + char os_version_str[PROP_VALUE_MAX]; + __system_property_get("ro.build.version.release", os_version_str); + if (os_version_str[0]) { // Try to parse out the version numbers from the string. int num_read = sscanf(os_version_str, "%d.%d.%d", major_version, @@ -78,8 +83,11 @@ if (num_read > 0) { // If we don't have a full set of version numbers, make the extras 0. - if (num_read < 2) *minor_version = 0; - if (num_read < 3) *bugfix_version = 0; + if (num_read < 2) + *minor_version = 0; + if (num_read < 3) + *bugfix_version = 0; + *version_string = std::string(os_version_str); return; } } @@ -88,6 +96,8 @@ *major_version = kDefaultAndroidMajorVersion; *minor_version = kDefaultAndroidMinorVersion; *bugfix_version = kDefaultAndroidBugfixVersion; + *version_string = ::base::StringPrintf("%d.%d.%d", *major_version, + *minor_version, *bugfix_version); } // Parses a system property (specified with unit 'k','m' or 'g'). @@ -171,21 +181,18 @@ } std::string SysInfo::OperatingSystemVersion() { + std::string version_string; int32_t major, minor, bugfix; - OperatingSystemVersionNumbers(&major, &minor, &bugfix); - return StringPrintf("%d.%d.%d", major, minor, bugfix); + GetOsVersionStringAndNumbers(&version_string, &major, &minor, &bugfix); + return version_string; } void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, int32_t* minor_version, int32_t* bugfix_version) { - // Read the version number string out from the properties. - char os_version_str[PROP_VALUE_MAX]; - __system_property_get("ro.build.version.release", os_version_str); - - // Parse out the numbers. - ParseOSVersionNumbers(os_version_str, major_version, minor_version, - bugfix_version); + std::string version_string; + GetOsVersionStringAndNumbers(&version_string, major_version, minor_version, + bugfix_version); } std::string SysInfo::GetAndroidBuildCodename() {
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc index 1215b2a3..d55e21b1 100644 --- a/base/threading/sequenced_worker_pool.cc +++ b/base/threading/sequenced_worker_pool.cc
@@ -1545,13 +1545,6 @@ return new SequencedWorkerPoolTaskRunner(this, shutdown_behavior); } -bool SequencedWorkerPool::PostWorkerTask( - const tracked_objects::Location& from_here, - OnceClosure task) { - return inner_->PostTask(NULL, SequenceToken(), BLOCK_SHUTDOWN, from_here, - std::move(task), TimeDelta()); -} - bool SequencedWorkerPool::PostWorkerTaskWithShutdownBehavior( const tracked_objects::Location& from_here, OnceClosure task,
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h index 043df2dd..d86760b4 100644 --- a/base/threading/sequenced_worker_pool.h +++ b/base/threading/sequenced_worker_pool.h
@@ -55,7 +55,7 @@ // You can make named sequence tokens to make it easier to share a token // across different components. // -// You can also post tasks to the pool without ordering using PostWorkerTask. +// You can also post tasks to the pool without ordering using PostTask. // These will be executed in an unspecified order. The order of execution // between tasks with different sequence tokens is also unspecified. // @@ -255,29 +255,6 @@ scoped_refptr<TaskRunner> GetTaskRunnerWithShutdownBehavior( WorkerShutdown shutdown_behavior) WARN_UNUSED_RESULT; - // Posts the given task for execution in the worker pool. Tasks posted with - // this function will execute in an unspecified order on a background thread. - // Returns true if the task was posted. If your tasks have ordering - // requirements, see PostSequencedWorkerTask(). - // - // This class will attempt to delete tasks that aren't run - // (non-block-shutdown semantics) but can't guarantee that this happens. If - // all worker threads are busy running CONTINUE_ON_SHUTDOWN tasks, there - // will be no workers available to delete these tasks. And there may be - // tasks with the same sequence token behind those CONTINUE_ON_SHUTDOWN - // tasks. Deleting those tasks before the previous one has completed could - // cause nondeterministic crashes because the task could be keeping some - // objects alive which do work in their destructor, which could voilate the - // assumptions of the running task. - // - // The task will be guaranteed to run to completion before shutdown - // (BLOCK_SHUTDOWN semantics). - // - // Returns true if the task was posted successfully. This may fail during - // shutdown regardless of the specified ShutdownBehavior. - bool PostWorkerTask(const tracked_objects::Location& from_here, - OnceClosure task); - // Same as PostWorkerTask but allows specification of the shutdown behavior. bool PostWorkerTaskWithShutdownBehavior( const tracked_objects::Location& from_here,
diff --git a/base/threading/sequenced_worker_pool_unittest.cc b/base/threading/sequenced_worker_pool_unittest.cc index ccc21d8..17eadbb3 100644 --- a/base/threading/sequenced_worker_pool_unittest.cc +++ b/base/threading/sequenced_worker_pool_unittest.cc
@@ -322,9 +322,8 @@ // workers to be created. ThreadBlocker blocker; for (size_t i = 0; i < kNumWorkerThreads; i++) { - pool()->PostWorkerTask( - FROM_HERE, - base::BindOnce(&TestTracker::BlockTask, tracker(), -1, &blocker)); + pool()->PostTask(FROM_HERE, base::BindOnce(&TestTracker::BlockTask, + tracker(), -1, &blocker)); } tracker()->WaitUntilTasksBlocked(kNumWorkerThreads); @@ -453,13 +452,13 @@ // Tests that posting a bunch of tasks (many more than the number of worker // threads) runs them all. TEST_P(SequencedWorkerPoolTest, LotsOfTasks) { - pool()->PostWorkerTask(FROM_HERE, - base::BindOnce(&TestTracker::SlowTask, tracker(), 0)); + pool()->PostTask(FROM_HERE, + base::BindOnce(&TestTracker::SlowTask, tracker(), 0)); const size_t kNumTasks = 20; for (size_t i = 1; i < kNumTasks; i++) { - pool()->PostWorkerTask( - FROM_HERE, base::BindOnce(&TestTracker::FastTask, tracker(), i)); + pool()->PostTask(FROM_HERE, + base::BindOnce(&TestTracker::FastTask, tracker(), i)); } std::vector<int> result = tracker()->WaitUntilTasksComplete(kNumTasks); @@ -475,15 +474,15 @@ SequencedWorkerPoolOwner pool2(kNumWorkerThreads, "test2"); base::Closure slow_task = base::Bind(&TestTracker::SlowTask, tracker(), 0); - pool1.pool()->PostWorkerTask(FROM_HERE, slow_task); - pool2.pool()->PostWorkerTask(FROM_HERE, slow_task); + pool1.pool()->PostTask(FROM_HERE, slow_task); + pool2.pool()->PostTask(FROM_HERE, slow_task); const size_t kNumTasks = 20; for (size_t i = 1; i < kNumTasks; i++) { base::Closure fast_task = base::Bind(&TestTracker::FastTask, tracker(), i); - pool1.pool()->PostWorkerTask(FROM_HERE, fast_task); - pool2.pool()->PostWorkerTask(FROM_HERE, fast_task); + pool1.pool()->PostTask(FROM_HERE, fast_task); + pool2.pool()->PostTask(FROM_HERE, fast_task); } std::vector<int> result = @@ -498,9 +497,9 @@ const size_t kNumBackgroundTasks = kNumWorkerThreads - 1; ThreadBlocker background_blocker; for (size_t i = 0; i < kNumBackgroundTasks; i++) { - pool()->PostWorkerTask(FROM_HERE, - base::BindOnce(&TestTracker::BlockTask, tracker(), i, - &background_blocker)); + pool()->PostTask(FROM_HERE, + base::BindOnce(&TestTracker::BlockTask, tracker(), i, + &background_blocker)); } tracker()->WaitUntilTasksBlocked(kNumBackgroundTasks); @@ -559,8 +558,8 @@ EnsureAllWorkersCreated(); ThreadBlocker blocker; for (size_t i = 0; i < kNumWorkerThreads; i++) { - pool()->PostWorkerTask(FROM_HERE, base::BindOnce(&TestTracker::BlockTask, - tracker(), i, &blocker)); + pool()->PostTask(FROM_HERE, base::BindOnce(&TestTracker::BlockTask, + tracker(), i, &blocker)); } tracker()->WaitUntilTasksBlocked(kNumWorkerThreads); @@ -606,7 +605,7 @@ // Start tasks to take all the threads and block them. const int kNumBlockTasks = static_cast<int>(kNumWorkerThreads); for (int i = 0; i < kNumBlockTasks; ++i) { - EXPECT_TRUE(pool()->PostWorkerTask( + EXPECT_TRUE(pool()->PostTask( FROM_HERE, base::BindOnce(&TestTracker::BlockTask, tracker(), i, &blocker))); } @@ -670,7 +669,7 @@ // Start tasks to take all the threads and block them. const int kNumBlockTasks = static_cast<int>(kNumWorkerThreads); for (int i = 0; i < kNumBlockTasks; ++i) { - EXPECT_TRUE(pool()->PostWorkerTask( + EXPECT_TRUE(pool()->PostTask( FROM_HERE, base::BindOnce(&TestTracker::BlockTask, tracker(), i, &blocker))); } @@ -726,8 +725,8 @@ EnsureAllWorkersCreated(); ThreadBlocker blocker; for (size_t i = 0; i < kNumWorkerThreads; i++) { - pool()->PostWorkerTask(FROM_HERE, base::BindOnce(&TestTracker::BlockTask, - tracker(), i, &blocker)); + pool()->PostTask(FROM_HERE, base::BindOnce(&TestTracker::BlockTask, + tracker(), i, &blocker)); } tracker()->WaitUntilTasksBlocked(kNumWorkerThreads); @@ -994,14 +993,14 @@ pool()->PostDelayedTask(FROM_HERE, base::BindOnce(&TestTracker::FastTask, tracker(), 0), TimeDelta::FromMinutes(5)); - pool()->PostWorkerTask(FROM_HERE, - base::BindOnce(&TestTracker::SlowTask, tracker(), 0)); + pool()->PostTask(FROM_HERE, + base::BindOnce(&TestTracker::SlowTask, tracker(), 0)); const size_t kNumFastTasks = 20; for (size_t i = 0; i < kNumFastTasks; i++) { - pool()->PostWorkerTask( - FROM_HERE, base::BindOnce(&TestTracker::FastTask, tracker(), 0)); + pool()->PostTask(FROM_HERE, + base::BindOnce(&TestTracker::FastTask, tracker(), 0)); } - pool()->PostWorkerTask( + pool()->PostTask( FROM_HERE, base::BindOnce(&TestTracker::PostAdditionalTasks, tracker(), 0, base::RetainedRef(pool()), true)); @@ -1078,9 +1077,9 @@ token2, FROM_HERE, base::BindOnce(&CheckWorkerPoolAndSequenceToken, pool(), token2)); - pool()->PostWorkerTask( - FROM_HERE, base::BindOnce(&CheckWorkerPoolAndSequenceToken, pool(), - SequencedWorkerPool::SequenceToken())); + pool()->PostTask(FROM_HERE, + base::BindOnce(&CheckWorkerPoolAndSequenceToken, pool(), + SequencedWorkerPool::SequenceToken())); pool()->FlushForTesting(); }
diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni index 1746bda..8513f83 100644 --- a/build/toolchain/toolchain.gni +++ b/build/toolchain/toolchain.gni
@@ -17,12 +17,6 @@ is_clang && target_os == "linux" && !is_chromeos && target_cpu == "x64" && is_official_build - # Set to true to use lld, the LLVM linker. This flag may be used on Windows - # with the shipped LLVM toolchain, or on Linux with a self-built top-of-tree - # LLVM toolchain (see llvm_force_head_revision in - # build/config/compiler/BUILD.gn). - use_lld = is_win && host_os != "win" - # If used with allow_posix_link_time_opt, it enables the experimental support # of ThinLTO that links 3x-10x faster but (as of now) does not have all the # important optimizations such us devirtualization implemented. See also @@ -66,6 +60,12 @@ # Clang compiler version. Clang files are placed at version-dependent paths. clang_version = "5.0.0" } + + # Set to true to use lld, the LLVM linker. This flag may be used on Windows + # or Linux. + use_lld = (is_win && host_os != "win") || + (allow_posix_link_time_opt && target_os == "linux" && + !is_chromeos && target_cpu == "x64") } # Check target_os here instead of is_ios as this file is loaded for secondary
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc index 43120259..bd0375f 100644 --- a/cc/trees/draw_property_utils.cc +++ b/cc/trees/draw_property_utils.cc
@@ -458,6 +458,15 @@ transform_tree.Node(layer->transform_tree_index()); const EffectNode* effect_node = effect_tree.Node(layer->effect_tree_index()); + DCHECK(effect_node); + DCHECK(transform_node); + // TODO(crbug.com/726423) : This is a workaround for crbug.com/726225 to + // avoid crashing when there is no effect or transform node. Effect node and + // transform node should always exist here and this workaround should be + // removed. + if (!transform_node || !effect_node) + return true; + if (effect_node->has_render_surface && effect_node->subtree_has_copy_request) return false; @@ -843,6 +852,13 @@ const EffectTree& effect_tree = property_trees->effect_tree; for (auto* layer_impl : *layer_tree_impl) { + DCHECK(layer_impl); + DCHECK(layer_impl->layer_tree_impl()); + // TODO(crbug.com/726423) : This is a workaround for crbug.com/725851 to + // avoid crashing when layer_impl is nullptr. This workaround should be + // removed as layer_impl should not be nullptr here. + if (!layer_impl) + continue; if (!IsRootLayer(layer_impl) && LayerShouldBeSkippedForDrawPropertiesComputation( layer_impl, transform_tree, effect_tree))
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 1de2ec5..4f7c1d73 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java
@@ -185,6 +185,12 @@ /** Enable Vr Shell development environment. */ public static final String ENABLE_VR_SHELL_DEV = "enable-vr-shell-dev"; + /** Command line switch for Chrome Home's swipe logic. */ + public static final String CHROME_HOME_SWIPE_LOGIC = "chrome-home-swipe-logic"; + + /** Switch for enabling "restricted area" swipe logic for Chrome Home. */ + public static final String CHROME_HOME_SWIPE_LOGIC_RESTRICT_AREA = "restrict-area"; + // 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 8dd1227..82b7ca0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -243,7 +243,7 @@ /** * Whether an initial tab needs to be created during UI initialization. */ - private boolean mCreateInitialTabDuringUiInit; + private Runnable mDelayedInitialTabBehaviorDuringUiInit; /** * Keeps track of whether or not a specific tab was created based on the startup intent. @@ -319,13 +319,41 @@ @Override public Tab launchUrl( String url, TabModel.TabLaunchType type, Intent intent, long intentTimestamp) { - if (getBottomSheet() != null && NewTabPage.isNTPUrl(url)) { - getBottomSheet().displayNewTabUi(mIsIncognito); - return null; - } - + if (openNtpBottomSheet(url)) return null; return super.launchUrl(url, type, intent, intentTimestamp); } + + @Override + public Tab createNewTab( + LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent, Intent intent) { + if (openNtpBottomSheet(loadUrlParams.getUrl())) return null; + return super.createNewTab(loadUrlParams, type, parent, intent); + } + + /** + * Handles opening the NTP in the bottom sheet if supported. + * + * @param url The URL that is used to determine if this is an NTP being opened. + * @return Whether the NTP experience is opened in the bottom sheet without a corresponding + * Tab associated with it. + */ + private boolean openNtpBottomSheet(String url) { + if (getBottomSheet() != null && NewTabPage.isNTPUrl(url)) { + if (!mUIInitialized) { + assert mDelayedInitialTabBehaviorDuringUiInit == null; + mDelayedInitialTabBehaviorDuringUiInit = new Runnable() { + @Override + public void run() { + getBottomSheet().displayNewTabUi(mIsIncognito); + } + }; + } else { + getBottomSheet().displayNewTabUi(mIsIncognito); + } + return true; + } + return false; + } } /** @@ -724,8 +752,9 @@ bgViewWrapper.initialize(); } - if (mCreateInitialTabDuringUiInit) { - getTabCreator(false).launchNTP(); + if (mDelayedInitialTabBehaviorDuringUiInit != null) { + mDelayedInitialTabBehaviorDuringUiInit.run(); + mDelayedInitialTabBehaviorDuringUiInit = null; } else { mLayoutManager.hideOverview(false); } @@ -961,11 +990,6 @@ private void createInitialTab() { String url = HomepageManager.getHomepageUri(getApplicationContext()); if (TextUtils.isEmpty(url) || NewTabPage.isNTPUrl(url)) { - if (getBottomSheet() != null) { - mCreateInitialTabDuringUiInit = true; - return; - } - url = UrlConstants.NTP_URL; } @@ -1206,7 +1230,15 @@ // Create a new tab. Tab newTab = launchIntent(url, referer, headers, externalAppId, forceNewTab, intent); - newTab.setIsAllowedToReturnToExternalApp(isAllowedToReturnToExternalApp); + if (newTab != null) { + newTab.setIsAllowedToReturnToExternalApp(isAllowedToReturnToExternalApp); + } else { + // TODO(twellington): This should only happen for NTPs created in Chrome Home. See + // if we should be caching setIsAllowedToReturnToExternalApp + // in those cases. + assert NewTabPage.isNTPUrl(url); + assert getBottomSheet() != null; + } logMobileReceivedExternalIntent(externalAppId, intent); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java index 581a891..e95e679 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -372,7 +372,7 @@ private static void addValidItemsToFront(List<ContextMenuItem> validItems, List<? extends ContextMenuItem> allItems, Set<ContextMenuItem> supportedOptions, Set<ContextMenuItem> disabledOptions) { - for (int i = 0; i < allItems.size(); i++) { + for (int i = allItems.size() - 1; i >= 0; i--) { ContextMenuItem item = allItems.get(i); if (supportedOptions.contains(item) && !disabledOptions.contains(item)) { assert !validItems.contains(item);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java index 15adc90..28057dacb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java
@@ -25,6 +25,7 @@ public static final int FAVICON = 1 << 0; public static final int TOUCH_ICON = 1 << 1; public static final int TOUCH_PRECOMPOSED_ICON = 1 << 2; + public static final int WEB_MANIFEST_ICON = 1 << 3; private long mNativeFaviconHelper; @@ -86,8 +87,8 @@ FaviconImageCallback faviconImageCallback) { assert mNativeFaviconHelper != 0; return nativeGetLocalFaviconImageForURL(mNativeFaviconHelper, profile, pageUrl, - FAVICON | TOUCH_ICON | TOUCH_PRECOMPOSED_ICON, desiredSizeInPixel, - faviconImageCallback); + FAVICON | TOUCH_ICON | TOUCH_PRECOMPOSED_ICON | WEB_MANIFEST_ICON, + desiredSizeInPixel, faviconImageCallback); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java index 8a29a47..ef9bf57 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
@@ -279,6 +279,16 @@ */ @SearchEnginePromoType public int getSearchEnginePromoShowType() { + return getSearchEnginePromoShowType(false); + } + + /** + * Check the type of search engine promo that would be shown when necessary. + * @param readOnly Perform the checks without any preference side effects. + * @return Whether and which search engine promo should be shown. + */ + @SearchEnginePromoType + public int getSearchEnginePromoShowType(boolean readOnly) { if (!isSpecialLocaleEnabled()) return SEARCH_ENGINE_PROMO_DONT_SHOW; SharedPreferences preferences = ContextUtils.getAppSharedPreferences(); if (preferences.getBoolean(PREF_PROMO_SHOWN, false)) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java index 218ffe5..5d56a630 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java
@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; import org.chromium.chrome.browser.locale.LocaleManager; +import org.chromium.chrome.browser.locale.LocaleManager.SearchEnginePromoType; import org.chromium.chrome.browser.omnibox.LocationBarLayout; import org.chromium.chrome.browser.search_engines.TemplateUrlService; import org.chromium.chrome.browser.search_engines.TemplateUrlService.LoadListener; @@ -391,7 +392,10 @@ static boolean shouldShowFullString() { Intent freIntent = FirstRunFlowSequencer.checkIfFirstRunIsNecessary( getDelegate().getContext(), null, false); - return freIntent == null; + @SearchEnginePromoType + int type = LocaleManager.getInstance().getSearchEnginePromoShowType(true); + return freIntent == null && type != LocaleManager.SEARCH_ENGINE_PROMO_SHOW_EXISTING + && type != LocaleManager.SEARCH_ENGINE_PROMO_SHOW_NEW; } /** Sets an {@link SearchWidgetProviderDelegate} to interact with. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java index 4679432..d4e40032 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
@@ -47,6 +47,7 @@ private static Boolean sHasGoogleAccountAuthenticator; private static Boolean sHasRecognitionIntentHandler; private static Boolean sChromeHomeEnabled; + private static String sChromeHomeSwipeLogicType; private static String sCachedHerbFlavor; private static boolean sIsHerbFlavorCached; @@ -270,6 +271,20 @@ return ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_EXPAND_BUTTON); } + /** + * @return The type of swipe logic used for opening the bottom sheet in Chrome Home. Null is + * returned if the command line is not initialized or no experiment is specified. + */ + public static String getChromeHomeSwipeLogicType() { + if (sChromeHomeSwipeLogicType == null && CommandLine.isInitialized()) { + CommandLine instance = CommandLine.getInstance(); + sChromeHomeSwipeLogicType = + instance.getSwitchValue(ChromeSwitches.CHROME_HOME_SWIPE_LOGIC); + } + + return sChromeHomeSwipeLogicType; + } + private static native void nativeSetCustomTabVisible(boolean visible); private static native void nativeSetIsInMultiWindowMode(boolean isInMultiWindowMode); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java index 8e1ef5d..2e33c17 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
@@ -33,6 +33,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.NativePageHost; import org.chromium.chrome.browser.TabLoadStatus; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome; @@ -112,6 +113,9 @@ /** The height ratio for the sheet in the SHEET_STATE_HALF state. */ private static final float HALF_HEIGHT_RATIO = 0.55f; + /** The fraction of the width of the screen that, when swiped, will cause the sheet to move. */ + private static final float SWIPE_ALLOWED_FRACTION = 0.2f; + /** * Information about the different scroll states of the sheet. Order is important for these, * they go from smallest to largest. @@ -129,6 +133,9 @@ /** This is a cached array for getting the window location of different views. */ private final int[] mLocationArray = new int[2]; + /** The visible rect for the screen taking the keyboard into account. */ + private final Rect mVisibleViewportRect = new Rect(); + /** The minimum distance between half and full states to allow the half state. */ private final float mMinHalfFullDistance; @@ -280,7 +287,7 @@ private class BottomSheetSwipeDetector extends GestureDetector.SimpleOnGestureListener { @Override public boolean onDown(MotionEvent e) { - return true; + return isTouchInSwipableXRange(e); } @Override @@ -295,6 +302,8 @@ return false; } + if (!isTouchInSwipableXRange(e2)) return false; + // Only start scrolling if the scroll is up or down. If the user is already scrolling, // continue moving the sheet. float slope = Math.abs(distanceX) > 0f ? Math.abs(distanceY) / Math.abs(distanceX) : 0f; @@ -349,6 +358,8 @@ @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + if (!isTouchInSwipableXRange(e2)) return false; + cancelAnimation(); boolean wasOpenBeforeSwipe = mIsSheetOpen; @@ -393,6 +404,29 @@ } /** + * Check if a touch event is in the swipable x-axis range of the toolbar when in peeking mode. + * If the "chrome-home-swipe-logic" flag is not set to "restrict-area" or the sheet is open, + * this function returns true. + * @param e The touch event. + * @return True if the touch is inside the swipable area of the toolbar. + */ + private boolean isTouchInSwipableXRange(MotionEvent e) { + // If the sheet is already open or the experiment is not enabled, no need to restrict the + // swipe area. + if (mActivity == null || isSheetOpen() + || !ChromeSwitches.CHROME_HOME_SWIPE_LOGIC_RESTRICT_AREA.equals( + FeatureUtilities.getChromeHomeSwipeLogicType())) { + return true; + } + + // Determine an area in the middle of the toolbar that is swipable. + float allowedSwipeWidth = mContainerWidth * SWIPE_ALLOWED_FRACTION; + float startX = mVisibleViewportRect.left + (mContainerWidth - allowedSwipeWidth) / 2; + float endX = startX + allowedSwipeWidth; + return e.getRawX() > startX && e.getRawX() < endX; + } + + /** * Constructor for inflation from XML. * @param context An Android context. * @param atts The XML attributes. @@ -581,9 +615,9 @@ // Compute the new height taking the keyboard into account. // TODO(mdjones): Share this logic with LocationBarLayout: crbug.com/725725. int decorHeight = mActivity.getWindow().getDecorView().getHeight(); - Rect displayFrame = new Rect(); - mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(displayFrame); - int heightMinusKeyboard = Math.min(decorHeight, displayFrame.height()); + mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame( + mVisibleViewportRect); + int heightMinusKeyboard = Math.min(decorHeight, mVisibleViewportRect.height()); boolean keyboardHeightChanged = heightMinusKeyboard != mHeightMinusKeyboard; @@ -723,9 +757,12 @@ @Override public Tab getActiveTab() { - return mTabModelSelector == null || mNtpController.isShowingNewTabUi() - ? null - : mTabModelSelector.getCurrentTab(); + if (mTabModelSelector == null) return null; + if (mNtpController.isShowingNewTabUi() && isVisible() + && getTargetSheetState() != SHEET_STATE_PEEK) { + return null; + } + return mTabModelSelector.getCurrentTab(); } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java index 5429068d..72a79cf 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java
@@ -27,6 +27,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.firstrun.FirstRunActivity; +import org.chromium.chrome.browser.locale.LocaleManager; import org.chromium.chrome.browser.searchwidget.SearchActivity.SearchActivityDelegate; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.chrome.test.util.ApplicationTestUtils; @@ -34,6 +35,8 @@ import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; /** * Tests for the SearchWidgetProvider. @@ -100,6 +103,12 @@ super.setUp(); ApplicationTestUtils.setUp(getInstrumentation().getTargetContext(), true); SearchActivity.setDelegateForTests(new TestSearchDelegate()); + LocaleManager.setInstanceForTest(new LocaleManager() { + @Override + public int getSearchEnginePromoShowType(boolean readOnly) { + return LocaleManager.SEARCH_ENGINE_PROMO_SHOW_EXISTING; + } + }); mContext = new TestContext(); mDelegate = new TestDelegate(mContext); @@ -123,24 +132,59 @@ // The microphone icon should disappear if voice queries are unavailable. mDelegate.mViews.clear(); - SearchWidgetProvider.updateCachedVoiceSearchAvailability(false); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedVoiceSearchAvailability(false); + } + }); checkWidgetStates(TEXT_GENERIC, View.GONE); - // After recording that the default search engine is "X", it should say "Search with X". + // After recording that the default search engine is "X", it should say "Search with X" as + // long as we can show the full string. + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + } + }); + checkWidgetStates(TEXT_GENERIC, View.GONE); + mDelegate.mViews.clear(); - SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + LocaleManager.setInstanceForTest(new LocaleManager() { + @Override + public int getSearchEnginePromoShowType(boolean readOnly) { + return LocaleManager.SEARCH_ENGINE_PROMO_DONT_SHOW; + } + }); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + } + }); checkWidgetStates(TEXT_SEARCH_ENGINE_FULL, View.GONE); // The microphone icon should appear if voice queries are available. mDelegate.mViews.clear(); - SearchWidgetProvider.updateCachedVoiceSearchAvailability(true); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedVoiceSearchAvailability(true); + } + }); checkWidgetStates(TEXT_SEARCH_ENGINE_FULL, View.VISIBLE); } @SmallTest @CommandLineFlags.Remove(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) - public void testUpdateCachedEngineNameBeforeFirstRun() { - assertFalse(SearchWidgetProvider.shouldShowFullString()); + public void testUpdateCachedEngineNameBeforeFirstRun() throws ExecutionException { + assertFalse(ThreadUtils.runOnUiThreadBlocking(new Callable<Boolean>() { + @Override + public Boolean call() throws Exception { + return SearchWidgetProvider.shouldShowFullString(); + } + })); SearchWidgetProvider.handleAction( new Intent(SearchWidgetProvider.ACTION_UPDATE_ALL_WIDGETS)); @@ -152,7 +196,12 @@ // already displaying the generic string, and should continue doing so, so they don't get // updated. mDelegate.mViews.clear(); - SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + } + }); assertEquals(0, mDelegate.mViews.size()); // Manually set the preference, then update the cached engine name again. The @@ -163,7 +212,12 @@ .edit() .putString(SearchWidgetProvider.PREF_SEARCH_ENGINE_SHORTNAME, TEXT_SEARCH_ENGINE) .apply(); - SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + } + }); checkWidgetStates(TEXT_GENERIC, View.VISIBLE); }
diff --git a/chrome/app/media_router_strings.grdp b/chrome/app/media_router_strings.grdp index 36a6941..ffeff9742 100644 --- a/chrome/app/media_router_strings.grdp +++ b/chrome/app/media_router_strings.grdp
@@ -36,7 +36,7 @@ <message name="IDS_MEDIA_ROUTER_AUTO_CAST_MODE" desc="Title for auto cast mode that appears as the header of a list of devices. This represents the mode that will be initially shown, if the list of sinks supports more than one of the cast modes below. Note that auto mode is not a real cast mode and merely serves as a proxy for the other cast modes. This is NOT shown as a dropdown option."> Cast to </message> - <message name="IDS_MEDIA_ROUTER_DEFAULT_CAST_MODE" desc="Title for the default cast mode, which is used when the host is cast enabled. This is shown as a dropdown option, and if selected, also appears as the header of a list of devices."> + <message name="IDS_MEDIA_ROUTER_PRESENTATION_CAST_MODE" desc="Title for the presentation cast mode, which is used when the page is cast enabled. This is shown as a dropdown option, and if selected, also appears as the header of a list of devices."> Cast <ph name="HOST_NAME">$1<ex>google.com</ex></ph> </message> <message name="IDS_MEDIA_ROUTER_DESKTOP_MIRROR_CAST_MODE" desc="Title for the desktop mirror cast mode. This is shown as a dropdown option, and if selected, also appears as the header of a list of devices.">
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index bb25ae82..dd8a2e27 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -317,6 +317,13 @@ {flag_descriptions::kReaderModeHeuristicsAlwaysOff, switches::kReaderModeHeuristics, switches::reader_mode_heuristics::kNone}, }; + +const FeatureEntry::Choice kChromeHomeSwipeLogicChoices[] = { + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, + {flag_descriptions::kChromeHomeSwipeLogicRestrictArea, + switches::kChromeHomeSwipeLogicType, "restrict-area"}, +}; + #endif // OS_ANDROID const FeatureEntry::Choice kNumRasterThreadsChoices[] = { @@ -1762,6 +1769,9 @@ flag_descriptions::kChromeHomeExpandButtonName, flag_descriptions::kChromeHomeExpandButtonDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kChromeHomeExpandButton)}, + {"chrome-home-swipe-logic", flag_descriptions::kChromeHomeSwipeLogicName, + flag_descriptions::kChromeHomeSwipeLogicDescription, kOsAndroid, + MULTI_VALUE_TYPE(kChromeHomeSwipeLogicChoices)}, #endif // OS_ANDROID #if defined(OS_ANDROID) {"enable-iph-demo-mode", flag_descriptions::kEnableIphDemoModeName, @@ -3023,6 +3033,13 @@ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableNewVirtualKeyboardBehavior)}, #endif // defined(OS_CHROMEOS) +#if !defined(OS_ANDROID) && !defined(OS_IOS) + {"enable-picture-in-picture", + flag_descriptions::kEnablePictureInPictureName, + flag_descriptions::kEnablePictureInPictureDescription, kOsDesktop, + SINGLE_VALUE_TYPE(switches::kEnablePictureInPicture)}, +#endif // !defined(OS_ANDROID) && !defined(OS_IOS) + // NOTE: Adding new command-line switches requires adding corresponding // entries to enum "LoginCustomFlags" in histograms/enums.xml. See note in // enums.xml and don't forget to run AboutFlagsHistogramTest unit test.
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 733cfeb..04a5a00 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -54,6 +54,7 @@ &kCCTPostMessageAPI, &kChromeHomeFeature, &kChromeHomeExpandButton, + &kChromeHomeSwipeLogic, &kContentSuggestionsCategories, &kContentSuggestionsSettings, &kContentSuggestionsShowSummary, @@ -137,6 +138,9 @@ const base::Feature kChromeHomeExpandButton{"ChromeHomeExpandButton", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kChromeHomeSwipeLogic{"ChromeHomeSwipeLogic", + base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kContentSuggestionsCategories{ "ContentSuggestionsCategories", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index 90d716447..d21d033 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -21,6 +21,7 @@ extern const base::Feature kCCTPostMessageAPI; extern const base::Feature kChromeHomeFeature; extern const base::Feature kChromeHomeExpandButton; +extern const base::Feature kChromeHomeSwipeLogic; extern const base::Feature kContentSuggestionsCategories; extern const base::Feature kContentSuggestionsSettings; extern const base::Feature kContentSuggestionsShowSummary;
diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc index a67b5687..e5f3bc8 100644 --- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc +++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc
@@ -264,7 +264,7 @@ // TODO(dfalcantara): Try combining with the new BookmarksHandler once its // rewrite is further along. std::vector<int> icon_types{ - favicon_base::FAVICON, + favicon_base::WEB_MANIFEST_ICON, favicon_base::FAVICON, favicon_base::TOUCH_PRECOMPOSED_ICON | favicon_base::TOUCH_ICON}; favicon::FaviconService* favicon_service =
diff --git a/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_unittest.cc b/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_unittest.cc index 0ff8c23..1dcec90 100644 --- a/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_unittest.cc +++ b/chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge_unittest.cc
@@ -39,7 +39,7 @@ void RemovePreTargetHandler(ui::EventHandler* handler) override {} void AddPostTargetHandler(ui::EventHandler* handler) override {} void RemovePostTargetHandler(ui::EventHandler* handler) override {} - bool IsTabletModeWindowManagerEnabled() const override { return false; } + bool IsMaximizeModeWindowManagerEnabled() const override { return false; } DISALLOW_COPY_AND_ASSIGN(FakeWMHelper); };
diff --git a/chrome/browser/chromeos/display/display_preferences_unittest.cc b/chrome/browser/chromeos/display/display_preferences_unittest.cc index a7d115f6..1cf0597 100644 --- a/chrome/browser/chromeos/display/display_preferences_unittest.cc +++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -16,7 +16,7 @@ #include "ash/display/window_tree_host_manager.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" @@ -810,9 +810,9 @@ shell->display_configurator()->requested_power_state()); } -// Tests that display configuration changes caused by TabletModeController +// Tests that display configuration changes caused by MaximizeModeController // are not saved. -TEST_F(DisplayPreferencesTest, DontSaveTabletModeControllerRotations) { +TEST_F(DisplayPreferencesTest, DontSaveMaximizeModeControllerRotations) { ash::Shell* shell = ash::Shell::Get(); display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); @@ -826,16 +826,16 @@ display::Display::ROTATE_0, display::Display::ROTATION_SOURCE_USER); - // Open up 270 degrees to trigger tablet mode + // Open up 270 degrees to trigger maximize mode scoped_refptr<chromeos::AccelerometerUpdate> update( new chromeos::AccelerometerUpdate()); update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, kMeanGravity); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); - ash::TabletModeController* controller = - ash::Shell::Get()->tablet_mode_controller(); + ash::MaximizeModeController* controller = + ash::Shell::Get()->maximize_mode_controller(); controller->OnAccelerometerUpdated(update); - EXPECT_TRUE(controller->IsTabletModeWindowManagerEnabled()); + EXPECT_TRUE(controller->IsMaximizeModeWindowManagerEnabled()); // Trigger 90 degree rotation update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, -kMeanGravity, @@ -938,7 +938,7 @@ } // Tests that rotation state is loaded without a user being logged in, and that -// entering tablet mode applies the state. +// entering maximize mode applies the state. TEST_F(DisplayPreferencesTest, LoadRotationNoLogin) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); @@ -964,28 +964,28 @@ EXPECT_EQ(display::Display::ROTATE_90, display_rotation); bool rotation_lock = IsRotationLocked(); - display::Display::Rotation before_tablet_mode_rotation = + display::Display::Rotation before_maximize_mode_rotation = GetCurrentInternalDisplayRotation(); - // Settings should not be applied until tablet mode activates + // Settings should not be applied until maximize mode activates EXPECT_FALSE(rotation_lock); - EXPECT_EQ(display::Display::ROTATE_0, before_tablet_mode_rotation); + EXPECT_EQ(display::Display::ROTATE_0, before_maximize_mode_rotation); - // Open up 270 degrees to trigger tablet mode + // Open up 270 degrees to trigger maximize mode scoped_refptr<chromeos::AccelerometerUpdate> update( new chromeos::AccelerometerUpdate()); update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, kMeanGravity); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); - ash::TabletModeController* tablet_mode_controller = - ash::Shell::Get()->tablet_mode_controller(); - tablet_mode_controller->OnAccelerometerUpdated(update); - EXPECT_TRUE(tablet_mode_controller->IsTabletModeWindowManagerEnabled()); + ash::MaximizeModeController* maximize_mode_controller = + ash::Shell::Get()->maximize_mode_controller(); + maximize_mode_controller->OnAccelerometerUpdated(update); + EXPECT_TRUE(maximize_mode_controller->IsMaximizeModeWindowManagerEnabled()); bool screen_orientation_rotation_lock = IsRotationLocked(); - display::Display::Rotation tablet_mode_rotation = + display::Display::Rotation maximize_mode_rotation = GetCurrentInternalDisplayRotation(); EXPECT_TRUE(screen_orientation_rotation_lock); - EXPECT_EQ(display::Display::ROTATE_90, tablet_mode_rotation); + EXPECT_EQ(display::Display::ROTATE_90, maximize_mode_rotation); } // Tests that rotation lock being set causes the rotation state to be saved.
diff --git a/chrome/browser/chromeos/power/renderer_freezer.cc b/chrome/browser/chromeos/power/renderer_freezer.cc index 05d4314..187618c 100644 --- a/chrome/browser/chromeos/power/renderer_freezer.cc +++ b/chrome/browser/chromeos/power/renderer_freezer.cc
@@ -148,11 +148,14 @@ // RendererFreezer::SuspendImminent(), it is guaranteed that the screen locker // renderer will not be frozen at any point. if (is_locked) { - delegate_->SetShouldFreezeRenderer(locker->delegate() - ->GetWebContents() - ->GetRenderProcessHost() - ->GetHandle(), - false); + // |web_contents| is null when using views-based login/lock screen. + // TODO(jdufault): Remove this code after webui login/lock is gone. See + // crbug.com/719015. + content::WebContents* web_contents = locker->delegate()->GetWebContents(); + if (web_contents) { + delegate_->SetShouldFreezeRenderer( + web_contents->GetRenderProcessHost()->GetHandle(), false); + } } }
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc index b6fa4805e..a7dc13e 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -11,7 +11,7 @@ #include "ash/display/screen_orientation_controller_chromeos.h" #include "ash/shell.h" #include "ash/touch/ash_touch_transform_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/chromeos/display/display_preferences.h" #include "chrome/browser/chromeos/display/overscan_calibrator.h" @@ -420,10 +420,10 @@ return true; } -bool IsTabletModeWindowManagerEnabled() { +bool IsMaximizeModeWindowManagerEnabled() { return ash::Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); } } // namespace @@ -517,7 +517,7 @@ // Process 'rotation' parameter. if (info.rotation) { - if (IsTabletModeWindowManagerEnabled() && + if (IsMaximizeModeWindowManagerEnabled() && display_id == display::Display::InternalDisplayId()) { ash::Shell::Get()->screen_orientation_controller()->SetLockToRotation( DegreesToRotation(*info.rotation));
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc index 96add5c5..f4998a6 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
@@ -10,7 +10,7 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/screen_orientation_controller_test_api.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/command_line.h" #include "base/macros.h" #include "base/strings/string_number_conversions.h" @@ -31,9 +31,10 @@ using DisplayUnitInfoList = DisplayInfoProvider::DisplayUnitInfoList; using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList; -void EnableTabletMode(bool enable) { - ash::Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( - enable); +void EnableMaximizeMode(bool enable) { + ash::Shell::Get() + ->maximize_mode_controller() + ->EnableMaximizeModeWindowManager(enable); } class DisplayInfoProviderChromeosTest : public ash::test::AshTestBase { @@ -1023,9 +1024,9 @@ secondary.id()); } -// Tests that rotation changes made before entering tablet mode are restored -// upon exiting tablet mode, and that a rotation lock is not set. -TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeTabletMode) { +// Tests that rotation changes made before entering maximize mode are restored +// upon exiting maximize mode, and that a rotation lock is not set. +TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) { ash::ScreenOrientationController* screen_orientation_controller = ash::Shell::Get()->screen_orientation_controller(); api::system_display::DisplayProperties info; @@ -1041,10 +1042,10 @@ EXPECT_TRUE(error.empty()); EXPECT_FALSE(screen_orientation_controller->rotation_locked()); - // Entering tablet mode enables accelerometer screen rotations. - EnableTabletMode(true); + // Entering maximize mode enables accelerometer screen rotations. + EnableMaximizeMode(true); // Rotation lock should not activate because DisplayInfoProvider::SetInfo() - // was called when not in tablet mode. + // was called when not in maximize mode. EXPECT_FALSE(screen_orientation_controller->rotation_locked()); // ScreenOrientationController rotations override display info. @@ -1054,16 +1055,16 @@ display::Display::ROTATION_SOURCE_ACTIVE); EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); - // Exiting tablet mode should restore the initial rotation - EnableTabletMode(false); + // Exiting maximize mode should restore the initial rotation + EnableMaximizeMode(false); EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); } -// Tests that rotation changes made during tablet mode lock the display +// Tests that rotation changes made during maximize mode lock the display // against accelerometer rotations, and is set as user rotation locked. -TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringTabletMode) { - // Entering tablet mode enables accelerometer screen rotations. - EnableTabletMode(true); +TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringMaximizeMode) { + // Entering maximize mode enables accelerometer screen rotations. + EnableMaximizeMode(true); ASSERT_FALSE( ash::Shell::Get()->screen_orientation_controller()->rotation_locked());
diff --git a/chrome/browser/favicon/content_favicon_driver_browsertest.cc b/chrome/browser/favicon/content_favicon_driver_browsertest.cc index c623734..88b7852 100644 --- a/chrome/browser/favicon/content_favicon_driver_browsertest.cc +++ b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
@@ -279,7 +279,11 @@ ui_test_utils::BROWSER_TEST_NONE); waiter.Wait(); +#if defined(OS_ANDROID) || defined(OS_IOS) EXPECT_TRUE(delegate->was_requested()); +#else + EXPECT_FALSE(delegate->was_requested()); +#endif } // Test that loading a page that contains a Web Manifest without icons and a
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index b3fd4593..c8a324b7 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1062,6 +1062,11 @@ "flag. The trace may include personally identifiable information (PII) " "such as the titles and URLs of websites you visit."; +const char kEnablePictureInPictureName[] = "Enable picture in picture."; + +const char kEnablePictureInPictureDescription[] = + "Enable the picture in picture feature for videos."; + const char kTraceUploadUrlName[] = "Trace label for navigation tracing"; const char kTraceUploadUrlDescription[] = @@ -1968,6 +1973,13 @@ const char kChromeHomeExpandButtonDescription[] = "Enables the expand button for Chrome Home."; +const char kChromeHomeSwipeLogicName[] = "Chrome Home Swipe Logic"; + +const char kChromeHomeSwipeLogicDescription[] = + "Various swipe logic options for Chrome Home for sheet expansion."; + +const char kChromeHomeSwipeLogicRestrictArea[] = "Restrict swipable area"; + #endif // defined(OS_ANDROID) // In-Product Help flags
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 9b73cfc..c2df124f 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -238,6 +238,9 @@ extern const char kEnableNavigationTracingName[]; extern const char kEnableNavigationTracingDescription[]; +extern const char kEnablePictureInPictureName[]; +extern const char kEnablePictureInPictureDescription[]; + extern const char kEnableTokenBindingName[]; extern const char kEnableTokenBindingDescription[]; @@ -832,6 +835,10 @@ extern const char kChromeHomeExpandButtonName[]; extern const char kChromeHomeExpandButtonDescription[]; +extern const char kChromeHomeSwipeLogicName[]; +extern const char kChromeHomeSwipeLogicDescription[]; +extern const char kChromeHomeSwipeLogicRestrictArea[]; + extern const char kChromeHomeName[]; extern const char kChromeHomeDescription[];
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html index 5f2cef2..c3d6c60 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html
@@ -59,8 +59,8 @@ <template is="dom-if" if="[[!computeCastModeListHidden_(currentView_)]]"> <paper-menu id="cast-mode-list" role="presentation" selectable="paper-item"> - <template is="dom-repeat" id="defaultCastModeList" - items="[[computeDefaultCastModeList_(castModeList)]]"> + <template is="dom-repeat" id="presentationCastModeList" + items="[[computePresentationCastModeList_(castModeList)]]"> <paper-item on-tap="onCastModeClick_"> <iron-icon class="cast-mode-icon" icon="[[computeCastModeIcon_(item)]]"> @@ -72,8 +72,8 @@ hidden$="[[computeShareScreenSubheadingHidden_(castModeList)]]"> <span>[[i18n('shareYourScreenSubheadingText')]]</span> </div> - <template is="dom-repeat" id="nonDefaultCastModeList" - items="[[computeNonDefaultCastModeList_(castModeList)]]"> + <template is="dom-repeat" id="nonPresentationCastModeList" + items="[[computeNonPresentationCastModeList_(castModeList)]]"> <paper-item on-tap="onCastModeClick_"> <iron-icon class="cast-mode-icon" icon="[[computeCastModeIcon_(item)]]">
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js index 48a1d0e..c410292 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -661,7 +661,7 @@ */ computeCastModeIcon_: function(castMode) { switch (castMode.type) { - case media_router.CastModeType.DEFAULT: + case media_router.CastModeType.PRESENTATION: return 'media-router:web'; case media_router.CastModeType.TAB_MIRROR: return 'media-router:tab'; @@ -674,13 +674,14 @@ /** * @param {!Array<!media_router.CastMode>} castModeList The current list of - * cast modes. - * @return {!Array<!media_router.CastMode>} The list of default cast modes. + * cast modes. + * @return {!Array<!media_router.CastMode>} The list of PRESENTATION cast + * modes. * @private */ - computeDefaultCastModeList_: function(castModeList) { + computePresentationCastModeList_: function(castModeList) { return castModeList.filter(function(mode) { - return mode.type == media_router.CastModeType.DEFAULT; + return mode.type == media_router.CastModeType.PRESENTATION; }); }, @@ -797,13 +798,13 @@ /** * @param {!Array<!media_router.CastMode>} castModeList The current list of * cast modes. - * @return {!Array<!media_router.CastMode>} The list of non-default cast + * @return {!Array<!media_router.CastMode>} The list of non-PRESENTATION cast * modes. * @private */ - computeNonDefaultCastModeList_: function(castModeList) { + computeNonPresentationCastModeList_: function(castModeList) { return castModeList.filter(function(mode) { - return mode.type != media_router.CastModeType.DEFAULT; + return mode.type != media_router.CastModeType.PRESENTATION; }); }, @@ -875,7 +876,7 @@ * @private */ computeShareScreenSubheadingHidden_: function(castModeList) { - return this.computeNonDefaultCastModeList_(castModeList).length == 0; + return this.computeNonPresentationCastModeList_(castModeList).length == 0; }, /** @@ -1576,10 +1577,10 @@ */ onCastModeClick_: function(event) { // The clicked cast mode can come from one of two lists, - // defaultCastModeList and nonDefaultCastModeList. + // presentationCastModeList and nonPresentationCastModeList. var clickedMode = - this.$$('#defaultCastModeList').itemForElement(event.target) || - this.$$('#nonDefaultCastModeList').itemForElement(event.target); + this.$$('#presentationCastModeList').itemForElement(event.target) || + this.$$('#nonPresentationCastModeList').itemForElement(event.target); if (!clickedMode) return;
diff --git a/chrome/browser/resources/media_router/media_router_data.js b/chrome/browser/resources/media_router/media_router_data.js index 82ec6b3c..674fd2b 100644 --- a/chrome/browser/resources/media_router/media_router_data.js +++ b/chrome/browser/resources/media_router/media_router_data.js
@@ -16,9 +16,9 @@ media_router.CastModeType = { // Note: AUTO mode is only used to configure the sink list container to show // all sinks. Individual sinks are configured with a specific cast mode - // (DEFAULT, TAB_MIRROR, DESKTOP_MIRROR). + // (PRESENTATION, TAB_MIRROR, DESKTOP_MIRROR). AUTO: -1, - DEFAULT: 0x1, + PRESENTATION: 0x1, TAB_MIRROR: 0x2, DESKTOP_MIRROR: 0x4, };
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.h b/chrome/browser/ui/app_list/app_list_controller_delegate.h index 71c6077..7df3ccba 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.h +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.h
@@ -99,11 +99,12 @@ AppListSource source, int event_flags) = 0; - // Launch the app. + // Launch the app on the display identified by |display_id|. virtual void LaunchApp(Profile* profile, const extensions::Extension* extension, AppListSource source, - int event_flags) = 0; + int event_flags, + int64_t display_id) = 0; static std::string AppListSourceToString(AppListSource source);
diff --git a/chrome/browser/ui/app_list/arc/arc_app_icon.cc b/chrome/browser/ui/app_list/arc/arc_app_icon.cc index 8c9c2c9..1d3a7b5 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_icon.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_icon.cc
@@ -213,11 +213,7 @@ return; } - gfx::ImageSkia image_skia; - image_skia.AddRepresentation(gfx::ImageSkiaRep( - bitmap, - ui::GetScaleForScaleFactor(scale_factor_))); - host_->Update(&image_skia); + host_->Update(scale_factor_, bitmap); host_->DiscardDecodeRequest(this); } @@ -359,17 +355,15 @@ } } -void ArcAppIcon::Update(const gfx::ImageSkia* image) { +void ArcAppIcon::Update(ui::ScaleFactor scale_factor, const SkBitmap& bitmap) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - CHECK(image && !image->isNull()); - std::vector<gfx::ImageSkiaRep> reps = image->image_reps(); - for (const auto& image_rep : reps) { - if (ui::IsSupportedScale(image_rep.scale())) { - image_skia_.RemoveRepresentation(image_rep.scale()); - image_skia_.AddRepresentation(image_rep); - } - } + gfx::ImageSkiaRep image_rep(bitmap, ui::GetScaleForScaleFactor(scale_factor)); + DCHECK(ui::IsSupportedScale(image_rep.scale())); + + image_skia_.RemoveRepresentation(image_rep.scale()); + image_skia_.AddRepresentation(image_rep); + image_skia_.RemoveUnsupportedRepresentationsForScale(image_rep.scale()); observer_->OnIconUpdated(this); }
diff --git a/chrome/browser/ui/app_list/arc/arc_app_icon.h b/chrome/browser/ui/app_list/arc/arc_app_icon.h index 882640e..0354b22 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_icon.h +++ b/chrome/browser/ui/app_list/arc/arc_app_icon.h
@@ -91,7 +91,7 @@ const base::FilePath& path, const base::FilePath& default_app_path); void OnIconRead(std::unique_ptr<ArcAppIcon::ReadResult> read_result); - void Update(const gfx::ImageSkia* image); + void Update(ui::ScaleFactor scale_factor, const SkBitmap& bitmap); void DiscardDecodeRequest(DecodeRequest* request); content::BrowserContext* context_;
diff --git a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc index 919b6be..b88e072 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
@@ -52,6 +52,7 @@ #include "ui/events/event_constants.h" #include "ui/gfx/geometry/safe_integer_conversions.h" #include "ui/gfx/image/image_skia.h" +#include "ui/gfx/image/image_unittest_util.h" namespace { @@ -1406,6 +1407,81 @@ EXPECT_TRUE(app_instance()->icon_requests().empty()); } +TEST_P(ArcAppModelBuilderTest, IconLoadNonSupportedScales) { + std::vector<ui::ScaleFactor> supported_scale_factors; + supported_scale_factors.push_back(ui::SCALE_FACTOR_100P); + supported_scale_factors.push_back(ui::SCALE_FACTOR_200P); + ui::test::ScopedSetSupportedScaleFactors scoped_supported_scale_factors( + supported_scale_factors); + + // Initialize one ARC app. + const arc::mojom::AppInfo& app = fake_apps()[0]; + const std::string app_id = ArcAppTest::GetAppId(app); + ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); + ASSERT_NE(nullptr, prefs); + app_instance()->RefreshAppList(); + app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>( + fake_apps().begin(), fake_apps().begin() + 1)); + + FakeAppIconLoaderDelegate delegate; + ArcAppIconLoader icon_loader(profile(), app_list::kListIconSize, &delegate); + icon_loader.FetchImage(app_id); + // Expected 1 update with default image and 2 representations should be + // allocated. + EXPECT_EQ(1U, delegate.update_image_cnt()); + gfx::ImageSkia app_icon = delegate.image(); + EXPECT_EQ(2U, app_icon.image_reps().size()); + EXPECT_TRUE(app_icon.HasRepresentation(1.0f)); + EXPECT_TRUE(app_icon.HasRepresentation(2.0f)); + + // Request non-supported scales. Cached supported representations with + // default image should be used. 1.0 is used to scale 1.15 and + // 2.0 is used to scale 1.25. + app_icon.GetRepresentation(1.15f); + app_icon.GetRepresentation(1.25f); + EXPECT_EQ(1U, delegate.update_image_cnt()); + EXPECT_EQ(4U, app_icon.image_reps().size()); + EXPECT_TRUE(app_icon.HasRepresentation(1.0f)); + EXPECT_TRUE(app_icon.HasRepresentation(2.0f)); + EXPECT_TRUE(app_icon.HasRepresentation(1.15f)); + EXPECT_TRUE(app_icon.HasRepresentation(1.25f)); + + // Keep default images for reference. + const SkBitmap bitmap_1_0 = app_icon.GetRepresentation(1.0f).sk_bitmap(); + const SkBitmap bitmap_1_15 = app_icon.GetRepresentation(1.15f).sk_bitmap(); + const SkBitmap bitmap_1_25 = app_icon.GetRepresentation(1.25f).sk_bitmap(); + const SkBitmap bitmap_2_0 = app_icon.GetRepresentation(2.0f).sk_bitmap(); + + // Send icon image for 100P. 1.0 and 1.15 should be updated. + std::string png_data; + EXPECT_TRUE(app_instance()->GenerateAndSendIcon( + app, arc::mojom::ScaleFactor::SCALE_FACTOR_100P, &png_data)); + delegate.WaitForIconUpdates(1); + + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.0f).sk_bitmap(), bitmap_1_0)); + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.15f).sk_bitmap(), bitmap_1_15)); + EXPECT_TRUE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.25f).sk_bitmap(), bitmap_1_25)); + EXPECT_TRUE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(2.0f).sk_bitmap(), bitmap_2_0)); + + // Send icon image for 200P. 2.0 and 1.25 should be updated. + EXPECT_TRUE(app_instance()->GenerateAndSendIcon( + app, arc::mojom::ScaleFactor::SCALE_FACTOR_200P, &png_data)); + delegate.WaitForIconUpdates(1); + + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.0f).sk_bitmap(), bitmap_1_0)); + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.15f).sk_bitmap(), bitmap_1_15)); + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(1.25f).sk_bitmap(), bitmap_1_25)); + EXPECT_FALSE(gfx::test::AreBitmapsEqual( + app_icon.GetRepresentation(2.0f).sk_bitmap(), bitmap_2_0)); +} + TEST_P(ArcAppModelBuilderTest, AppLauncher) { ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile()); ASSERT_NE(nullptr, prefs);
diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc index 15376266..a945dc4 100644 --- a/chrome/browser/ui/app_list/extension_app_item.cc +++ b/chrome/browser/ui/app_list/extension_app_item.cc
@@ -30,6 +30,7 @@ #include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_url_handlers.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/display/types/display_constants.h" #include "ui/events/event_constants.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" @@ -120,10 +121,9 @@ if (RunExtensionEnableFlow()) return; - GetController()->LaunchApp(profile(), - extension, + GetController()->LaunchApp(profile(), extension, AppListControllerDelegate::LAUNCH_FROM_APP_LIST, - event_flags); + event_flags, display::kInvalidDisplayId); } void ExtensionAppItem::ExtensionEnableFlowFinished() {
diff --git a/chrome/browser/ui/app_list/search/suggestions/url_suggestion_result.cc b/chrome/browser/ui/app_list/search/suggestions/url_suggestion_result.cc index a076845..3edb9f5 100644 --- a/chrome/browser/ui/app_list/search/suggestions/url_suggestion_result.cc +++ b/chrome/browser/ui/app_list/search/suggestions/url_suggestion_result.cc
@@ -60,6 +60,7 @@ void URLSuggestionResult::UpdateIcon() { std::vector<int> icon_types; + icon_types.push_back(favicon_base::IconType::WEB_MANIFEST_ICON); icon_types.push_back(favicon_base::IconType::FAVICON); icon_types.push_back(favicon_base::IconType::TOUCH_ICON); icon_types.push_back(favicon_base::IconType::TOUCH_PRECOMPOSED_ICON);
diff --git a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc index d4fb713e..d049e5b 100644 --- a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc +++ b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.cc
@@ -71,7 +71,8 @@ Profile* profile, const extensions::Extension* extension, AppListSource source, - int event_flags) { + int event_flags, + int64_t display_id) { } } // namespace test
diff --git a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h index 910dfbec..e8f71f93 100644 --- a/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h +++ b/chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h
@@ -36,7 +36,8 @@ void LaunchApp(Profile* profile, const extensions::Extension* extension, AppListSource source, - int event_flags) override; + int event_flags, + int64_t display_id) override; const GURL& last_opened_url() const { return last_opened_url_; }
diff --git a/chrome/browser/ui/ash/app_list/app_list_controller_ash.cc b/chrome/browser/ui/ash/app_list/app_list_controller_ash.cc index c944f12f..4a0807d 100644 --- a/chrome/browser/ui/ash/app_list/app_list_controller_ash.cc +++ b/chrome/browser/ui/ash/app_list/app_list_controller_ash.cc
@@ -15,6 +15,7 @@ #include "extensions/common/extension.h" #include "ui/app_list/presenter/app_list_presenter_impl.h" #include "ui/app_list/views/app_list_view.h" +#include "ui/display/types/display_constants.h" AppListControllerDelegateAsh::AppListControllerDelegateAsh( app_list::AppListPresenterImpl* app_list_presenter) @@ -96,7 +97,8 @@ // Platform apps treat activations as a launch. The app can decide whether to // show a new window or focus an existing window as it sees fit. if (extension->is_platform_app()) { - LaunchApp(profile, extension, source, event_flags); + LaunchApp(profile, extension, source, event_flags, + display::kInvalidDisplayId); return; } @@ -112,10 +114,11 @@ Profile* profile, const extensions::Extension* extension, AppListSource source, - int event_flags) { + int event_flags, + int64_t display_id) { ChromeLauncherController::instance()->LaunchApp( ash::ShelfID(extension->id()), AppListSourceToLaunchSource(source), - event_flags); + event_flags, display_id); DismissView(); }
diff --git a/chrome/browser/ui/ash/app_list/app_list_controller_ash.h b/chrome/browser/ui/ash/app_list/app_list_controller_ash.h index 578b5c1..59548be9 100644 --- a/chrome/browser/ui/ash/app_list/app_list_controller_ash.h +++ b/chrome/browser/ui/ash/app_list/app_list_controller_ash.h
@@ -42,7 +42,8 @@ void LaunchApp(Profile* profile, const extensions::Extension* extension, AppListSource source, - int event_flags) override; + int event_flags, + int64_t display_id) override; private: ash::ShelfLaunchSource AppListSourceToLaunchSource(AppListSource source);
diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index f1bf903..f454f2c 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
@@ -116,8 +116,8 @@ // Launching some items replaces this item controller instance, which // destroys its ShelfID string pair; making copies avoid crashes. - ChromeLauncherController::instance()->LaunchApp(ash::ShelfID(shelf_id()), - source, ui::EF_NONE); + ChromeLauncherController::instance()->LaunchApp( + ash::ShelfID(shelf_id()), source, ui::EF_NONE, display_id); std::move(callback).Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, base::nullopt); return;
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc index 722639f..876e5910 100644 --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
@@ -10,7 +10,7 @@ #include "ash/shared/app_types.h" #include "ash/shelf/shelf_model.h" #include "ash/shell.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm_window.h" @@ -304,8 +304,8 @@ const ash::ShelfID shelf_id(info->app_window()->shelf_id()); window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize())); if (ash::Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()) { + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()) { SetOrientationLockForAppWindow(info->app_window()); } } @@ -420,8 +420,8 @@ } if (ash::Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()) { + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()) { ArcAppWindow* app_window = info->app_window(); if (app_window) SetOrientationLockForAppWindow(app_window); @@ -500,7 +500,7 @@ OnTaskSetActive(active_task_id_); } -void ArcAppWindowLauncherController::OnTabletModeStarted() { +void ArcAppWindowLauncherController::OnMaximizeModeStarted() { for (auto& it : task_id_to_app_window_info_) { ArcAppWindow* app_window = it.second->app_window(); if (app_window) @@ -508,7 +508,7 @@ } } -void ArcAppWindowLauncherController::OnTabletModeEnded() { +void ArcAppWindowLauncherController::OnMaximizeModeEnded() { ash::ScreenOrientationController* orientation_controller = ash::Shell::Get()->screen_orientation_controller(); // Don't unlock one by one because it'll switch to next rotation.
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h index 8968de5..7206c23 100644 --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h +++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h
@@ -58,8 +58,8 @@ aura::Window* lost_active) override; // ash::ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // ArcAppListPrefs::Observer: void OnAppReadyChanged(const std::string& app_id, bool ready) override;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index d0fda17..465ef44 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -367,10 +367,6 @@ } } -void ChromeLauncherController::Launch(const ash::ShelfID& id, int event_flags) { - LaunchApp(id, ash::LAUNCH_FROM_UNKNOWN, event_flags); -} - void ChromeLauncherController::Close(const ash::ShelfID& id) { ash::ShelfItemDelegate* delegate = model_->GetShelfItemDelegate(id); if (!delegate) @@ -393,8 +389,9 @@ void ChromeLauncherController::LaunchApp(const ash::ShelfID& id, ash::ShelfLaunchSource source, - int event_flags) { - launcher_controller_helper_->LaunchApp(id, source, event_flags); + int event_flags, + int64_t display_id) { + launcher_controller_helper_->LaunchApp(id, source, event_flags, display_id); } void ChromeLauncherController::ActivateApp(const std::string& app_id, @@ -414,7 +411,7 @@ if (!item_delegate->GetRunningApplications().empty()) SelectItemWithSource(item_delegate.get(), source); else - LaunchApp(shelf_id, source, event_flags); + LaunchApp(shelf_id, source, event_flags, display::kInvalidDisplayId); } void ChromeLauncherController::SetLauncherItemImage(
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h index a4ca1ed..33d3ba6 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -120,11 +120,6 @@ // Adds or removes an item as needed to respect the running and pinned state. void SetV1AppStatus(const std::string& app_id, ash::ShelfItemStatus status); - // Requests that the shelf item controller specified by |id| open a new - // instance of the app. |event_flags| holds the flags of the event which - // triggered this command. - void Launch(const ash::ShelfID& id, int event_flags); - // Closes the specified item. void Close(const ash::ShelfID& id); @@ -135,10 +130,12 @@ bool IsPlatformApp(const ash::ShelfID& id); // Opens a new instance of the application identified by the ShelfID. - // Used by the app-list, and by pinned-app shelf items. + // Used by the app-list, and by pinned-app shelf items. |display_id| is id of + // the display from which the app is launched. void LaunchApp(const ash::ShelfID& id, ash::ShelfLaunchSource source, - int event_flags); + int event_flags, + int64_t display_id); // If |app_id| is running, reactivates the app's most recently active window, // otherwise launches and activates the app.
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index 2f4fc9a9..2ca87d9 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -924,6 +924,97 @@ EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); } +// Tests behavior of launching app from shelf in the first display while the +// second display has the focus. Initially, Browsers exists in the first +// display. +IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchAppFromDisplayWithoutFocus0) { + // Updates the display configuration to add a secondary display. + display::DisplayManager* display_manager = + ash::Shell::Get()->display_manager(); + display::test::DisplayManagerTestApi(display_manager) + .UpdateDisplay("0+0-800x800,801+0-800x800"); + display::Displays displays = display_manager->active_display_list(); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); + EXPECT_EQ(displays.size(), 2U); + EXPECT_EQ(roots.size(), 2U); + EXPECT_EQ( + displays[0].id(), + display::Screen::GetScreen()->GetDisplayNearestWindow(roots[0]).id()); + EXPECT_EQ( + displays[1].id(), + display::Screen::GetScreen()->GetDisplayNearestWindow(roots[1]).id()); + + // Ensures that display 0 has one browser with focus and display 1 has two + // browsers. Each browser only has one tab. + BrowserList* browser_list = BrowserList::GetInstance(); + Browser* browser0 = browser(); + Browser* browser1 = CreateBrowser(browser()->profile()); + Browser* browser2 = CreateBrowser(browser()->profile()); + browser0->window()->SetBounds(displays[0].work_area()); + browser1->window()->SetBounds(displays[1].work_area()); + browser2->window()->SetBounds(displays[1].work_area()); + // Ensures browser 2 is above browser 1 in display 1. + browser_list->SetLastActive(browser2); + browser_list->SetLastActive(browser0); + EXPECT_EQ(browser_list->size(), 3U); + EXPECT_EQ(browser0->window()->GetNativeWindow()->GetRootWindow(), roots[0]); + EXPECT_EQ(browser1->window()->GetNativeWindow()->GetRootWindow(), roots[1]); + EXPECT_EQ(browser2->window()->GetNativeWindow()->GetRootWindow(), roots[1]); + EXPECT_EQ(browser0->tab_strip_model()->count(), 1); + EXPECT_EQ(browser1->tab_strip_model()->count(), 1); + EXPECT_EQ(browser2->tab_strip_model()->count(), 1); + + // Launches an app from the shelf of display 0 and expects a new tab is opened + // in the uppermost browser in display 0. + ash::ShelfID shortcut_id = CreateShortcut("app1"); + Shelf::ActivateShelfItemOnDisplay(model_->ItemIndexByID(shortcut_id), + displays[1].id()); + EXPECT_EQ(browser0->tab_strip_model()->count(), 1); + EXPECT_EQ(browser1->tab_strip_model()->count(), 1); + EXPECT_EQ(browser2->tab_strip_model()->count(), 2); +} + +// Tests behavior of launching app from shelf in the first display while the +// second display has the focus. Initially, No browser exists in the first +// display. +IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchAppFromDisplayWithoutFocus1) { + // Updates the display configuration to add a secondary display. + display::DisplayManager* display_manager = + ash::Shell::Get()->display_manager(); + display::test::DisplayManagerTestApi(display_manager) + .UpdateDisplay("800x800,801+0-800x800"); + display::Displays displays = display_manager->active_display_list(); + aura::Window::Windows roots = ash::Shell::GetAllRootWindows(); + EXPECT_EQ(displays.size(), 2U); + EXPECT_EQ(roots.size(), 2U); + EXPECT_EQ( + displays[0].id(), + display::Screen::GetScreen()->GetDisplayNearestWindow(roots[0]).id()); + EXPECT_EQ( + displays[1].id(), + display::Screen::GetScreen()->GetDisplayNearestWindow(roots[1]).id()); + + // Ensures that display 0 has one browser with focus and display 1 has no + // browser. The browser only has one tab. + BrowserList* browser_list = BrowserList::GetInstance(); + Browser* browser0 = browser(); + browser0->window()->SetBounds(displays[0].work_area()); + EXPECT_EQ(browser_list->size(), 1U); + EXPECT_EQ(browser0->window()->GetNativeWindow()->GetRootWindow(), roots[0]); + EXPECT_EQ(browser0->tab_strip_model()->count(), 1); + + // Launches an app from the shelf of display 0 and expects a new browser with + // one tab is opened in display 0. + ash::ShelfID shortcut_id = CreateShortcut("app1"); + Shelf::ActivateShelfItemOnDisplay(model_->ItemIndexByID(shortcut_id), + displays[1].id()); + Browser* browser1 = browser_list->GetLastActive(); + EXPECT_EQ(browser_list->size(), 2U); + EXPECT_NE(browser1, browser0); + EXPECT_EQ(browser0->tab_strip_model()->count(), 1); + EXPECT_EQ(browser1->tab_strip_model()->count(), 1); +} + // Launch the app first and then create the shortcut. IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchUnpinned) { TabStripModel* tab_strip = browser()->tab_strip_model(); @@ -950,7 +1041,8 @@ WindowOpenDisposition::NEW_BACKGROUND_TAB); EXPECT_EQ(++tab_count, tab_strip->count()); controller_->LaunchApp(ash::ShelfID(last_loaded_extension_id()), - ash::LAUNCH_FROM_UNKNOWN, 0); + ash::LAUNCH_FROM_UNKNOWN, 0, + display::kInvalidDisplayId); } // Confirm that clicking a icon for an app running in one of 2 maxmized windows @@ -1001,9 +1093,11 @@ TabStripModel* tab_strip = browser()->tab_strip_model(); int tab_count = tab_strip->count(); ash::ShelfID id(LoadExtension(test_data_dir_.AppendASCII("app1"))->id()); - controller_->LaunchApp(id, ash::LAUNCH_FROM_UNKNOWN, 0); + controller_->LaunchApp(id, ash::LAUNCH_FROM_UNKNOWN, 0, + display::kInvalidDisplayId); EXPECT_EQ(++tab_count, tab_strip->count()); - controller_->LaunchApp(id, ash::LAUNCH_FROM_UNKNOWN, 0); + controller_->LaunchApp(id, ash::LAUNCH_FROM_UNKNOWN, 0, + display::kInvalidDisplayId); EXPECT_EQ(++tab_count, tab_strip->count()); }
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 67cd0a80..4b970670 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -27,7 +27,7 @@ #include "ash/test/ash_test_helper.h" #include "ash/test/shell_test_api.h" #include "ash/test/test_shell_delegate.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/compiler_specific.h" @@ -960,9 +960,9 @@ } void EnableTabletMode(bool enable) { - ash::TabletModeController* controller = - ash::Shell::Get()->tablet_mode_controller(); - controller->EnableTabletModeWindowManager(enable); + ash::MaximizeModeController* controller = + ash::Shell::Get()->maximize_mode_controller(); + controller->EnableMaximizeModeWindowManager(enable); } void ValidateArcState(bool arc_enabled, @@ -2304,7 +2304,7 @@ // input. std::string png_data; EXPECT_TRUE(arc_test_.app_instance()->GenerateAndSendIcon( - arc_test_.fake_apps()[0], arc::mojom::ScaleFactor::SCALE_FACTOR_300P, + arc_test_.fake_apps()[0], arc::mojom::ScaleFactor::SCALE_FACTOR_100P, &png_data)); EXPECT_FALSE(png_data.empty()); // Some input that represents invalid png content.
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc index 8230d1e9..3639dfd 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -8,6 +8,7 @@ #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_model.h" +#include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_port.h" #include "ash/strings/grit/ash_strings.h" @@ -107,7 +108,11 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { switch (static_cast<MenuItem>(command_id)) { case MENU_OPEN_NEW: - controller_->Launch(item_.id, ui::EF_NONE); + controller_->LaunchApp(item_.id, ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE, + display::Screen::GetScreen() + ->GetDisplayNearestWindow( + shelf_->shelf_widget()->GetNativeWindow()) + .id()); break; case MENU_CLOSE: if (item_.type == ash::TYPE_DIALOG) {
diff --git a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc index b5771d0..8f4427e 100644 --- a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc +++ b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
@@ -31,6 +31,7 @@ #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" #include "net/base/url_util.h" +#include "ui/display/types/display_constants.h" #include "ui/events/event_constants.h" namespace { @@ -168,7 +169,8 @@ void LauncherControllerHelper::LaunchApp(const ash::ShelfID& id, ash::ShelfLaunchSource source, - int event_flags) { + int event_flags, + int64_t display_id) { const std::string& app_id = id.app_id; const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); if (arc_prefs && arc_prefs->IsRegistered(app_id)) { @@ -194,7 +196,8 @@ // The app will be created for the currently active profile. AppLaunchParams params = CreateAppLaunchParamsWithEventFlags( - profile_, extension, event_flags, extensions::SOURCE_APP_LAUNCHER); + profile_, extension, event_flags, extensions::SOURCE_APP_LAUNCHER, + display_id); if (source != ash::LAUNCH_FROM_UNKNOWN && app_id == extensions::kWebStoreAppId) { // Get the corresponding source string. @@ -216,7 +219,7 @@ void LauncherControllerHelper::ExtensionEnableFlowFinished() { LaunchApp(ash::ShelfID(extension_enable_flow_->extension_id()), - ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE); + ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE, display::kInvalidDisplayId); extension_enable_flow_.reset(); }
diff --git a/chrome/browser/ui/ash/launcher/launcher_controller_helper.h b/chrome/browser/ui/ash/launcher/launcher_controller_helper.h index 0aa01316..0b518dc 100644 --- a/chrome/browser/ui/ash/launcher/launcher_controller_helper.h +++ b/chrome/browser/ui/ash/launcher/launcher_controller_helper.h
@@ -43,7 +43,8 @@ void LaunchApp(const ash::ShelfID& id, ash::ShelfLaunchSource source, - int event_flags); + int event_flags, + int64_t display_id); virtual ArcAppListPrefs* GetArcAppListPrefs() const;
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc index ec58792..99a8b07 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
@@ -8,7 +8,7 @@ #include "ash/multi_profile_uma.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm_window.h" #include "base/auto_reset.h" @@ -683,12 +683,12 @@ aura::Window* window, bool visible, int animation_time_in_ms) { - // The TabletModeWindowManager will not handle invisible windows since they + // The MaximizeModeWindowManager will not handle invisible windows since they // are not user activatable. Since invisible windows are not being tracked, // we tell it to maximize / track this window now before it gets shown, to // reduce animation jank from multiple resizes. if (visible) - ash::Shell::Get()->tablet_mode_controller()->AddWindow(window); + ash::Shell::Get()->maximize_mode_controller()->AddWindow(window); AnimationSetter animation_setter( window,
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index d6f8cc9..b0e1d010 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
@@ -13,9 +13,9 @@ #include "ash/test/ash_test_environment_content.h" #include "ash/test/ash_test_helper.h" #include "ash/test/test_shell_delegate.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" #include "ash/wm/mru_window_tracker.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" @@ -270,17 +270,18 @@ return chrome::UserSwitchAnimatorChromeOS::CoversScreen(window); } - // Create a tablet mode window manager. - TabletModeWindowManager* CreateTabletModeWindowManager() { - EXPECT_FALSE(tablet_mode_window_manager()); - Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); - return tablet_mode_window_manager(); + // Create a maximize mode window manager. + MaximizeModeWindowManager* CreateMaximizeModeWindowManager() { + EXPECT_FALSE(maximize_mode_window_manager()); + Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( + true); + return maximize_mode_window_manager(); } - TabletModeWindowManager* tablet_mode_window_manager() { + MaximizeModeWindowManager* maximize_mode_window_manager() { return Shell::Get() - ->tablet_mode_controller() - ->tablet_mode_window_manager_.get(); + ->maximize_mode_controller() + ->maximize_mode_window_manager_.get(); } private: @@ -298,7 +299,7 @@ chromeos::ScopedUserManagerEnabler user_manager_enabler_; // The maximized window manager (if enabled). - std::unique_ptr<TabletModeWindowManager> tablet_mode_window_manager_; + std::unique_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_; DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOSTest); }; @@ -854,9 +855,9 @@ EXPECT_EQ("H[A,B], H[A,B], S[B,A], H[B,A]", GetStatus()); } -// Test that in case of an activated tablet mode, windows from other users get +// Test that in case of an activated maximize mode, windows from other users get // maximized after a user switch. -TEST_F(MultiUserWindowManagerChromeOSTest, TabletModeInteraction) { +TEST_F(MultiUserWindowManagerChromeOSTest, MaximizeModeInteraction) { SetUpForThisManyWindows(2); const AccountId account_id_A(AccountId::FromUserEmail("A")); @@ -868,7 +869,7 @@ EXPECT_FALSE(wm::GetWindowState(window(0))->IsMaximized()); EXPECT_FALSE(wm::GetWindowState(window(1))->IsMaximized()); - TabletModeWindowManager* manager = CreateTabletModeWindowManager(); + MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); ASSERT_TRUE(manager); EXPECT_TRUE(wm::GetWindowState(window(0))->IsMaximized());
diff --git a/chrome/browser/ui/ash/session_controller_client.cc b/chrome/browser/ui/ash/session_controller_client.cc index 96b2ab5e..6d3f0ac59 100644 --- a/chrome/browser/ui/ash/session_controller_client.cc +++ b/chrome/browser/ui/ash/session_controller_client.cc
@@ -68,15 +68,17 @@ ash::mojom::UserSessionPtr session = ash::mojom::UserSession::New(); session->session_id = user_session_id; - session->type = user.GetType(); - session->account_id = user.GetAccountId(); - session->display_name = base::UTF16ToUTF8(user.display_name()); - session->display_email = user.display_email(); + session->user_info = ash::mojom::UserInfo::New(); + session->user_info->type = user.GetType(); + session->user_info->account_id = user.GetAccountId(); + session->user_info->display_name = base::UTF16ToUTF8(user.display_name()); + session->user_info->display_email = user.display_email(); - session->avatar = user.GetImage(); - if (session->avatar.isNull()) { - session->avatar = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_PROFILE_PICTURE_LOADING); + session->user_info->avatar = user.GetImage(); + if (session->user_info->avatar.isNull()) { + session->user_info->avatar = + *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( + IDR_PROFILE_PICTURE_LOADING); } if (user.IsSupervised()) {
diff --git a/chrome/browser/ui/ash/session_controller_client_unittest.cc b/chrome/browser/ui/ash/session_controller_client_unittest.cc index 2b501f5..1f230d2e 100644 --- a/chrome/browser/ui/ash/session_controller_client_unittest.cc +++ b/chrome/browser/ui/ash/session_controller_client_unittest.cc
@@ -446,7 +446,7 @@ // The session controller received session info and user session. EXPECT_LT(0u, session_controller.last_user_session()->session_id); EXPECT_EQ(user_manager::USER_TYPE_SUPERVISED, - session_controller.last_user_session()->type); + session_controller.last_user_session()->user_info->type); // Simulate profile creation after login. TestingProfile* user_profile = CreateTestingProfile(user);
diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc index 66d11e9..cd2ba0b 100644 --- a/chrome/browser/ui/browser_finder.cc +++ b/chrome/browser/ui/browser_finder.cc
@@ -13,6 +13,8 @@ #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/browser/navigation_controller.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #if defined(OS_CHROMEOS) #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" @@ -32,6 +34,7 @@ const int kMatchOriginalProfile = 1 << 0; const int kMatchCanSupportWindowFeature = 1 << 1; const int kMatchTabbed = 1 << 2; +const int kMatchDisplayId = 1 << 3; // Returns true if the specified |browser| matches the specified arguments. // |match_types| is a bitmask dictating what parameters to match: @@ -44,7 +47,8 @@ bool BrowserMatches(Browser* browser, Profile* profile, Browser::WindowFeature window_feature, - uint32_t match_types) { + uint32_t match_types, + int64_t display_id) { if ((match_types & kMatchCanSupportWindowFeature) && !browser->CanSupportWindowFeature(window_feature)) { return false; @@ -85,8 +89,14 @@ #endif } - if (match_types & kMatchTabbed) - return browser->is_type_tabbed(); + if ((match_types & kMatchTabbed) && !browser->is_type_tabbed()) + return false; + + if (match_types & kMatchDisplayId) { + return display::Screen::GetScreen() + ->GetDisplayNearestWindow(browser->window()->GetNativeWindow()) + .id() == display_id; + } return true; } @@ -99,17 +109,20 @@ const T& end, Profile* profile, Browser::WindowFeature window_feature, - uint32_t match_types) { + uint32_t match_types, + int64_t display_id = display::kInvalidDisplayId) { for (T i = begin; i != end; ++i) { - if (BrowserMatches(*i, profile, window_feature, match_types)) + if (BrowserMatches(*i, profile, window_feature, match_types, display_id)) return *i; } return NULL; } -Browser* FindBrowserWithTabbedOrAnyType(Profile* profile, - bool match_tabbed, - bool match_original_profiles) { +Browser* FindBrowserWithTabbedOrAnyType( + Profile* profile, + bool match_tabbed, + bool match_original_profiles, + int64_t display_id = display::kInvalidDisplayId) { BrowserList* browser_list_impl = BrowserList::GetInstance(); if (!browser_list_impl) return NULL; @@ -118,27 +131,29 @@ match_types |= kMatchTabbed; if (match_original_profiles) match_types |= kMatchOriginalProfile; - Browser* browser = FindBrowserMatching(browser_list_impl->begin_last_active(), - browser_list_impl->end_last_active(), - profile, - Browser::FEATURE_NONE, - match_types); + if (display_id != display::kInvalidDisplayId) + match_types |= kMatchDisplayId; + Browser* browser = + FindBrowserMatching(browser_list_impl->begin_last_active(), + browser_list_impl->end_last_active(), profile, + Browser::FEATURE_NONE, match_types, display_id); // Fall back to a forward scan of all Browsers if no active one was found. - return browser ? browser : FindBrowserMatching(browser_list_impl->begin(), - browser_list_impl->end(), - profile, - Browser::FEATURE_NONE, - match_types); + return browser ? browser + : FindBrowserMatching( + browser_list_impl->begin(), browser_list_impl->end(), + profile, Browser::FEATURE_NONE, match_types, display_id); } size_t GetBrowserCountImpl(Profile* profile, - uint32_t match_types) { + uint32_t match_types, + int64_t display_id = display::kInvalidDisplayId) { BrowserList* browser_list_impl = BrowserList::GetInstance(); size_t count = 0; if (browser_list_impl) { for (BrowserList::const_iterator i = browser_list_impl->begin(); i != browser_list_impl->end(); ++i) { - if (BrowserMatches(*i, profile, Browser::FEATURE_NONE, match_types)) + if (BrowserMatches(*i, profile, Browser::FEATURE_NONE, match_types, + display_id)) count++; } } @@ -150,8 +165,10 @@ namespace chrome { Browser* FindTabbedBrowser(Profile* profile, - bool match_original_profiles) { - return FindBrowserWithTabbedOrAnyType(profile, true, match_original_profiles); + bool match_original_profiles, + int64_t display_id) { + return FindBrowserWithTabbedOrAnyType(profile, true, match_original_profiles, + display_id); } Browser* FindAnyBrowser(Profile* profile,
diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h index bd6bd20..9149a00 100644 --- a/chrome/browser/ui/browser_finder.h +++ b/chrome/browser/ui/browser_finder.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include "chrome/browser/ui/browser.h" +#include "ui/display/types/display_constants.h" #include "ui/gfx/native_widget_types.h" class Profile; @@ -29,7 +30,11 @@ // browser->profile()->GetOriginalProfile(). This has the effect of matching // against both non-incognito and incognito profiles. If // |match_original_profiles| is false, only an exact match may be returned. -Browser* FindTabbedBrowser(Profile* profile, bool match_original_profiles); +// If |display_id| is not equal to display::kInvalidDisplayId, only the browsers +// in the corresponding display may be returned. +Browser* FindTabbedBrowser(Profile* profile, + bool match_original_profiles, + int64_t display_id = display::kInvalidDisplayId); // Finds an existing browser window of any kind. Browser* FindAnyBrowser(Profile* profile,
diff --git a/chrome/browser/ui/extensions/app_launch_params.cc b/chrome/browser/ui/extensions/app_launch_params.cc index f50c8650..1d3d5d8 100644 --- a/chrome/browser/ui/extensions/app_launch_params.cc +++ b/chrome/browser/ui/extensions/app_launch_params.cc
@@ -25,14 +25,16 @@ extensions::LaunchContainer container, WindowOpenDisposition disposition, extensions::AppLaunchSource source, - bool set_playstore_status) + bool set_playstore_status, + int64_t display_id) : profile(profile), extension_id(extension ? extension->id() : std::string()), container(container), disposition(disposition), command_line(base::CommandLine::NO_PROGRAM), source(source), - play_store_status(PlayStoreStatus::PLAY_STORE_STATUS_UNKNOWN) { + play_store_status(PlayStoreStatus::PLAY_STORE_STATUS_UNKNOWN), + display_id(display_id) { #if defined(OS_CHROMEOS) // TODO(b/34478891): Remove this from app launch. if (set_playstore_status) { @@ -65,7 +67,8 @@ Profile* profile, const extensions::Extension* extension, int event_flags, - extensions::AppLaunchSource source) { + extensions::AppLaunchSource source, + int64_t display_id) { WindowOpenDisposition raw_disposition = ui::DispositionFromEventFlags(event_flags); @@ -85,5 +88,6 @@ extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension); disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; } - return AppLaunchParams(profile, extension, container, disposition, source); + return AppLaunchParams(profile, extension, container, disposition, source, + false, display_id); }
diff --git a/chrome/browser/ui/extensions/app_launch_params.h b/chrome/browser/ui/extensions/app_launch_params.h index 8ca55e2..b81ebe1 100644 --- a/chrome/browser/ui/extensions/app_launch_params.h +++ b/chrome/browser/ui/extensions/app_launch_params.h
@@ -13,6 +13,7 @@ #include "extensions/common/api/app_runtime.h" #include "extensions/common/constants.h" #include "ui/base/window_open_disposition.h" +#include "ui/display/types/display_constants.h" #include "ui/gfx/geometry/rect.h" #include "url/gurl.h" @@ -28,7 +29,8 @@ extensions::LaunchContainer container, WindowOpenDisposition disposition, extensions::AppLaunchSource source, - bool set_playstore_status = false); + bool set_playstore_status = false, + int64_t display_id = display::kInvalidDisplayId); AppLaunchParams(const AppLaunchParams& other); @@ -71,6 +73,11 @@ // Status of ARC on this device. extensions::api::app_runtime::PlayStoreStatus play_store_status; + + // The id of the display from which the app is launched. + // display::kInvalidDisplayId means that the display does not exist or is not + // set. + int64_t display_id; }; // Helper to create AppLaunchParams using extensions::GetLaunchContainer with @@ -83,11 +90,13 @@ // Helper to create AppLaunchParams using event flags that allows user to // override the user-configured container using modifier keys, falling back to -// extensions::GetLaunchContainer() with no modifiers. +// extensions::GetLaunchContainer() with no modifiers. |display_id| is the id of +// the display from which the app is launched. AppLaunchParams CreateAppLaunchParamsWithEventFlags( Profile* profile, const extensions::Extension* extension, int event_flags, - extensions::AppLaunchSource source); + extensions::AppLaunchSource source, + int64_t display_id); #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc index ff846ea..b4405a80 100644 --- a/chrome/browser/ui/extensions/application_launch.cc +++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -228,7 +228,8 @@ Profile* const profile = launch_params.profile; WindowOpenDisposition disposition = launch_params.disposition; - Browser* browser = chrome::FindTabbedBrowser(profile, false); + Browser* browser = + chrome::FindTabbedBrowser(profile, false, launch_params.display_id); WebContents* contents = NULL; if (!browser) { // No browser for this profile, need to open a new one.
diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc index 12792d23..15ae43e 100644 --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc
@@ -22,6 +22,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_utils.h" #include "extensions/browser/extension_registry.h" @@ -400,3 +401,78 @@ // |diff_dir| and/or |same_site|). } } + +class HostedAppWithIsolatedOriginsTest : public HostedAppTest { + public: + HostedAppWithIsolatedOriginsTest() {} + ~HostedAppWithIsolatedOriginsTest() override {} + + void SetUpCommandLine(base::CommandLine* command_line) override { + ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); + std::string origin_list = + embedded_test_server()->GetURL("isolated.foo.com", "/").spec(); + command_line->AppendSwitchASCII(switches::kIsolateOrigins, origin_list); + } + + void SetUpOnMainThread() override { + HostedAppTest::SetUpOnMainThread(); + host_resolver()->AddRule("*", "127.0.0.1"); + embedded_test_server()->StartAcceptingConnections(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(HostedAppWithIsolatedOriginsTest); +}; + +// Verify that when navigating to an isolated origin which is also part of +// a hosted app's web extent, the isolated origin takes precedence for +// SiteInstance determination and still ends up in a dedicated process. +IN_PROC_BROWSER_TEST_F(HostedAppWithIsolatedOriginsTest, + IsolatedOriginTakesPrecedence) { + // Launch a hosted app which covers an isolated origin in its web extent. + GURL url = embedded_test_server()->GetURL("app.foo.com", "/iframe.html"); + extensions::TestExtensionDir test_app_dir; + test_app_dir.WriteManifest(base::StringPrintf( + R"( { "name": "Hosted App vs IsolatedOrigins Test", + "version": "1", + "manifest_version": 2, + "app": { + "launch": { + "web_url": "%s" + }, + "urls": ["*://app.foo.com", "*://isolated.foo.com/"] + } + } )", + url.spec().c_str())); + SetupApp(test_app_dir.UnpackedPath(), false); + + content::WebContents* app_contents = + app_browser_->tab_strip_model()->GetActiveWebContents(); + content::WaitForLoadStop(app_contents); + + content::RenderFrameHost* app = app_contents->GetMainFrame(); + + // A subframe on an app for an isolated origin should be kicked out to its + // own process. + GURL isolated_url = + embedded_test_server()->GetURL("isolated.foo.com", "/title1.html"); + EXPECT_TRUE(NavigateIframeToURL(app_contents, "test", isolated_url)); + + content::RenderFrameHost* app_subframe = content::ChildFrameAt(app, 0); + EXPECT_EQ(isolated_url, app_subframe->GetLastCommittedURL()); + EXPECT_TRUE(app_subframe->IsCrossProcessSubframe()); + EXPECT_NE(app->GetSiteInstance(), app_subframe->GetSiteInstance()); + EXPECT_EQ(isolated_url.GetOrigin(), + app_subframe->GetSiteInstance()->GetSiteURL()); + + // Navigating a regular tab to an isolated origin which is also part of an + // app's web extent should use the isolated origin's SiteInstance and not the + // app's. + ui_test_utils::NavigateToURL(browser(), isolated_url); + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_EQ(isolated_url.GetOrigin(), + web_contents->GetMainFrame()->GetSiteInstance()->GetSiteURL()); + EXPECT_NE(web_contents->GetMainFrame()->GetSiteInstance(), + app->GetSiteInstance()); +}
diff --git a/chrome/browser/ui/toolbar/media_router_contextual_menu.cc b/chrome/browser/ui/toolbar/media_router_contextual_menu.cc index 5ff5bc2..684c733e 100644 --- a/chrome/browser/ui/toolbar/media_router_contextual_menu.cc +++ b/chrome/browser/ui/toolbar/media_router_contextual_menu.cc
@@ -74,8 +74,10 @@ GetChangeVisibilityTextId()); menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) - menu_model_.AddItemWithStringId(IDC_MEDIA_ROUTER_MANAGE_DEVICES, - IDS_MEDIA_ROUTER_MANAGE_DEVICES); + if (!browser_->profile()->IsOffTheRecord()) { + menu_model_.AddItemWithStringId(IDC_MEDIA_ROUTER_MANAGE_DEVICES, + IDS_MEDIA_ROUTER_MANAGE_DEVICES); + } #endif menu_model_.AddCheckItemWithStringId(IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE, IDS_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE);
diff --git a/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc b/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc index 5cc5106..c30f273 100644 --- a/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc +++ b/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc
@@ -123,6 +123,16 @@ } } +// Note that "Manage devices" is always disabled on Linux. +TEST_F(MediaRouterContextualMenuUnitTest, ManageDevicesDisabledInIncognito) { + // Create the MediaRouterAction under an incognito profile. + profile()->ForceIncognito(true); + action_ = base::MakeUnique<MediaRouterAction>( + browser(), browser_action_test_util_->GetToolbarActionsBar()); + model_ = static_cast<ui::SimpleMenuModel*>(action_->GetContextMenu()); + EXPECT_EQ(-1, model_->GetIndexOfCommandId(IDC_MEDIA_ROUTER_MANAGE_DEVICES)); +} + // Tests whether the cloud services item is correctly toggled. This menu item // is only availble on official Chrome builds. TEST_F(MediaRouterContextualMenuUnitTest, ToggleCloudServicesItem) {
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 18b1a436..6bea463 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -81,6 +81,9 @@ // this case, so make it wider than normal. constexpr int kExternalInstallLeftColumnWidth = 350; +// Time delay before the install button is enabled after initial display. +int g_install_delay_in_ms = 500; + // Get the appropriate indentation for an item if its parent is using bullet // points. If the parent is using bullets for its items, then a padding of one // unit will make the child item (which has no bullet) look like a sibling of @@ -92,9 +95,6 @@ (parent_bulleted ? 2 : 1); } -// Time delay before the install button is enabled after initial display. -int g_install_delay_in_ms = 500; - void AddResourceIcon(const gfx::ImageSkia* skia_image, void* data) { views::View* parent = static_cast<views::View*>(data); views::ImageView* image_view = new views::ImageView();
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc index 7bece9ae..230696a5 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
@@ -217,9 +217,13 @@ // Check initial button states. EXPECT_FALSE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); + EXPECT_TRUE(delegate_view->GetInitiallyFocusedView()->HasFocus()); // Check OK button state after timeout to verify that it is re-enabled. base::RunLoop().RunUntilIdle(); EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); + + // Ensure default button (cancel) has focus. + EXPECT_TRUE(delegate_view->GetInitiallyFocusedView()->HasFocus()); delegate_view->Close(); }
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index 9418044..5c7f6c1 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -325,15 +325,15 @@ caption_button_container_->SetVisible(true); } -void BrowserNonClientFrameViewAsh::OnTabletModeStarted() { +void BrowserNonClientFrameViewAsh::OnMaximizeModeStarted() { caption_button_container_->UpdateSizeButtonVisibility(); InvalidateLayout(); frame()->client_view()->InvalidateLayout(); frame()->GetRootView()->Layout(); } -void BrowserNonClientFrameViewAsh::OnTabletModeEnded() { - OnTabletModeStarted(); +void BrowserNonClientFrameViewAsh::OnMaximizeModeEnded() { + OnMaximizeModeStarted(); } ///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h index d983e5c7..bb5b174 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h
@@ -57,8 +57,8 @@ // ash::ShellObserver: void OnOverviewModeStarting() override; void OnOverviewModeEnded() override; - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnded() override; // TabIconViewModel: bool ShouldTabIconViewAnimate() const override; @@ -75,7 +75,7 @@ FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen); FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, - ToggleTabletModeRelayout); + ToggleMaximizeModeRelayout); FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, AvatarDisplayOnTeleportedWindow); friend class BrowserHeaderPainterAsh;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc index 6f698e02..18c2b45 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
@@ -9,7 +9,7 @@ #include "ash/frame/header_painter.h" #include "ash/shell.h" #include "ash/test/immersive_fullscreen_controller_test_api.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/command_line.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h" @@ -263,9 +263,9 @@ } // Tests that FrameCaptionButtonContainer has been relaid out in response to -// tablet mode being toggled. +// maximize mode being toggled. IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, - ToggleTabletModeRelayout) { + ToggleMaximizeModeRelayout) { BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); Widget* widget = browser_view->GetWidget(); // We know we're using Ash, so static cast. @@ -274,16 +274,18 @@ widget->non_client_view()->frame_view()); const gfx::Rect initial = frame_view->caption_button_container_->bounds(); - ash::Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( - true); + ash::Shell::Get() + ->maximize_mode_controller() + ->EnableMaximizeModeWindowManager(true); ash::FrameCaptionButtonContainerView::TestApi test(frame_view-> caption_button_container_); test.EndAnimations(); const gfx::Rect during_maximize = frame_view->caption_button_container_-> bounds(); EXPECT_GT(initial.width(), during_maximize.width()); - ash::Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( - false); + ash::Shell::Get() + ->maximize_mode_controller() + ->EnableMaximizeModeWindowManager(false); test.EndAnimations(); const gfx::Rect after_restore = frame_view->caption_button_container_-> bounds();
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index da4d74d..b106079 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -42,7 +42,7 @@ #if defined(USE_ASH) #include "ash/accelerators/accelerator_commands.h" // nogncheck #include "ash/shell.h" // nogncheck -#include "ash/wm/tablet_mode/tablet_mode_controller.h" // nogncheck +#include "ash/wm/maximize_mode/maximize_mode_controller.h" // nogncheck #include "ash/wm/window_state.h" // nogncheck #include "ui/wm/core/coordinate_conversion.h" // nogncheck #endif @@ -302,8 +302,8 @@ #if defined(USE_ASH) if (ash::Shell::HasInstance() && ash::Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled()) { + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled()) { detach_behavior_ = NOT_DETACHABLE; } #endif
diff --git a/chrome/browser/ui/webui/media_router/cast_modes_with_media_sources_unittest.cc b/chrome/browser/ui/webui/media_router/cast_modes_with_media_sources_unittest.cc index a056b7a83..9c42856 100644 --- a/chrome/browser/ui/webui/media_router/cast_modes_with_media_sources_unittest.cc +++ b/chrome/browser/ui/webui/media_router/cast_modes_with_media_sources_unittest.cc
@@ -12,64 +12,75 @@ namespace media_router { TEST(MediaRouterCastModesWithMediaSourcesTest, AddAndRemoveSources) { - const MediaSource defaultSource1(MediaSourceForPresentationUrl( + const MediaSource presentationSource1(MediaSourceForPresentationUrl( GURL("http://www.example.com/presentation.html"))); - const MediaSource defaultSource2(MediaSourceForPresentationUrl( + const MediaSource presentationSource2(MediaSourceForPresentationUrl( GURL("http://www.example.net/presentation.html"))); const MediaSource tabSourceA(MediaSourceForTab(123)); const CastModeSet castModeSetEmpty; - const CastModeSet castModeSetDefault({MediaCastMode::DEFAULT}); + const CastModeSet castModeSetPresentation({MediaCastMode::PRESENTATION}); const CastModeSet castModeSetTab({MediaCastMode::TAB_MIRROR}); - const CastModeSet castModeSetDefaultAndTab( - {MediaCastMode::DEFAULT, MediaCastMode::TAB_MIRROR}); + const CastModeSet castModeSetPresentationAndTab( + {MediaCastMode::PRESENTATION, MediaCastMode::TAB_MIRROR}); CastModesWithMediaSources sources; EXPECT_TRUE(sources.IsEmpty()); EXPECT_EQ(sources.GetCastModes(), castModeSetEmpty); // After the below addition, |sources| should contain: - // [Default: 1] - sources.AddSource(MediaCastMode::DEFAULT, defaultSource1); - EXPECT_TRUE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); - EXPECT_FALSE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource2)); - EXPECT_FALSE(sources.HasSource(MediaCastMode::TAB_MIRROR, defaultSource1)); + // [Presentation: 1] + sources.AddSource(MediaCastMode::PRESENTATION, presentationSource1); + EXPECT_TRUE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource2)); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::TAB_MIRROR, presentationSource1)); EXPECT_FALSE(sources.IsEmpty()); - EXPECT_EQ(sources.GetCastModes(), castModeSetDefault); + EXPECT_EQ(sources.GetCastModes(), castModeSetPresentation); // Trying to remove non-existing sources should be no-op. - sources.RemoveSource(MediaCastMode::DEFAULT, defaultSource2); - sources.RemoveSource(MediaCastMode::TAB_MIRROR, defaultSource1); + sources.RemoveSource(MediaCastMode::PRESENTATION, presentationSource2); + sources.RemoveSource(MediaCastMode::TAB_MIRROR, presentationSource1); sources.RemoveSource(MediaCastMode::TAB_MIRROR, tabSourceA); - EXPECT_TRUE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); - EXPECT_EQ(sources.GetCastModes(), castModeSetDefault); + EXPECT_TRUE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); + EXPECT_EQ(sources.GetCastModes(), castModeSetPresentation); - // [Default: 1; Tab: A] + // [Presentation: 1; Tab: A] sources.AddSource(MediaCastMode::TAB_MIRROR, tabSourceA); - EXPECT_TRUE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); + EXPECT_TRUE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); EXPECT_TRUE(sources.HasSource(MediaCastMode::TAB_MIRROR, tabSourceA)); - EXPECT_EQ(sources.GetCastModes(), castModeSetDefaultAndTab); + EXPECT_EQ(sources.GetCastModes(), castModeSetPresentationAndTab); - // [Default: 1,2; Tab: A] - sources.AddSource(MediaCastMode::DEFAULT, defaultSource2); - EXPECT_TRUE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource2)); - EXPECT_EQ(sources.GetCastModes(), castModeSetDefaultAndTab); + // [Presentation: 1,2; Tab: A] + sources.AddSource(MediaCastMode::PRESENTATION, presentationSource2); + EXPECT_TRUE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource2)); + EXPECT_EQ(sources.GetCastModes(), castModeSetPresentationAndTab); - // [Default: 2; Tab: A] - sources.RemoveSource(MediaCastMode::DEFAULT, defaultSource1); - EXPECT_FALSE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); - EXPECT_TRUE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource2)); - EXPECT_EQ(sources.GetCastModes(), castModeSetDefaultAndTab); + // [Presentation: 2; Tab: A] + sources.RemoveSource(MediaCastMode::PRESENTATION, presentationSource1); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); + EXPECT_TRUE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource2)); + EXPECT_EQ(sources.GetCastModes(), castModeSetPresentationAndTab); // [Tab: A] - sources.RemoveSource(MediaCastMode::DEFAULT, defaultSource2); - EXPECT_FALSE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); + sources.RemoveSource(MediaCastMode::PRESENTATION, presentationSource2); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); EXPECT_FALSE(sources.IsEmpty()); EXPECT_EQ(sources.GetCastModes(), castModeSetTab); // [] sources.RemoveSource(MediaCastMode::TAB_MIRROR, tabSourceA); - EXPECT_FALSE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource1)); - EXPECT_FALSE(sources.HasSource(MediaCastMode::DEFAULT, defaultSource2)); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource1)); + EXPECT_FALSE( + sources.HasSource(MediaCastMode::PRESENTATION, presentationSource2)); EXPECT_FALSE(sources.HasSource(MediaCastMode::TAB_MIRROR, tabSourceA)); EXPECT_TRUE(sources.IsEmpty()); EXPECT_EQ(sources.GetCastModes(), castModeSetEmpty);
diff --git a/chrome/browser/ui/webui/media_router/media_cast_mode.cc b/chrome/browser/ui/webui/media_router/media_cast_mode.cc index f742fa7..49af3be 100644 --- a/chrome/browser/ui/webui/media_router/media_cast_mode.cc +++ b/chrome/browser/ui/webui/media_router/media_cast_mode.cc
@@ -14,10 +14,9 @@ std::string MediaCastModeToDescription( MediaCastMode mode, const std::string& host) { switch (mode) { - case MediaCastMode::DEFAULT: - return l10n_util::GetStringFUTF8( - IDS_MEDIA_ROUTER_DEFAULT_CAST_MODE, - base::UTF8ToUTF16(host)); + case MediaCastMode::PRESENTATION: + return l10n_util::GetStringFUTF8(IDS_MEDIA_ROUTER_PRESENTATION_CAST_MODE, + base::UTF8ToUTF16(host)); case MediaCastMode::TAB_MIRROR: return l10n_util::GetStringUTF8( IDS_MEDIA_ROUTER_TAB_MIRROR_CAST_MODE); @@ -32,7 +31,7 @@ bool IsValidCastModeNum(int cast_mode_num) { switch (cast_mode_num) { - case MediaCastMode::DEFAULT: + case MediaCastMode::PRESENTATION: case MediaCastMode::TAB_MIRROR: case MediaCastMode::DESKTOP_MIRROR: return true;
diff --git a/chrome/browser/ui/webui/media_router/media_cast_mode.h b/chrome/browser/ui/webui/media_router/media_cast_mode.h index 9a3a7baa..d5566547 100644 --- a/chrome/browser/ui/webui/media_router/media_cast_mode.h +++ b/chrome/browser/ui/webui/media_router/media_cast_mode.h
@@ -14,17 +14,17 @@ // be presented to a media sink. These must be declared in the priority order // returned by GetPreferredCastMode. enum MediaCastMode { - // A presentation URL provided by the WebContents via the Presentation API. - // This can be set by the default presentation URL (for top level browsing - // contexts) or presentation URLs passed with a PresentationRequest (for top - // level and nested browsing contexts). - // TODO(mfoltz): More accurately named PRESENTATION - DEFAULT = 0x1, - // Capture the rendered WebContents and stream it to a media sink. Always - // available. + // PresentationRequests (and their associated URLs) provided via the + // Presentation API. A top-level browsing context can set a + // PresentationRequest as the page-level default, or any frame can use one by + // calling PresentationRequest.start(). Available when the Presentation API + // is used and there is a compatible sink. + PRESENTATION = 0x1, + // Capture the rendered WebContents and stream it to a media sink. Available + // when there is a compatible sink. TAB_MIRROR = 0x2, - // Capture the entire desktop and stream it to a media sink. Always - // available. + // Capture the entire desktop and stream it to a media sink. Available when + // there is a compatible sink. DESKTOP_MIRROR = 0x4, };
diff --git a/chrome/browser/ui/webui/media_router/media_cast_mode_unittest.cc b/chrome/browser/ui/webui/media_router/media_cast_mode_unittest.cc index 574cdad..b7b93f0 100644 --- a/chrome/browser/ui/webui/media_router/media_cast_mode_unittest.cc +++ b/chrome/browser/ui/webui/media_router/media_cast_mode_unittest.cc
@@ -13,8 +13,9 @@ namespace media_router { TEST(MediaCastModeTest, MediaCastModeToDescription) { - EXPECT_FALSE(MediaCastModeToDescription(MediaCastMode::DEFAULT, "youtube.com") - .empty()); + EXPECT_FALSE( + MediaCastModeToDescription(MediaCastMode::PRESENTATION, "youtube.com") + .empty()); EXPECT_FALSE( MediaCastModeToDescription(MediaCastMode::TAB_MIRROR, "").empty()); EXPECT_FALSE( @@ -22,7 +23,7 @@ } TEST(MediaCastModeTest, IsValidCastModeNum) { - EXPECT_TRUE(IsValidCastModeNum(MediaCastMode::DEFAULT)); + EXPECT_TRUE(IsValidCastModeNum(MediaCastMode::PRESENTATION)); EXPECT_TRUE(IsValidCastModeNum(MediaCastMode::TAB_MIRROR)); EXPECT_TRUE(IsValidCastModeNum(MediaCastMode::DESKTOP_MIRROR)); EXPECT_FALSE(IsValidCastModeNum(-1));
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.cc b/chrome/browser/ui/webui/media_router/media_router_ui.cc index 044db042..dbc148b 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui.cc +++ b/chrome/browser/ui/webui/media_router/media_router_ui.cc
@@ -82,7 +82,7 @@ base::TimeDelta GetRouteRequestTimeout(MediaCastMode cast_mode) { switch (cast_mode) { - case DEFAULT: + case PRESENTATION: return base::TimeDelta::FromSeconds(kCreateRouteTimeoutSeconds); case TAB_MIRROR: return base::TimeDelta::FromSeconds(kCreateRouteTimeoutSecondsForTab); @@ -220,7 +220,8 @@ if (create_session_request_) { bool presentation_sinks_available = std::any_of( sinks_.begin(), sinks_.end(), [](const MediaSinkWithCastModes& sink) { - return base::ContainsValue(sink.cast_modes, MediaCastMode::DEFAULT); + return base::ContainsValue(sink.cast_modes, + MediaCastMode::PRESENTATION); }); if (presentation_sinks_available) { create_session_request_->InvokeErrorCallback(content::PresentationError( @@ -286,7 +287,7 @@ // Presentation requests from content must show the origin requesting // presentation: crbug.com/704964 if (create_session_request_) - forced_cast_mode_ = MediaCastMode::DEFAULT; + forced_cast_mode_ = MediaCastMode::PRESENTATION; router_->OnUserGesture(); @@ -346,7 +347,8 @@ std::vector<MediaSource> sources = presentation_request.GetMediaSources(); presentation_request_.reset(new PresentationRequest(presentation_request)); query_result_manager_->SetSourcesForCastMode( - MediaCastMode::DEFAULT, sources, presentation_request_->frame_origin()); + MediaCastMode::PRESENTATION, sources, + presentation_request_->frame_origin()); // Register for MediaRoute updates. NOTE(mfoltz): If there are multiple // sources that can be connected to via the dialog, this will break. We will // need to observe multiple sources (keyed by sinks) in that case. As this is @@ -363,7 +365,7 @@ void MediaRouterUI::OnDefaultPresentationRemoved() { presentation_request_.reset(); - query_result_manager_->RemoveSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_->RemoveSourcesForCastMode(MediaCastMode::PRESENTATION); // This should not be set if the dialog was initiated with a default // presentation request from the top level frame. However, clear it just to @@ -465,15 +467,15 @@ } *source_id = source->id(); - bool for_default_source = cast_mode == MediaCastMode::DEFAULT; - if (for_default_source && !presentation_request_) { + bool for_presentation_source = cast_mode == MediaCastMode::PRESENTATION; + if (for_presentation_source && !presentation_request_) { DLOG(ERROR) << "Requested to create a route for presentation, but " << "presentation request is missing."; return false; } current_route_request_id_ = ++route_request_counter_; - *origin = for_default_source + *origin = for_presentation_source ? presentation_request_->frame_origin() : url::Origin(GURL(chrome::kChromeUIMediaRouterURL)); DVLOG(1) << "DoCreateRoute: origin: " << *origin; @@ -489,13 +491,13 @@ // PresentationServiceDelegateImpl will have to be notified. Note that we // treat subsequent route requests from a Presentation API-initiated dialogs // as browser-initiated. - if (!for_default_source || !create_session_request_) { + if (!for_presentation_source || !create_session_request_) { route_response_callbacks->push_back(base::Bind( &MediaRouterUI::OnRouteResponseReceived, weak_factory_.GetWeakPtr(), current_route_request_id_, sink_id, cast_mode, base::UTF8ToUTF16(GetTruncatedPresentationRequestSourceName()))); } - if (for_default_source) { + if (for_presentation_source) { if (create_session_request_) { // |create_session_request_| will be nullptr after this call, as the // object will be transferred to the callback. @@ -525,9 +527,10 @@ std::vector<MediaRouteResponseCallback> route_response_callbacks; base::TimeDelta timeout; bool incognito; - if (!SetRouteParameters(sink_id, MediaCastMode::DEFAULT, &source_id, &origin, - &route_response_callbacks, &timeout, &incognito)) { - SendIssueForUnableToCast(MediaCastMode::DEFAULT); + if (!SetRouteParameters(sink_id, MediaCastMode::PRESENTATION, &source_id, + &origin, &route_response_callbacks, &timeout, + &incognito)) { + SendIssueForUnableToCast(MediaCastMode::PRESENTATION); return false; } router_->ConnectRouteByRouteId(source_id, route_id, origin, initiator_, @@ -577,7 +580,7 @@ prefs::kMediaRouterTabMirroringSources); switch (cast_mode) { - case MediaCastMode::DEFAULT: + case MediaCastMode::PRESENTATION: update->Remove(base::Value(GetSerializedInitiatorOrigin()), nullptr); break; case MediaCastMode::TAB_MIRROR: @@ -704,7 +707,7 @@ const base::string16& presentation_request_source_name) { std::string issue_title; switch (cast_mode) { - case DEFAULT: + case PRESENTATION: DLOG_IF(ERROR, presentation_request_source_name.empty()) << "Empty presentation request source name."; issue_title =
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.h b/chrome/browser/ui/webui/media_router/media_router_ui.h index ea9474e6..18c490f 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui.h +++ b/chrome/browser/ui/webui/media_router/media_router_ui.h
@@ -65,7 +65,7 @@ // Must not be null. // |delegate|, as well as mirroring sources of that tab. // The contents of the UI will change as the default MediaSource changes. - // If there is a default MediaSource, then DEFAULT MediaCastMode will be + // If there is a default MediaSource, then PRESENTATION MediaCastMode will be // added to |cast_modes_|. // Init* methods can only be called once. // |delegate|: PresentationServiceDelegateImpl of the initiator tab. @@ -135,7 +135,7 @@ // mode is MediaCastMode::DESKTOP_MIRROR. virtual void RecordCastModeSelection(MediaCastMode cast_mode); - // Returns the hostname of the default source's parent frame URL. + // Returns the hostname of the PresentationRequest's parent frame URL. std::string GetPresentationRequestSourceName() const; std::string GetTruncatedPresentationRequestSourceName() const; bool HasPendingRouteRequest() const { @@ -319,7 +319,7 @@ // match the value of |routes_|. void UpdateRoutesToCastModesMapping(); - // Returns the default presentation request's frame URL if there is one. + // Returns the default PresentationRequest's frame URL if there is one. // Otherwise returns an empty GURL. GURL GetFrameURL() const;
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc b/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc index 2886155..f7ca9d9 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc +++ b/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc
@@ -214,7 +214,7 @@ CreateRoute(_, _, _, _, _, base::TimeDelta::FromSeconds(20), false)) .WillOnce(SaveArg<4>(&callbacks)); media_router_ui_->CreateRoute(CreateSinkCompatibleWithAllSources().id(), - MediaCastMode::DEFAULT); + MediaCastMode::PRESENTATION); std::string expected_title = l10n_util::GetStringFUTF8(IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT, @@ -232,9 +232,9 @@ EXPECT_CALL(mock_router_, SearchSinks(_, _, _, _, _)) .WillOnce(SaveArg<4>(&sink_callback)); - // Use DEFAULT mode without setting a PresentationRequest. - media_router_ui_->SearchSinksAndCreateRoute("sinkId", "search input", - "domain", MediaCastMode::DEFAULT); + // Use PRESENTATION mode without setting a PresentationRequest. + media_router_ui_->SearchSinksAndCreateRoute( + "sinkId", "search input", "domain", MediaCastMode::PRESENTATION); std::string expected_title = l10n_util::GetStringUTF8( IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT_FOR_TAB); EXPECT_CALL(mock_router_, AddIssue(IssueTitleEquals(expected_title))); @@ -253,7 +253,7 @@ mock_router_, CreateRoute(_, _, _, _, _, base::TimeDelta::FromSeconds(20), true)); media_router_ui_->CreateRoute(CreateSinkCompatibleWithAllSources().id(), - MediaCastMode::DEFAULT); + MediaCastMode::PRESENTATION); } TEST_F(MediaRouterUITest, SortedSinks) { @@ -604,7 +604,7 @@ // |url_1a| and |url_1b| have the same origin, so the selection made for // |url_1a| should be retrieved. EXPECT_TRUE(media_router_ui_->UserSelectedTabMirroringForCurrentOrigin()); - media_router_ui_->RecordCastModeSelection(MediaCastMode::DEFAULT); + media_router_ui_->RecordCastModeSelection(MediaCastMode::PRESENTATION); EXPECT_FALSE(media_router_ui_->UserSelectedTabMirroringForCurrentOrigin()); media_router_ui_->RecordCastModeSelection(MediaCastMode::TAB_MIRROR); @@ -725,15 +725,15 @@ // bug? CastModeSet expected_modes( {MediaCastMode::TAB_MIRROR, MediaCastMode::DESKTOP_MIRROR}); - EXPECT_CALL( - *message_handler_, - UpdateCastModes(expected_modes, "", - base::Optional<MediaCastMode>(MediaCastMode::DEFAULT))); - expected_modes.insert(MediaCastMode::DEFAULT); - EXPECT_CALL( - *message_handler_, - UpdateCastModes(expected_modes, "google.com", - base::Optional<MediaCastMode>(MediaCastMode::DEFAULT))); + EXPECT_CALL(*message_handler_, + UpdateCastModes( + expected_modes, "", + base::Optional<MediaCastMode>(MediaCastMode::PRESENTATION))); + expected_modes.insert(MediaCastMode::PRESENTATION); + EXPECT_CALL(*message_handler_, + UpdateCastModes( + expected_modes, "google.com", + base::Optional<MediaCastMode>(MediaCastMode::PRESENTATION))); media_router_ui_->UIInitialized(); media_router_ui_->InitForTest(&mock_router_, web_contents(), message_handler_.get(),
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc index 484b987..9d6d9a9 100644 --- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc +++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc
@@ -336,7 +336,7 @@ std::vector<MediaRoute::Id> joinable_route_ids = {route.media_route_id()}; std::unordered_map<MediaRoute::Id, MediaCastMode> current_cast_modes; current_cast_modes.insert( - std::make_pair(route.media_route_id(), MediaCastMode::DEFAULT)); + std::make_pair(route.media_route_id(), MediaCastMode::PRESENTATION)); EXPECT_CALL(*mock_media_router_ui_, GetRouteProviderExtensionId()).WillOnce( ReturnRef(provider_extension_id())); @@ -349,7 +349,7 @@ EXPECT_EQ(route.description(), GetStringFromDict(route_value, "description")); EXPECT_EQ(route.is_local(), GetBooleanFromDict(route_value, "isLocal")); EXPECT_TRUE(GetBooleanFromDict(route_value, "canJoin")); - EXPECT_EQ(MediaCastMode::DEFAULT, + EXPECT_EQ(MediaCastMode::PRESENTATION, GetIntegerFromDict(route_value, "currentCastMode")); std::string expected_path = base::StringPrintf("%s://%s/%s", extensions::kExtensionScheme, @@ -385,9 +385,11 @@ } TEST_F(MediaRouterWebUIMessageHandlerTest, SetCastModesList) { - CastModeSet cast_modes({MediaCastMode::DEFAULT, MediaCastMode::TAB_MIRROR, + CastModeSet cast_modes({MediaCastMode::PRESENTATION, + MediaCastMode::TAB_MIRROR, MediaCastMode::DESKTOP_MIRROR}); - handler_->UpdateCastModes(cast_modes, "www.host.com", MediaCastMode::DEFAULT); + handler_->UpdateCastModes(cast_modes, "www.host.com", + MediaCastMode::PRESENTATION); const base::ListValue* set_cast_mode_list = ExtractListFromCallArg("media_router.ui.setCastModeList"); @@ -399,7 +401,7 @@ EXPECT_EQ(MediaCastModeToDescription(*i, "www.host.com"), GetStringFromDict(cast_mode, "description")); EXPECT_EQ("www.host.com", GetStringFromDict(cast_mode, "host")); - EXPECT_EQ(*i == MediaCastMode::DEFAULT, + EXPECT_EQ(*i == MediaCastMode::PRESENTATION, GetBooleanFromDict(cast_mode, "isForced")); } } @@ -538,9 +540,9 @@ TEST_F(MediaRouterWebUIMessageHandlerTest, RecordCastModeSelection) { base::ListValue args; - args.AppendInteger(MediaCastMode::DEFAULT); + args.AppendInteger(MediaCastMode::PRESENTATION); EXPECT_CALL(*mock_media_router_ui_, - RecordCastModeSelection(MediaCastMode::DEFAULT)) + RecordCastModeSelection(MediaCastMode::PRESENTATION)) .Times(1); handler_->OnReportSelectedCastMode(&args);
diff --git a/chrome/browser/ui/webui/media_router/query_result_manager.h b/chrome/browser/ui/webui/media_router/query_result_manager.h index a1ab37e..3e7c56d 100644 --- a/chrome/browser/ui/webui/media_router/query_result_manager.h +++ b/chrome/browser/ui/webui/media_router/query_result_manager.h
@@ -42,7 +42,7 @@ // QueryResultManager::Observer* observer = ...; // QueryResultManager result_manager(router); // result_manager.AddObserver(observer); -// result_manager.SetSourcesForCastMode(MediaCastMode::DEFAULT, +// result_manager.SetSourcesForCastMode(MediaCastMode::PRESENTATION, // {MediaSourceForPresentationUrl("http://google.com")}, origin); // result_manager.SetSourcesForCastMode(MediaCastMode::TAB_MIRROR, // {MediaSourceForTab(123)}, origin);
diff --git a/chrome/browser/ui/webui/media_router/query_result_manager_unittest.cc b/chrome/browser/ui/webui/media_router/query_result_manager_unittest.cc index 571a83b8..1521222 100644 --- a/chrome/browser/ui/webui/media_router/query_result_manager_unittest.cc +++ b/chrome/browser/ui/webui/media_router/query_result_manager_unittest.cc
@@ -53,7 +53,7 @@ bool IsDefaultSourceForSink(const MediaSource* source, const MediaSink& sink) { - return IsPreferredSourceForSink(MediaCastMode::DEFAULT, source, sink); + return IsPreferredSourceForSink(MediaCastMode::PRESENTATION, source, sink); } bool IsTabSourceForSink(const MediaSource* source, const MediaSink& sink) { @@ -112,20 +112,20 @@ CastModeSet cast_modes = query_result_manager_.GetSupportedCastModes(); EXPECT_TRUE(cast_modes.empty()); std::vector<MediaSource> actual_sources = - query_result_manager_.GetSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.GetSourcesForCastMode(MediaCastMode::PRESENTATION); EXPECT_EQ(0u, actual_sources.size()); MediaSource source(MediaSourceForPresentationUrl(GURL("http://foo.com"))); EXPECT_CALL(mock_router_, RegisterMediaSinksObserver(_)) .WillOnce(Return(true)); - query_result_manager_.SetSourcesForCastMode(MediaCastMode::DEFAULT, {source}, - url::Origin(GURL(kOrigin))); + query_result_manager_.SetSourcesForCastMode( + MediaCastMode::PRESENTATION, {source}, url::Origin(GURL(kOrigin))); cast_modes = query_result_manager_.GetSupportedCastModes(); EXPECT_EQ(1u, cast_modes.size()); - EXPECT_TRUE(base::ContainsKey(cast_modes, MediaCastMode::DEFAULT)); + EXPECT_TRUE(base::ContainsKey(cast_modes, MediaCastMode::PRESENTATION)); actual_sources = - query_result_manager_.GetSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.GetSourcesForCastMode(MediaCastMode::PRESENTATION); EXPECT_EQ(1u, actual_sources.size()); EXPECT_EQ(source, actual_sources[0]); @@ -135,24 +135,25 @@ EXPECT_CALL(mock_router_, UnregisterMediaSinksObserver(_)).Times(1); EXPECT_CALL(mock_router_, RegisterMediaSinksObserver(_)) .WillOnce(Return(true)); - query_result_manager_.SetSourcesForCastMode( - MediaCastMode::DEFAULT, {another_source}, url::Origin(GURL(kOrigin))); + query_result_manager_.SetSourcesForCastMode(MediaCastMode::PRESENTATION, + {another_source}, + url::Origin(GURL(kOrigin))); cast_modes = query_result_manager_.GetSupportedCastModes(); EXPECT_EQ(1u, cast_modes.size()); - EXPECT_TRUE(base::ContainsKey(cast_modes, MediaCastMode::DEFAULT)); + EXPECT_TRUE(base::ContainsKey(cast_modes, MediaCastMode::PRESENTATION)); actual_sources = - query_result_manager_.GetSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.GetSourcesForCastMode(MediaCastMode::PRESENTATION); EXPECT_EQ(1u, actual_sources.size()); EXPECT_EQ(another_source, actual_sources[0]); EXPECT_CALL(mock_router_, UnregisterMediaSinksObserver(_)).Times(1); - query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::PRESENTATION); cast_modes = query_result_manager_.GetSupportedCastModes(); EXPECT_TRUE(cast_modes.empty()); actual_sources = - query_result_manager_.GetSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.GetSourcesForCastMode(MediaCastMode::PRESENTATION); EXPECT_EQ(0u, actual_sources.size()); } @@ -162,30 +163,30 @@ MediaSink sink3("sinkId3", "Sink 3", MediaSink::IconType::CAST); MediaSink sink4("sinkId4", "Sink 4", MediaSink::IconType::CAST); MediaSink sink5("sinkId5", "Sink 5", MediaSink::IconType::CAST); - MediaSource default_source1 = + MediaSource presentation_source1 = MediaSourceForPresentationUrl(GURL("http://bar.com")); - MediaSource default_source2 = + MediaSource presentation_source2 = MediaSourceForPresentationUrl(GURL("http://baz.com")); MediaSource tab_source = MediaSourceForTab(123); query_result_manager_.AddObserver(&mock_observer_); - DiscoverSinks(MediaCastMode::DEFAULT, default_source1); + DiscoverSinks(MediaCastMode::PRESENTATION, presentation_source1); DiscoverSinks(MediaCastMode::TAB_MIRROR, tab_source); // Scenario (results in this order): - // Action: DEFAULT -> [1, 2, 3] + // Action: PRESENTATION -> [1, 2, 3] // Expected result: - // Sinks: [1 -> {DEFAULT}, 2 -> {DEFAULT}, 3 -> {DEFAULT}] + // Sinks: [1 -> {PRESENTATION}, 2 -> {PRESENTATION}, 3 -> {PRESENTATION}] std::vector<MediaSinkWithCastModes> expected_sinks; expected_sinks.push_back(MediaSinkWithCastModes(sink1)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); expected_sinks.push_back(MediaSinkWithCastModes(sink2)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); expected_sinks.push_back(MediaSinkWithCastModes(sink3)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); const auto& sinks_observers = query_result_manager_.sinks_observers_; - auto sinks_observer_it = sinks_observers.find(default_source1); + auto sinks_observer_it = sinks_observers.find(presentation_source1); ASSERT_TRUE(sinks_observer_it != sinks_observers.end()); ASSERT_TRUE(sinks_observer_it->second.get()); @@ -200,16 +201,16 @@ // Action: TAB_MIRROR -> [2, 3, 4] // Expected result: - // Sinks: [1 -> {DEFAULT}, 2 -> {DEFAULT, TAB_MIRROR}, - // 3 -> {DEFAULT, TAB_MIRROR}, 4 -> {TAB_MIRROR}] + // Sinks: [1 -> {PRESENTATION}, 2 -> {PRESENTATION, TAB_MIRROR}, + // 3 -> {PRESENTATION, TAB_MIRROR}, 4 -> {TAB_MIRROR}] expected_sinks.clear(); expected_sinks.push_back(MediaSinkWithCastModes(sink1)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); expected_sinks.push_back(MediaSinkWithCastModes(sink2)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); expected_sinks.back().cast_modes.insert(MediaCastMode::TAB_MIRROR); expected_sinks.push_back(MediaSinkWithCastModes(sink3)); - expected_sinks.back().cast_modes.insert(MediaCastMode::DEFAULT); + expected_sinks.back().cast_modes.insert(MediaCastMode::PRESENTATION); expected_sinks.back().cast_modes.insert(MediaCastMode::TAB_MIRROR); expected_sinks.push_back(MediaSinkWithCastModes(sink4)); expected_sinks.back().cast_modes.insert(MediaCastMode::TAB_MIRROR); @@ -227,7 +228,7 @@ sinks_observer_it->second->OnSinksUpdated(sinks_query_result, {url::Origin(GURL(kOrigin))}); - // Action: Update default presentation URL + // Action: Update presentation URL // Expected result: // Sinks: [2 -> {TAB_MIRROR}, 3 -> {TAB_MIRROR}, 4 -> {TAB_MIRROR}] expected_sinks.clear(); @@ -245,15 +246,16 @@ .WillOnce(Return(true)); EXPECT_CALL(mock_observer_, OnResultsUpdated(VectorEquals(expected_sinks))).Times(1); - query_result_manager_.SetSourcesForCastMode( - MediaCastMode::DEFAULT, {default_source2}, url::Origin(GURL(kOrigin))); + query_result_manager_.SetSourcesForCastMode(MediaCastMode::PRESENTATION, + {presentation_source2}, + url::Origin(GURL(kOrigin))); - // Action: DEFAULT -> [1], origins don't match + // Action: PRESENTATION -> [1], origins don't match // Expected result: [2 -> {TAB_MIRROR}, 3 -> {TAB_MIRROR}, 4 -> {TAB_MIRROR}] // (No change) sinks_query_result.clear(); sinks_query_result.push_back(sink1); - sinks_observer_it = sinks_observers.find(default_source2); + sinks_observer_it = sinks_observers.find(presentation_source2); ASSERT_TRUE(sinks_observer_it != sinks_observers.end()); ASSERT_TRUE(sinks_observer_it->second.get()); EXPECT_CALL(mock_observer_, OnResultsUpdated(VectorEquals(expected_sinks))) @@ -270,7 +272,8 @@ EXPECT_CALL(mock_router_, UnregisterMediaSinksObserver(_)).Times(1); query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::TAB_MIRROR); - // Remaining observers: DEFAULT observer, which will be removed on destruction + // Remaining observers: PRESENTATION observer, which will be removed on + // destruction EXPECT_CALL(mock_router_, UnregisterMediaSinksObserver(_)).Times(1); } @@ -287,8 +290,8 @@ MediaSourceForPresentationUrl(GURL("http://urlC.com"))); const MediaSource source_tab(MediaSourceForTab(1)); // The sources are in decreasing order of priority. - const std::vector<MediaSource> default_sources = {source_a, source_b, - source_c}; + const std::vector<MediaSource> presentation_sources = {source_a, source_b, + source_c}; const std::vector<MediaSource> tab_sources = {source_tab}; const auto& sinks_observers = query_result_manager_.sinks_observers_; @@ -296,8 +299,9 @@ EXPECT_CALL(mock_router_, RegisterMediaSinksObserver(_)) .Times(4) .WillRepeatedly(Return(true)); - query_result_manager_.SetSourcesForCastMode( - MediaCastMode::DEFAULT, default_sources, url::Origin(GURL(kOrigin))); + query_result_manager_.SetSourcesForCastMode(MediaCastMode::PRESENTATION, + presentation_sources, + url::Origin(GURL(kOrigin))); query_result_manager_.SetSourcesForCastMode( MediaCastMode::TAB_MIRROR, tab_sources, url::Origin(GURL(kOrigin))); @@ -379,7 +383,7 @@ // The observers for the four sources should get unregistered. EXPECT_CALL(mock_router_, UnregisterMediaSinksObserver(_)).Times(4); - query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::DEFAULT); + query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::PRESENTATION); query_result_manager_.RemoveSourcesForCastMode(MediaCastMode::TAB_MIRROR); } @@ -390,18 +394,20 @@ EXPECT_CALL(mock_router_, RegisterMediaSinksObserver(_)) .Times(1) .WillRepeatedly(Return(true)); - query_result_manager_.SetSourcesForCastMode(MediaCastMode::DEFAULT, {source}, - url::Origin(GURL(kOrigin))); - // |source| has already been registered with the default cast mode, so it + query_result_manager_.SetSourcesForCastMode( + MediaCastMode::PRESENTATION, {source}, url::Origin(GURL(kOrigin))); + // |source| has already been registered with the PRESENTATION cast mode, so it // shouldn't get registered with tab mirroring. query_result_manager_.SetSourcesForCastMode( MediaCastMode::TAB_MIRROR, {source}, url::Origin(GURL(kOrigin))); const auto& cast_mode_sources = query_result_manager_.cast_mode_sources_; - const auto& default_sources = cast_mode_sources.at(MediaCastMode::DEFAULT); - EXPECT_TRUE(base::ContainsKey(cast_mode_sources, MediaCastMode::DEFAULT)); - EXPECT_EQ(default_sources.size(), 1u); - EXPECT_EQ(default_sources.at(0), source); + const auto& presentation_sources = + cast_mode_sources.at(MediaCastMode::PRESENTATION); + EXPECT_TRUE( + base::ContainsKey(cast_mode_sources, MediaCastMode::PRESENTATION)); + EXPECT_EQ(presentation_sources.size(), 1u); + EXPECT_EQ(presentation_sources.at(0), source); EXPECT_FALSE(base::ContainsKey(cast_mode_sources, MediaCastMode::TAB_MIRROR)); }
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index dd033679..2bfeed07 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc
@@ -380,6 +380,9 @@ const char kEnablePermissionActionReporting[] = "enable-permission-action-reporting"; +// Enables the picture in picture feature for videos. +const char kEnablePictureInPicture[] = "enable-picture-in-picture"; + // Enables a number of potentially annoying security features (strict mixed // content mode, powerful feature restrictions, etc.) const char kEnablePotentiallyAnnoyingSecurityFeatures[] = @@ -889,6 +892,9 @@ // Android authentication account type for SPNEGO authentication const char kAuthAndroidNegotiateAccountType[] = "auth-spnego-account-type"; +// Android authentication account type for SPNEGO authentication +const char kChromeHomeSwipeLogicType[] = "chrome-home-swipe-logic"; + // Disables Contextual Search. const char kDisableContextualSearch[] = "disable-contextual-search";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index beed96ef..b0ff6e6 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h
@@ -123,6 +123,7 @@ extern const char kEnableOfflineAutoReload[]; extern const char kEnableOfflineAutoReloadVisibleOnly[]; extern const char kEnablePermissionActionReporting[]; +extern const char kEnablePictureInPicture[]; extern const char kEnablePotentiallyAnnoyingSecurityFeatures[]; extern const char kEnablePowerOverlay[]; extern const char kEnablePrintPreviewRegisterPromos[]; @@ -254,6 +255,7 @@ #if defined(OS_ANDROID) extern const char kAuthAndroidNegotiateAccountType[]; +extern const char kChromeHomeSwipeLogicType[]; extern const char kDisableContextualSearch[]; extern const char kEnableAccessibilityTabSwitcher[]; extern const char kEnableContextualSearch[];
diff --git a/chrome/test/chromedriver/BUILD.gn b/chrome/test/chromedriver/BUILD.gn index f8de5fd8..5dad239 100644 --- a/chrome/test/chromedriver/BUILD.gn +++ b/chrome/test/chromedriver/BUILD.gn
@@ -9,7 +9,6 @@ script = "embed_js_in_cpp.py" js_files = [ - "js/add_cookie.js", "js/call_function.js", "js/execute_async_script.js", "js/focus.js",
diff --git a/chrome/test/chromedriver/js/add_cookie.js b/chrome/test/chromedriver/js/add_cookie.js deleted file mode 100644 index d2e7cb52..0000000 --- a/chrome/test/chromedriver/js/add_cookie.js +++ /dev/null
@@ -1,95 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** -* Test whether the given domain is valid for a cookie. -* -* @param {string} domain Domain for a cookie. -* @return {boolean} True if the domain is valid, otherwise false. -*/ -function isDomainValid(domain) { - var dummyCookie = 'ChromeDriverwjers908fljsdf37459fsdfgdfwru='; - - document.cookie = dummyCookie + '; domain=' + domain; - if (document.cookie.indexOf(dummyCookie) != -1) { - // Expire the dummy cookie if it is added successfully. - document.cookie = dummyCookie + '; Max-Age=0; domain=' + domain; - return true; - } - return false; -} - -/** -* Add the given cookie to the current web page. -* -* If path is not specified, default to '/'. -* If domain is not specified, default to document.domain, otherwise remove its -* port number. -* -* Validate name, value, domain and path of the cookie in the same way as the -* method CanonicalCookie::Create in src/net/cookies/canonical_cookie.cc. Besides -* the following requirements, name, value, domain and path of the cookie should -* not start or end with ' ' or '\t', and should not contain '\n', '\r', or '\0'. -* <ul> -* <li>name: no ';' or '=' -* <li>value: no ';' -* <li>path: starts with '/', no ';' -* </ul> -* -* @param {!Object} cookie An object representing a Cookie JSON Object as -* specified in https://code.google.com/p/selenium/wiki/JsonWireProtocol. -*/ -function addCookie(cookie) { - function isNameInvalid(value) { - return /(^[ \t])|([;=\n\r\0])|([ \t]$)/.test(value); - } - function isValueInvalid(value) { - return /(^[ \t])|([;\n\r\0])|([ \t]$)/.test(value); - } - function isPathInvalid(path) { - return path[0] != '/' || /([;\n\r\0])|([ \t]$)/.test(path); - } - - var name = cookie['name']; - if (!name || isNameInvalid(name)) - throw new Error('name of cookie is missing or invalid:"' + name + '"'); - - var value = cookie['value'] || ''; - if (isValueInvalid(value)) - throw new Error('value of cookie is invalid:"' + value + '"'); - - var domain = cookie['domain']; - // Remove the port number from domain. - if (domain) { - var domain_parts = domain.split(':'); - if (domain_parts.length > 2) - throw new Error('domain of cookie has too many colons'); - else if (domain_parts.length == 2) - domain = domain_parts[0]; - } - // Validate domain. - if (domain && (isValueInvalid(domain) || !isDomainValid(domain))) { - var error = new Error(); - error.code = 24; // Error code for InvalidCookieDomain. - error.message = 'invalid domain:"' + domain + '"'; - throw error; - } - - var path = cookie['path']; - if (path && isPathInvalid(path)) - throw new Error('path of cookie is invalid:"' + path + '"'); - - var newCookie = name + '=' + value; - newCookie += '; path=' + (path || '/'); - if (domain) - newCookie += '; domain=' + domain; - if (cookie['expiry']) { - var expiredDate = new Date(cookie['expiry'] * 1000); - newCookie += '; expires=' + expiredDate.toUTCString(); - } - if (cookie['secure']) - newCookie += '; secure'; - - document.cookie = newCookie; -}
diff --git a/chrome/test/chromedriver/js/add_cookie_test.html b/chrome/test/chromedriver/js/add_cookie_test.html deleted file mode 100644 index 85de0b3..0000000 --- a/chrome/test/chromedriver/js/add_cookie_test.html +++ /dev/null
@@ -1,127 +0,0 @@ -<!DOCTYPE HTML> -<html> -<script src='test.js'></script> -<script src='add_cookie.js'></script> -<script> - -// Run with --enable-file-cookies. - -/** -* Return the value of the cookie with the given name. -* -* If there are two or more cookies with the same name but in different domains -* or paths, return the one that appears first in document.cookie. -* If there is no such cookie, throw an error. -* -* @param {!string} name Name of the cookie. -* @return {string} The cookie value. -*/ -function getCookieValue(name) { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; ++i) { - var cookie = cookies[i].replace(/^\s+|\s+$/g, ''); - var cookieName = cookie.substr(0, cookie.indexOf('=')); - if (cookieName == name) - return unescape(cookie.substr(cookie.indexOf('=') + 1)); - } - throw new Error('cookie not found:' + name); -} - -/** -* Create and return a cookie object. The cookie follows the specification in -* https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object. -* -* The cookie has the following field value: -* <ul> -* <li>name: 'dummyname' + id -* <li>value: 'dummyvalue' + id -* <li>path: '/' -* <li>domain: document.domain -* <li>secure: false -* <li>expiry: three days after creation -* </ul> -* -* @param {!number} id The id to append to the name and value of the cookie. -* @return {*} An object representing a cookie. -*/ -function createDummyCookie(id) { - var cookie = {}; - cookie['name'] = 'dummyname' + id; - cookie['value'] = 'dummyvalue' + id; - cookie['path'] = '/'; - cookie['domain'] = document.domain; - var expiredDate = new Date(); - expiredDate.setDate(expiredDate.getDate() + 3); - cookie['expiry'] = parseInt(expiredDate.getTime() / 1000); - cookie['secure'] = false; - return cookie; -} - -function assertAddCookieFailed(cookie, code) { - try { - addCookie(cookie); - assert(false); - } catch (error) { - if (code) - assertEquals(code, error.code); - } -} - -function testMissingName() { - var cookie = createDummyCookie(1); - delete cookie['name']; - assertAddCookieFailed(cookie); -} - -function testInvalidName() { - var cookie = createDummyCookie(2); - var invalidNames = [ - '', ' a', '\ta', 'a ', 'a\t', 'a;b', 'a=b', 'a\nb', 'a\rb', 'a\0b' - ]; - for (var i = 0; i < invalidNames.length; i++) { - cookie['name'] = invalidNames[i]; - assertAddCookieFailed(cookie); - } -} - -function testDomainTooManyColons() { - var cookie = createDummyCookie(3); - cookie['domain'] = 'domain.name:1:2'; - assertAddCookieFailed(cookie); -} - -function testInvalidDomain() { - var cookie = createDummyCookie(4); - var invalidDomains = [ - ' a', '\ta', 'a ', 'a\t', 'a\nb', 'a\rb', 'a\0b', 'bad.domain' - ]; - for (var i = 0; i < invalidDomains.length; i++) { - cookie['domain'] = invalidDomains[i]; - assertAddCookieFailed(cookie, 24); - } -} - -function testMissingPath() { - var cookie = createDummyCookie(5); - delete cookie['path']; - addCookie(cookie); - assertEquals(cookie['value'], getCookieValue(cookie['name'])); -} - -function testMissingDomain() { - var cookie = createDummyCookie(6); - delete cookie['domain']; - addCookie(cookie); - assertEquals(cookie['value'], getCookieValue(cookie['name'])); -} - -function testNormal() { - var cookie = createDummyCookie(7); - addCookie(cookie); - assertEquals(cookie['value'], getCookieValue(cookie['name'])); -} - -</script> -<body> -</body> -</html>
diff --git a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js index ace4f1b..a35e538 100644 --- a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js +++ b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js
@@ -52,16 +52,16 @@ var fakeCastModeList = []; /** - * The list of CastModes to show with non-default modes only. + * The list of CastModes to show with non-PRESENTATION modes only. * @type {!Array<!media_router.CastMode>} */ - var fakeCastModeListWithNonDefaultModesOnly = []; + var fakeCastModeListWithNonPresentationModesOnly = []; /** - * The list of CastModes to show with default mode forced. + * The list of CastModes to show with PRESENTATION mode forced. * @type {!Array<!media_router.CastMode>} */ - var fakeCastModeListWithDefaultModeForced = []; + var fakeCastModeListWithPresentationModeForced = []; /** * The blocking issue to show. @@ -96,10 +96,10 @@ checkElementText = test_base.checkElementText; fakeBlockingIssue = test_base.fakeBlockingIssue; fakeCastModeList = test_base.fakeCastModeList; - fakeCastModeListWithNonDefaultModesOnly = - test_base.fakeCastModeListWithNonDefaultModesOnly; - fakeCastModeListWithDefaultModeForced = - test_base.fakeCastModeListWithDefaultModeForced; + fakeCastModeListWithNonPresentationModesOnly = + test_base.fakeCastModeListWithNonPresentationModesOnly; + fakeCastModeListWithPresentationModeForced = + test_base.fakeCastModeListWithPresentationModeForced; fakeNonBlockingIssue = test_base.fakeNonBlockingIssue; fakeSinkList = test_base.fakeSinkList; @@ -132,7 +132,7 @@ // Tests that |container| returns to SINK_LIST view and arrow drop icon // toggles after a cast mode is selected. test('select cast mode', function(done) { - container.castModeList = fakeCastModeListWithNonDefaultModesOnly; + container.castModeList = fakeCastModeListWithNonPresentationModesOnly; MockInteractions.tap(container.$['container-header']. $['arrow-drop-icon']); @@ -162,7 +162,7 @@ }); // Tests the header text. Choosing a cast mode updates the header text. - test('header text with no default cast modes', function(done) { + test('header text with cast mode selected', function(done) { assertEquals(loadTimeData.getString('selectCastModeHeaderText'), container.i18n('selectCastModeHeaderText')); @@ -173,7 +173,7 @@ container.headerText); assertFalse(container.userHasSelectedCastMode_); - container.castModeList = fakeCastModeListWithNonDefaultModesOnly; + container.castModeList = fakeCastModeListWithNonPresentationModesOnly; // Switch to cast mode list view. MockInteractions.tap(container.$['container-header']. @@ -181,15 +181,15 @@ setTimeout(function() { var castModeList = container.$$('#cast-mode-list').querySelectorAll('paper-item'); - assertEquals(fakeCastModeListWithNonDefaultModesOnly.length, + assertEquals(fakeCastModeListWithNonPresentationModesOnly.length, castModeList.length); for (var i = 0; i < castModeList.length; i++) { MockInteractions.tap(castModeList[i]); assertEquals( - fakeCastModeListWithNonDefaultModesOnly[i].description, + fakeCastModeListWithNonPresentationModesOnly[i].description, container.headerText); checkElementText( - fakeCastModeListWithNonDefaultModesOnly[i].description, + fakeCastModeListWithNonPresentationModesOnly[i].description, castModeList[i]); } @@ -198,8 +198,8 @@ }); // Tests the header text when updated with a cast mode list with a mix of - // default and non-default cast modes. - test('cast modes with one default mode', function(done) { + // PRESENTATION and non-PRESENTATION cast modes. + test('cast modes with one presentation mode', function(done) { container.castModeList = fakeCastModeList; // Switch to cast mode list view. @@ -212,7 +212,7 @@ for (var i = 0; i < fakeCastModeList.length; i++) { MockInteractions.tap(castModeList[i]); if (fakeCastModeList[i].type == - media_router.CastModeType.DEFAULT) { + media_router.CastModeType.PRESENTATION) { assertEquals(fakeCastModeList[i].description, container.headerText); @@ -343,11 +343,11 @@ media_router.SinkIconType.CAST, media_router.SinkStatus.ACTIVE, 0x2) ]; - container.castModeList = fakeCastModeListWithDefaultModeForced; + container.castModeList = fakeCastModeListWithPresentationModeForced; MockInteractions.tap(container.$['container-header']. $['arrow-drop-icon']); setTimeout(function() { - assertEquals(media_router.CastModeType.DEFAULT, + assertEquals(media_router.CastModeType.PRESENTATION, container.shownCastModeValue_); assertEquals('Cast google.com', container.headerText); assertFalse(container.userHasSelectedCastMode_); @@ -356,7 +356,8 @@ container.shadowRoot.getElementById('sink-list') .querySelectorAll('paper-item'); - // The sink list contains only sinks compatible with DEFAULT mode. + // The sink list contains only sinks compatible with PRESENTATION + // mode. assertEquals(2, sinkList.length); checkElementText('Sink 1', sinkList[0]); checkElementText('Sink 2', sinkList[1]);
diff --git a/chrome/test/data/webui/media_router/media_router_container_first_run_flow_tests.js b/chrome/test/data/webui/media_router/media_router_container_first_run_flow_tests.js index c1e8bb5..de223bc7 100644 --- a/chrome/test/data/webui/media_router/media_router_container_first_run_flow_tests.js +++ b/chrome/test/data/webui/media_router/media_router_container_first_run_flow_tests.js
@@ -41,10 +41,10 @@ var fakeCastModeList = []; /** - * The list of CastModes to show with non-default modes only. + * The list of CastModes to show with non-PRESENTATION modes only. * @type {!Array<!media_router.CastMode>} */ - var fakeCastModeListWithNonDefaultModesOnly = []; + var fakeCastModeListWithNonPresentationModesOnly = []; // Import media_router_container.html before running suite. suiteSetup(function() { @@ -65,8 +65,8 @@ checkElementsVisibleWithId = test_base.checkElementsVisibleWithId; checkElementVisibleWithId = test_base.checkElementVisibleWithId; fakeCastModeList = test_base.fakeCastModeList; - fakeCastModeListWithNonDefaultModesOnly = - test_base.fakeCastModeListWithNonDefaultModesOnly; + fakeCastModeListWithNonPresentationModesOnly = + test_base.fakeCastModeListWithNonPresentationModesOnly; container.castModeList = test_base.fakeCastModeList;
diff --git a/chrome/test/data/webui/media_router/media_router_container_test_base.js b/chrome/test/data/webui/media_router/media_router_container_test_base.js index 47e6165..18725f1 100644 --- a/chrome/test/data/webui/media_router/media_router_container_test_base.js +++ b/chrome/test/data/webui/media_router/media_router_container_test_base.js
@@ -91,20 +91,20 @@ ]; /** - * The list of CastModes to show with non-default modes only. + * The list of CastModes to show with non-PRESENTATION modes only. * @type {!Array<!media_router.CastMode>} */ - var fakeCastModeListWithNonDefaultModesOnly = [ + var fakeCastModeListWithNonPresentationModesOnly = [ new media_router.CastMode(0x2, 'Description 1', null, false), new media_router.CastMode(0x4, 'Description 2', null, false), new media_router.CastMode(0x8, 'Description 3', null, false), ]; /** - * The list of CastModes to show with DEFAULT forced. + * The list of CastModes to show with PRESENTATION forced. * @type {!Array<!media_router.CastMode>} */ - var fakeCastModeListWithDefaultModeForced = [ + var fakeCastModeListWithPresentationModeForced = [ new media_router.CastMode(0x1, 'Cast google.com', 'google.com', true), new media_router.CastMode(0x4, 'Description 2', null, false), new media_router.CastMode(0x8, 'Description 3', null, false), @@ -198,10 +198,10 @@ checkElementText: checkElementText, fakeBlockingIssue: fakeBlockingIssue, fakeCastModeList: fakeCastModeList, - fakeCastModeListWithNonDefaultModesOnly: - fakeCastModeListWithNonDefaultModesOnly, - fakeCastModeListWithDefaultModeForced: - fakeCastModeListWithDefaultModeForced, + fakeCastModeListWithNonPresentationModesOnly: + fakeCastModeListWithNonPresentationModesOnly, + fakeCastModeListWithPresentationModeForced: + fakeCastModeListWithPresentationModeForced, fakeNonBlockingIssue: fakeNonBlockingIssue, fakeRouteList: fakeRouteList, fakeRouteListWithLocalRoutesOnly: fakeRouteListWithLocalRoutesOnly,
diff --git a/components/arc/common/metrics.mojom b/components/arc/common/metrics.mojom index cb2e936..d1c997a 100644 --- a/components/arc/common/metrics.mojom +++ b/components/arc/common/metrics.mojom
@@ -1,9 +1,25 @@ // 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. +// Next MinVersion: 2 module arc.mojom; +[Extensible] +enum BootType { + // This is used only for backward compatibility reasons and the value has to + // be 0. + UNKNOWN = 0, + + // This is for the very first (opt-in) boot. + FIRST_BOOT = 1, + // This is for the first boot after Chrome OS update which also updates the + // ARC image. + FIRST_BOOT_AFTER_UPDATE = 2, + // This is for a regular boot. + REGULAR_BOOT = 3, +}; + // Describes a boot progress event. struct BootProgressEvent { // Name of the boot progress event in Android. Currently there are @@ -23,11 +39,14 @@ int64 uptimeMillis; }; +// Next method ID: 1 interface MetricsHost { // Report boot progress events from ARC instance. - ReportBootProgress@0(array<BootProgressEvent> events); + ReportBootProgress@0(array<BootProgressEvent> events, + [MinVersion=1] BootType boot_type); }; +// Next method ID: 1 interface MetricsInstance { Init@0(MetricsHost host_ptr); };
diff --git a/components/arc/metrics/arc_metrics_service.cc b/components/arc/metrics/arc_metrics_service.cc index 2f391c5..52867ee 100644 --- a/components/arc/metrics/arc_metrics_service.cc +++ b/components/arc/metrics/arc_metrics_service.cc
@@ -8,23 +8,43 @@ #include <utility> #include "base/logging.h" +#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager_client.h" #include "components/arc/arc_bridge_service.h" +namespace arc { + namespace { -const int kRequestProcessListPeriodInMinutes = 5; -const char kArcProcessNamePrefix[] = "org.chromium.arc."; -const char kGmsProcessNamePrefix[] = "com.google.android.gms"; -const char kBootProgressEnableScreen[] = "boot_progress_enable_screen"; +constexpr base::TimeDelta kUmaMinTime = base::TimeDelta::FromMilliseconds(1); +constexpr int kUmaNumBuckets = 50; + +constexpr base::TimeDelta kRequestProcessListPeriod = + base::TimeDelta::FromMinutes(5); +constexpr char kArcProcessNamePrefix[] = "org.chromium.arc."; +constexpr char kGmsProcessNamePrefix[] = "com.google.android.gms"; +constexpr char kBootProgressEnableScreen[] = "boot_progress_enable_screen"; + +std::string BootTypeToString(mojom::BootType boot_type) { + switch (boot_type) { + case mojom::BootType::UNKNOWN: + return ""; // for backward compatibility. + case mojom::BootType::FIRST_BOOT: + return ".FirstBoot"; + case mojom::BootType::FIRST_BOOT_AFTER_UPDATE: + return ".FirstBootAfterUpdate"; + case mojom::BootType::REGULAR_BOOT: + return ".RegularBoot"; + } + NOTREACHED(); + return ""; +} } // namespace -namespace arc { - ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) : ArcService(bridge_service), binding_(this), @@ -64,9 +84,8 @@ void ArcMetricsService::OnProcessInstanceReady() { VLOG(2) << "Start updating process list."; - timer_.Start(FROM_HERE, - base::TimeDelta::FromMinutes(kRequestProcessListPeriodInMinutes), - this, &ArcMetricsService::RequestProcessList); + timer_.Start(FROM_HERE, kRequestProcessListPeriod, this, + &ArcMetricsService::RequestProcessList); } void ArcMetricsService::OnProcessInstanceClosed() { @@ -136,26 +155,30 @@ } void ArcMetricsService::ReportBootProgress( - std::vector<mojom::BootProgressEventPtr> events) { + std::vector<mojom::BootProgressEventPtr> events, + mojom::BootType boot_type) { DCHECK(CalledOnValidThread()); + // TODO(yusukes): Return immediately with with LOG(ERROR) when |boot_type| is + // UNKNOWN. Once the container is updated, we'll never see the boot type. int64_t arc_start_time_in_ms = (arc_start_time_ - base::TimeTicks()).InMilliseconds(); + const std::string suffix = BootTypeToString(boot_type); + // TODO(yusukes): Define kUmaMaxTime and always use 60s. + const base::TimeDelta max_time = base::TimeDelta::FromSeconds( + boot_type == mojom::BootType::UNKNOWN ? 30 : 60); for (const auto& event : events) { VLOG(2) << "Report boot progress event:" << event->event << "@" << event->uptimeMillis; - std::string title = "Arc." + event->event; - base::TimeDelta elapsed_time = base::TimeDelta::FromMilliseconds( + const std::string name = "Arc." + event->event + suffix; + const base::TimeDelta elapsed_time = base::TimeDelta::FromMilliseconds( event->uptimeMillis - arc_start_time_in_ms); - // Note: This leaks memory, which is expected behavior. - base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( - title, base::TimeDelta::FromMilliseconds(1), - base::TimeDelta::FromSeconds(30), 50, - base::HistogramBase::kUmaTargetedHistogramFlag); - histogram->AddTime(elapsed_time); - if (event->event.compare(kBootProgressEnableScreen) == 0) - UMA_HISTOGRAM_CUSTOM_TIMES("Arc.AndroidBootTime", elapsed_time, - base::TimeDelta::FromMilliseconds(1), - base::TimeDelta::FromSeconds(30), 50); + base::UmaHistogramCustomTimes(name, elapsed_time, kUmaMinTime, max_time, + kUmaNumBuckets); + if (event->event.compare(kBootProgressEnableScreen) == 0) { + base::UmaHistogramCustomTimes("Arc.AndroidBootTime" + suffix, + elapsed_time, kUmaMinTime, max_time, + kUmaNumBuckets); + } } }
diff --git a/components/arc/metrics/arc_metrics_service.h b/components/arc/metrics/arc_metrics_service.h index df59122..5395ddd 100644 --- a/components/arc/metrics/arc_metrics_service.h +++ b/components/arc/metrics/arc_metrics_service.h
@@ -39,8 +39,8 @@ void OnProcessInstanceClosed(); // MetricsHost overrides. - void ReportBootProgress( - std::vector<mojom::BootProgressEventPtr> events) override; + void ReportBootProgress(std::vector<mojom::BootProgressEventPtr> events, + mojom::BootType boot_type) override; private: bool CalledOnValidThread();
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobService.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobService.java index cf86dda..4a19907 100644 --- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobService.java +++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerJobService.java
@@ -18,6 +18,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; +import java.util.List; /** * An implementation of {@link BackgroundTaskSchedulerDelegate} that uses the system * {@link JobScheduler} to schedule jobs. @@ -141,8 +142,8 @@ JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); - if (taskInfo.shouldUpdateCurrent()) { - jobScheduler.cancel(taskInfo.getTaskId()); + if (!taskInfo.shouldUpdateCurrent() && hasPendingJob(jobScheduler, taskInfo.getTaskId())) { + return true; } int result = jobScheduler.schedule(jobInfo); @@ -156,4 +157,13 @@ (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); jobScheduler.cancel(taskId); } + + private boolean hasPendingJob(JobScheduler jobScheduler, int jobId) { + List<JobInfo> pendingJobs = jobScheduler.getAllPendingJobs(); + for (JobInfo pendingJob : pendingJobs) { + if (pendingJob.getId() == jobId) return true; + } + + return false; + } }
diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn index 716fa0b..8b8f4b1 100644 --- a/components/cronet/ios/BUILD.gn +++ b/components/cronet/ios/BUILD.gn
@@ -32,34 +32,61 @@ ] } -source_set("cronet_sources") { - deps = [ - ":cronet_version_header", - ":generate_accept_languages", - "//base:base", - "//components/grpc_support", - "//components/metrics:metrics", - "//components/metrics/proto:proto", - "//components/prefs:prefs", - "//ios/net:net", - "//ios/web:user_agent", - "//net", - "//url", - ] +config("cronet_include_config") { + include_dirs = [ "//components/grpc_support/include" ] +} - sources = [ - "../histogram_manager.cc", - "../histogram_manager.h", - "../stale_host_resolver.cc", - "../stale_host_resolver.h", - "../url_request_context_config.cc", - "../url_request_context_config.h", - "Cronet.h", - "Cronet.mm", - "cronet_c_for_grpc.h", - "cronet_environment.h", - "cronet_environment.mm", +config("cronet_static_config") { + libs = [ + "Cronet.framework", + "UIKit.Framework", + "CFNetwork.framework", + "MobileCoreServices.framework", + "Security.framework", + "SystemConfiguration.framework", + "resolv", ] + configs = [ ":cronet_include_config" ] +} + +_cronet_deps = [ + ":cronet_version_header", + ":generate_accept_languages", + "//base:base", + "//components/grpc_support", + "//components/metrics:metrics", + "//components/metrics/proto:proto", + "//components/prefs:prefs", + "//ios/net:net", + "//ios/web:user_agent", + "//net", + "//url", +] + +_cronet_sources = [ + "../histogram_manager.cc", + "../histogram_manager.h", + "../stale_host_resolver.cc", + "../stale_host_resolver.h", + "../url_request_context_config.cc", + "../url_request_context_config.h", + "Cronet.h", + "Cronet.mm", + "cronet_c_for_grpc.h", + "cronet_environment.h", + "cronet_environment.mm", +] + +_cronet_public_headers = [ + "Cronet.h", + "cronet_c_for_grpc.h", +] +_cronet_public_headers += grpc_public_headers + +source_set("cronet_sources") { + deps = _cronet_deps + + sources = _cronet_sources include_dirs = [ "//components/grpc_support/include" ] @@ -85,17 +112,11 @@ libs = [ "UIKit.Framework" ] - include_dirs = [ "//components/grpc_support/include" ] - public_deps = [ "//components/grpc_support", ] - public_headers = [ - "Cronet.h", - "cronet_c_for_grpc.h", - ] - public_headers += grpc_public_headers + public_headers = _cronet_public_headers sources = [ "Cronet.h", @@ -103,6 +124,8 @@ configs -= [ "//build/config/compiler:default_symbols" ] configs += [ "//build/config/compiler:symbols" ] + + public_configs = [ ":cronet_include_config" ] } test("cronet_unittests") { @@ -137,6 +160,131 @@ ] } +# A static library which contains just _cronet_sources. +static_library("cronet_static") { + visibility = [ ":*" ] + deps = _cronet_deps + sources = _cronet_sources + public_configs = [ ":cronet_include_config" ] + public_deps = [ + "//components/grpc_support", + ] +} + +# A static library which contains all dependencies of :cronet_static. +static_library("cronet_deps_complete") { + visibility = [ ":*" ] + complete_static_lib = true + deps = [ + ":cronet_static", + ] +} + +# A static library which contains cronet and all dependendencies hidden inside. +action("cronet_static_complete") { + visibility = [ ":*" ] + script = "//components/cronet/tools/hide_symbols.py" + deps = [ + ":cronet_deps_complete", + ":cronet_static", + ] + outputs = [ + "$target_out_dir/$current_cpu/cronet_static_complete.a", + ] + args = [ + "--input_libs", + rebase_path("$target_out_dir/libcronet_static.a", root_build_dir), + "--deps_lib", + rebase_path("$target_out_dir/libcronet_deps_complete.a", root_build_dir), + "--output_obj", + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.o", + root_build_dir), + "--output_lib", + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.a", + root_build_dir), + "--current_cpu", + current_cpu, + ] + + public_configs = [ ":cronet_static_config" ] +} + +# A fat static library which exports cronet public symbols and hides all dependendencies. +lipo_binary("libcronet") { + arch_binary_target = ":cronet_static_complete" + arch_binary_output = "cronet_static_complete.a" + output_name = "libcronet.a" + enable_stripping = false + enable_dsyms = false +} + +template("ios_static_framework") { + _target_name = target_name + _output_name = target_name + if (defined(invoker.output_name)) { + _output_name = invoker.output_name + } + _framework_name = target_name + if (defined(invoker.framework_name)) { + _framework_name = invoker.framework_name + } + + _bundle_target_name = _target_name + "_bundle" + _framework_headers_target = _target_name + "_framework_headers" + bundle_data(_framework_headers_target) { + visibility = [ ":$_bundle_target_name" ] + sources = invoker.public_headers + outputs = [ + "{{bundle_root_dir}}/Headers/{{source_file_part}}", + ] + } + + _framework_binary_target = _target_name + "_framework_binary" + _static_library_target = invoker.static_library_target + + bundle_data(_framework_binary_target) { + visibility = [ ":$_bundle_target_name" ] + sources = get_target_outputs(_static_library_target) + outputs = [ + "{{bundle_root_dir}}/$_framework_name", + ] + public_deps = [ + _static_library_target, + ] + } + + create_bundle(_bundle_target_name) { + product_type = "com.apple.product-type.framework" + bundle_root_dir = "$root_out_dir/Static/$_output_name" + bundle_executable_dir = bundle_root_dir + bundle_resources_dir = bundle_root_dir + bundle_plugins_dir = bundle_root_dir + deps = [ + ":$_framework_binary_target", + ":$_framework_headers_target", + ] + } + + action(_target_name) { + script = "//components/cronet/tools/dummy.py" + outputs = [ + "$root_out_dir/Static/$_output_name", + ] + deps = [ + ":$_bundle_target_name", + ] + public_configs = invoker.public_configs + } +} + +ios_static_framework("cronet_static_framework") { + output_name = "Cronet.framework" + framework_name = "Cronet" + public_headers = _cronet_public_headers + static_library_target = ":libcronet" + public_configs = [ ":cronet_static_config" ] +} + if (additional_toolchains == [] || current_toolchain == default_toolchain) { _package_dir = "$root_out_dir/cronet" @@ -160,6 +308,19 @@ ] } + copy("cronet_static_copy") { + sources = [ + "$root_out_dir/Static/Cronet.framework", + ] + outputs = [ + "$_package_dir/Static/Cronet.framework", + ] + + deps = [ + ":cronet_static_framework", + ] + } + copy("cronet_package_copy") { sources = [ "$root_out_dir/Cronet.framework", @@ -172,6 +333,7 @@ deps = [ ":cronet_framework", + ":cronet_static_copy", ] }
diff --git a/components/cronet/ios/cronet_consumer/BUILD.gn b/components/cronet/ios/cronet_consumer/BUILD.gn index 966057c..219318c 100644 --- a/components/cronet/ios/cronet_consumer/BUILD.gn +++ b/components/cronet/ios/cronet_consumer/BUILD.gn
@@ -3,28 +3,61 @@ # found in the LICENSE file. import("//build/config/ios/rules.gni") +import("//ios/features.gni") -ios_app_bundle("cronet_consumer") { - info_plist = "cronet-consumer-Info.plist" +template("cronet_consumer_template") { + _target_name = target_name + ios_app_bundle(_target_name) { + info_plist = "cronet-consumer-Info.plist" + + deps = [ + "//base:base", + ] + + deps += invoker.deps + + sources = [ + "cronet_consumer_app_delegate.h", + "cronet_consumer_app_delegate.mm", + "cronet_consumer_view_controller.h", + "cronet_consumer_view_controller.m", + "main.mm", + ] + + forward_variables_from(invoker, + [ + "bundle_deps", + "cflags", + "ldflags", + ]) + + configs += [ "//build/config/compiler:enable_arc" ] + } +} + +cronet_consumer_template("cronet_consumer") { deps = [ - "//base:base", "//components/cronet/ios:cronet_framework+link", - - # All shared libraries must have the sanitizer deps to properly link in - # asan mode (this target will be empty in other cases). - "//build/config:exe_and_shlib_deps", ] - - sources = [ - "cronet_consumer_app_delegate.h", - "cronet_consumer_app_delegate.mm", - "cronet_consumer_view_controller.h", - "cronet_consumer_view_controller.m", - "main.mm", - ] - bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ] +} - configs += [ "//build/config/compiler:enable_arc" ] +# TODO(mef): Figure out why CronetConsumerStatic breaks build on non-Cronet builders. +if (is_cronet_build) { + cronet_consumer_template("cronet_consumer_static") { + deps = [ + "//components/cronet/ios:cronet_static_framework", + ] + + cflags = [ + "-F", + "Static", + ] + + ldflags = [ + "-F", + "Static", + ] + } }
diff --git a/components/cronet/tools/dummy.py b/components/cronet/tools/dummy.py new file mode 100755 index 0000000..a216b12 --- /dev/null +++ b/components/cronet/tools/dummy.py
@@ -0,0 +1,7 @@ +#!/usr/bin/python +# 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. + +"""Provides empty action to expose static framwork output from subdirectory. +"""
diff --git a/components/cronet/tools/hide_symbols.py b/components/cronet/tools/hide_symbols.py new file mode 100755 index 0000000..55e7fb8 --- /dev/null +++ b/components/cronet/tools/hide_symbols.py
@@ -0,0 +1,101 @@ +#!/usr/bin/env python + +# 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. + +# Create a static library which exposes only symbols which are explicitly marked +# as visible e.g., by __attribute__((visibility("default"))). +# +# See BUILD.gn in this directory for usage example. +# +# This way, we can reduce risk of symbol conflict when linking it into apps +# by exposing internal symbols, especially in third-party libraries. + +import optparse +import os +import subprocess + + +# Mapping from GN's target_cpu attribute to ld's -arch parameter. +# Taken from the definition of config("compiler") in: +# //build/config/mac/BUILD.gn +GN_CPU_TO_LD_ARCH = { + 'x64': 'x86_64', + 'x86': 'i386', + 'armv7': 'armv7', + 'arm': 'armv7', + 'arm64': 'arm64', +} + + +def main(): + parser = optparse.OptionParser() + parser.add_option( + '--input_libs', + help='Comma-separated paths to input .a files which contain symbols ' + 'which must be always linked.') + parser.add_option( + '--deps_lib', + help='The path to a complete static library (.a file) which contains all ' + 'dependencies of --input_libs. .o files in this library are also ' + 'added to the output library, but only if they are referred from ' + '--input_libs.') + parser.add_option( + '--output_obj', + help='Outputs the generated .o file here. This is an intermediate file.') + parser.add_option( + '--output_lib', + help='Outputs the generated .a file here.') + parser.add_option( + '--current_cpu', + help='The current processor architecture in the format of the target_cpu ' + 'attribute in GN.') + (options, args) = parser.parse_args() + assert not args + + # ld -r concatenates multiple .o files and .a files into a single .o file, + # while "hiding" symbols not marked as visible. + command = [ + 'xcrun', 'ld', + '-arch', GN_CPU_TO_LD_ARCH[options.current_cpu], + '-r', + ] + for input_lib in options.input_libs.split(','): + # By default, ld only pulls .o files out of a static library if needed to + # resolve some symbol reference. We apply -force_load option to input_lib + # (but not to deps_lib) to force pulling all .o files. + command += ['-force_load', input_lib] + command += [ + options.deps_lib, + '-o', options.output_obj + ] + try: + subprocess.check_call(command) + except subprocess.CalledProcessError: + # Work around LD failure for x86 Debug buiilds when it fails with error: + # ld: scattered reloc r_address too large for architecture i386 + if options.current_cpu == "x86": + # Combmine input lib with dependencies into output lib. + command = [ + 'xcrun', 'libtool', '-static', '-no_warning_for_no_symbols', + '-o', options.output_lib, + options.input_libs, options.deps_lib, + ] + subprocess.check_call(command) + return + + if os.path.exists(options.output_lib): + os.remove(options.output_lib) + + # Creates a .a file which contains a single .o file. + command = [ + 'xcrun', 'ar', '-r', + options.output_lib, + options.output_obj, + ] + subprocess.check_call(command) + + +if __name__ == "__main__": + main()
diff --git a/components/cronet/tools/package_ios.py b/components/cronet/tools/package_ios.py index 956d545..6fd3220 100755 --- a/components/cronet/tools/package_ios.py +++ b/components/cronet/tools/package_ios.py
@@ -117,10 +117,13 @@ # Copy framework. shutil.copytree(os.path.join(build_dir, 'Cronet.framework'), - os.path.join(out_dir, target_dir, 'Cronet.framework')) + os.path.join(out_dir, 'Dynamic', target_dir, 'Cronet.framework')) # Copy symbols. shutil.copytree(os.path.join(build_dir, 'Cronet.dSYM'), - os.path.join(out_dir, target_dir, 'Cronet.framework.dSYM')) + os.path.join(out_dir, 'Dynamic', target_dir, 'Cronet.framework.dSYM')) + # Copy static framework. + shutil.copytree(os.path.join(build_dir, 'Static', 'Cronet.framework'), + os.path.join(out_dir, 'Static', target_dir, 'Cronet.framework')) # Copy common files from last built package. package_dir = os.path.join(build_dir, 'cronet') @@ -131,7 +134,7 @@ shutil.copytree(os.path.join(build_dir, 'Cronet.framework', 'Headers'), os.path.join(out_dir, 'Headers')) - print 'Cronet dynamic framework is packaged into %s' % out_dir + print 'Cronet framework is packaged into %s' % out_dir def main():
diff --git a/components/exo/keyboard.cc b/components/exo/keyboard.cc index 5359c84..fd261e1 100644 --- a/components/exo/keyboard.cc +++ b/components/exo/keyboard.cc
@@ -75,8 +75,8 @@ } bool IsPhysicalKeyboardEnabled() { - // The internal keyboard is enabled if tablet mode is not enabled. - if (!WMHelper::GetInstance()->IsTabletModeWindowManagerEnabled()) + // The internal keyboard is enabled if maximize mode is not enabled. + if (!WMHelper::GetInstance()->IsMaximizeModeWindowManagerEnabled()) return true; for (auto& keyboard : @@ -96,7 +96,7 @@ auto* helper = WMHelper::GetInstance(); helper->AddPostTargetHandler(this); helper->AddFocusObserver(this); - helper->AddTabletModeObserver(this); + helper->AddMaximizeModeObserver(this); helper->AddInputDeviceEventObserver(this); OnWindowFocused(helper->GetFocusedWindow(), nullptr); } @@ -110,7 +110,7 @@ auto* helper = WMHelper::GetInstance(); helper->RemoveFocusObserver(this); helper->RemovePostTargetHandler(this); - helper->RemoveTabletModeObserver(this); + helper->RemoveMaximizeModeObserver(this); helper->RemoveInputDeviceEventObserver(this); } @@ -215,15 +215,15 @@ } //////////////////////////////////////////////////////////////////////////////// -// WMHelper::TabletModeObserver overrides: +// WMHelper::MaximizeModeObserver overrides: -void Keyboard::OnTabletModeStarted() { +void Keyboard::OnMaximizeModeStarted() { OnKeyboardDeviceConfigurationChanged(); } -void Keyboard::OnTabletModeEnding() {} +void Keyboard::OnMaximizeModeEnding() {} -void Keyboard::OnTabletModeEnded() { +void Keyboard::OnMaximizeModeEnded() { OnKeyboardDeviceConfigurationChanged(); }
diff --git a/components/exo/keyboard.h b/components/exo/keyboard.h index 1232d5c..98c4a4a 100644 --- a/components/exo/keyboard.h +++ b/components/exo/keyboard.h
@@ -27,7 +27,7 @@ class Keyboard : public ui::EventHandler, public WMHelper::FocusObserver, public WMHelper::InputDeviceEventObserver, - public WMHelper::TabletModeObserver, + public WMHelper::MaximizeModeObserver, public SurfaceObserver { public: explicit Keyboard(KeyboardDelegate* delegate); @@ -50,10 +50,10 @@ // Overridden from ui::InputDeviceEventObserver: void OnKeyboardDeviceConfigurationChanged() override; - // Overridden from WMHelper::TabletModeObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnding() override; - void OnTabletModeEnded() override; + // Overridden from WMHelper::MaximizeModeObserver: + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnding() override; + void OnMaximizeModeEnded() override; private: // Returns the effective focus for |window|.
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc index 55662e9..2f4234a 100644 --- a/components/exo/shell_surface.cc +++ b/components/exo/shell_surface.cc
@@ -1530,7 +1530,7 @@ // Enable the black backdrop layer behind the window if the window // is in immersive fullscreen, maximized, yet the window can control - // the bounds of the window in fullscreen/tablet mode (thus the + // the bounds of the window in fullscreen/maximize mode (thus the // background can be visible). bool enable_backdrop = (widget_->IsFullscreen() || widget_->IsMaximized()) &&
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc index d3e470e..e541591d 100644 --- a/components/exo/wayland/server.cc +++ b/components/exo/wayland/server.cc
@@ -2068,7 +2068,7 @@ // Implements remote shell interface and monitors workspace state needed // for the remote shell interface. -class WaylandRemoteShell : public WMHelper::TabletModeObserver, +class WaylandRemoteShell : public WMHelper::MaximizeModeObserver, public WMHelper::ActivationObserver, public display::DisplayObserver { public: @@ -2077,11 +2077,11 @@ remote_shell_resource_(remote_shell_resource), weak_ptr_factory_(this) { auto* helper = WMHelper::GetInstance(); - helper->AddTabletModeObserver(this); + helper->AddMaximizeModeObserver(this); helper->AddActivationObserver(this); display::Screen::GetScreen()->AddObserver(this); - layout_mode_ = helper->IsTabletModeWindowManagerEnabled() + layout_mode_ = helper->IsMaximizeModeWindowManagerEnabled() ? ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET : ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED; @@ -2090,7 +2090,7 @@ } ~WaylandRemoteShell() override { auto* helper = WMHelper::GetInstance(); - helper->RemoveTabletModeObserver(this); + helper->RemoveMaximizeModeObserver(this); helper->RemoveActivationObserver(this); display::Screen::GetScreen()->RemoveObserver(this); } @@ -2137,16 +2137,16 @@ } } - // Overridden from WMHelper::TabletModeObserver: - void OnTabletModeStarted() override { + // Overridden from WMHelper::MaximizeModeObserver: + void OnMaximizeModeStarted() override { layout_mode_ = ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET; ScheduleSendDisplayMetrics(kConfigureDelayAfterLayoutSwitchMs); } - void OnTabletModeEnding() override { + void OnMaximizeModeEnding() override { layout_mode_ = ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED; ScheduleSendDisplayMetrics(kConfigureDelayAfterLayoutSwitchMs); } - void OnTabletModeEnded() override {} + void OnMaximizeModeEnded() override {} // Overridden from WMHelper::ActivationObserver: void OnWindowActivated(aura::Window* gained_active,
diff --git a/components/exo/wm_helper.cc b/components/exo/wm_helper.cc index c0db73c..46faffd 100644 --- a/components/exo/wm_helper.cc +++ b/components/exo/wm_helper.cc
@@ -54,12 +54,12 @@ cursor_observers_.RemoveObserver(observer); } -void WMHelper::AddTabletModeObserver(TabletModeObserver* observer) { - tablet_mode_observers_.AddObserver(observer); +void WMHelper::AddMaximizeModeObserver(MaximizeModeObserver* observer) { + maximize_mode_observers_.AddObserver(observer); } -void WMHelper::RemoveTabletModeObserver(TabletModeObserver* observer) { - tablet_mode_observers_.RemoveObserver(observer); +void WMHelper::RemoveMaximizeModeObserver(MaximizeModeObserver* observer) { + maximize_mode_observers_.RemoveObserver(observer); } void WMHelper::AddInputDeviceEventObserver(InputDeviceEventObserver* observer) { @@ -103,19 +103,19 @@ observer.OnCursorSetChanged(cursor_set); } -void WMHelper::NotifyTabletModeStarted() { - for (TabletModeObserver& observer : tablet_mode_observers_) - observer.OnTabletModeStarted(); +void WMHelper::NotifyMaximizeModeStarted() { + for (MaximizeModeObserver& observer : maximize_mode_observers_) + observer.OnMaximizeModeStarted(); } -void WMHelper::NotifyTabletModeEnding() { - for (TabletModeObserver& observer : tablet_mode_observers_) - observer.OnTabletModeEnding(); +void WMHelper::NotifyMaximizeModeEnding() { + for (MaximizeModeObserver& observer : maximize_mode_observers_) + observer.OnMaximizeModeEnding(); } -void WMHelper::NotifyTabletModeEnded() { - for (TabletModeObserver& observer : tablet_mode_observers_) - observer.OnTabletModeEnded(); +void WMHelper::NotifyMaximizeModeEnded() { + for (MaximizeModeObserver& observer : maximize_mode_observers_) + observer.OnMaximizeModeEnded(); } void WMHelper::NotifyKeyboardDeviceConfigurationChanged() {
diff --git a/components/exo/wm_helper.h b/components/exo/wm_helper.h index 49a53b8c..84245f6b 100644 --- a/components/exo/wm_helper.h +++ b/components/exo/wm_helper.h
@@ -53,14 +53,14 @@ virtual ~CursorObserver() {} }; - class TabletModeObserver { + class MaximizeModeObserver { public: - virtual void OnTabletModeStarted() = 0; - virtual void OnTabletModeEnding() = 0; - virtual void OnTabletModeEnded() = 0; + virtual void OnMaximizeModeStarted() = 0; + virtual void OnMaximizeModeEnding() = 0; + virtual void OnMaximizeModeEnded() = 0; protected: - virtual ~TabletModeObserver() {} + virtual ~MaximizeModeObserver() {} }; class InputDeviceEventObserver { @@ -90,8 +90,8 @@ void RemoveFocusObserver(FocusObserver* observer); void AddCursorObserver(CursorObserver* observer); void RemoveCursorObserver(CursorObserver* observer); - void AddTabletModeObserver(TabletModeObserver* observer); - void RemoveTabletModeObserver(TabletModeObserver* observer); + void AddMaximizeModeObserver(MaximizeModeObserver* observer); + void RemoveMaximizeModeObserver(MaximizeModeObserver* observer); void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); void AddDisplayConfigurationObserver(DisplayConfigurationObserver* observer); @@ -109,7 +109,7 @@ virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; - virtual bool IsTabletModeWindowManagerEnabled() const = 0; + virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; protected: WMHelper(); @@ -120,9 +120,9 @@ aura::Window* lost_focus); void NotifyCursorVisibilityChanged(bool is_visible); void NotifyCursorSetChanged(ui::CursorSetType cursor_set); - void NotifyTabletModeStarted(); - void NotifyTabletModeEnding(); - void NotifyTabletModeEnded(); + void NotifyMaximizeModeStarted(); + void NotifyMaximizeModeEnding(); + void NotifyMaximizeModeEnded(); void NotifyKeyboardDeviceConfigurationChanged(); void NotifyDisplayConfigurationChanged(); @@ -130,7 +130,7 @@ base::ObserverList<ActivationObserver> activation_observers_; base::ObserverList<FocusObserver> focus_observers_; base::ObserverList<CursorObserver> cursor_observers_; - base::ObserverList<TabletModeObserver> tablet_mode_observers_; + base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; base::ObserverList<DisplayConfigurationObserver> display_config_observers_;
diff --git a/components/exo/wm_helper_ash.cc b/components/exo/wm_helper_ash.cc index 47b4507..e4b96bf 100644 --- a/components/exo/wm_helper_ash.cc +++ b/components/exo/wm_helper_ash.cc
@@ -8,7 +8,7 @@ #include "ash/shell.h" #include "ash/shell_port.h" #include "ash/system/tray/system_tray_notifier.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "ash/wm/maximize_mode/maximize_mode_controller.h" #include "base/memory/singleton.h" #include "ui/aura/client/focus_client.h" #include "ui/display/manager/display_manager.h" @@ -100,10 +100,10 @@ ash::Shell::Get()->RemovePostTargetHandler(handler); } -bool WMHelperAsh::IsTabletModeWindowManagerEnabled() const { +bool WMHelperAsh::IsMaximizeModeWindowManagerEnabled() const { return ash::Shell::Get() - ->tablet_mode_controller() - ->IsTabletModeWindowManagerEnabled(); + ->maximize_mode_controller() + ->IsMaximizeModeWindowManagerEnabled(); } void WMHelperAsh::OnWindowActivated( @@ -126,16 +126,16 @@ NotifyCursorSetChanged(cursor_set); } -void WMHelperAsh::OnTabletModeStarted() { - NotifyTabletModeStarted(); +void WMHelperAsh::OnMaximizeModeStarted() { + NotifyMaximizeModeStarted(); } -void WMHelperAsh::OnTabletModeEnding() { - NotifyTabletModeEnding(); +void WMHelperAsh::OnMaximizeModeEnding() { + NotifyMaximizeModeEnding(); } -void WMHelperAsh::OnTabletModeEnded() { - NotifyTabletModeEnded(); +void WMHelperAsh::OnMaximizeModeEnded() { + NotifyMaximizeModeEnded(); } void WMHelperAsh::OnDisplayConfigurationChanged() {
diff --git a/components/exo/wm_helper_ash.h b/components/exo/wm_helper_ash.h index 44a0c2527..21bde11 100644 --- a/components/exo/wm_helper_ash.h +++ b/components/exo/wm_helper_ash.h
@@ -40,7 +40,7 @@ void RemovePreTargetHandler(ui::EventHandler* handler) override; void AddPostTargetHandler(ui::EventHandler* handler) override; void RemovePostTargetHandler(ui::EventHandler* handler) override; - bool IsTabletModeWindowManagerEnabled() const override; + bool IsMaximizeModeWindowManagerEnabled() const override; // Overridden from aura::client::ActivationChangeObserver: void OnWindowActivated( @@ -57,9 +57,9 @@ void OnCursorSetChanged(ui::CursorSetType cursor_set) override; // Overridden from ash::ShellObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnding() override; - void OnTabletModeEnded() override; + void OnMaximizeModeStarted() override; + void OnMaximizeModeEnding() override; + void OnMaximizeModeEnded() override; // Overridden from ash::WmDisplayObserver: void OnDisplayConfigurationChanged() override;
diff --git a/components/exo/wm_helper_mus.cc b/components/exo/wm_helper_mus.cc index 4fb861a..105691c 100644 --- a/components/exo/wm_helper_mus.cc +++ b/components/exo/wm_helper_mus.cc
@@ -81,7 +81,7 @@ aura::Env::GetInstance()->RemovePostTargetHandler(handler); } -bool WMHelperMus::IsTabletModeWindowManagerEnabled() const { +bool WMHelperMus::IsMaximizeModeWindowManagerEnabled() const { NOTIMPLEMENTED(); return false; }
diff --git a/components/exo/wm_helper_mus.h b/components/exo/wm_helper_mus.h index 6bae8c0..4801e9d 100644 --- a/components/exo/wm_helper_mus.h +++ b/components/exo/wm_helper_mus.h
@@ -41,7 +41,7 @@ void RemovePreTargetHandler(ui::EventHandler* handler) override; void AddPostTargetHandler(ui::EventHandler* handler) override; void RemovePostTargetHandler(ui::EventHandler* handler) override; - bool IsTabletModeWindowManagerEnabled() const override; + bool IsMaximizeModeWindowManagerEnabled() const override; // Overridden from aura::FocusSynchronizerObserver: void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client,
diff --git a/components/favicon/content/content_favicon_driver.cc b/components/favicon/content/content_favicon_driver.cc index 00442d0..ece84e5 100644 --- a/components/favicon/content/content_favicon_driver.cc +++ b/components/favicon/content/content_favicon_driver.cc
@@ -31,7 +31,8 @@ const content::Manifest& manifest) { std::vector<FaviconURL> candidates; for (const content::Manifest::Icon& icon : manifest.icons) { - candidates.emplace_back(icon.src, favicon_base::FAVICON, icon.sizes); + candidates.emplace_back(icon.src, favicon_base::WEB_MANIFEST_ICON, + icon.sizes); } callback.Run(candidates); }
diff --git a/components/favicon/core/favicon_driver_impl.cc b/components/favicon/core/favicon_driver_impl.cc index 545def8..891772e 100644 --- a/components/favicon/core/favicon_driver_impl.cc +++ b/components/favicon/core/favicon_driver_impl.cc
@@ -103,12 +103,13 @@ RecordCandidateMetrics(candidates); for (const std::unique_ptr<FaviconHandler>& handler : handlers_) { // We feed in the Web Manifest URL (if any) to the instance handling type - // FAVICON, because those compete which each other (i.e. manifest icons - // override inline favicons). - handler->OnUpdateCandidates(page_url, candidates, - handler->icon_types() & favicon_base::FAVICON - ? manifest_url - : GURL::EmptyGURL()); + // WEB_MANIFEST_ICON, because those compete which each other (i.e. manifest + // icons override inline touch icons). + handler->OnUpdateCandidates( + page_url, candidates, + handler->icon_types() & favicon_base::WEB_MANIFEST_ICON + ? manifest_url + : GURL::EmptyGURL()); } }
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc index e25f44a..aa57bfc 100644 --- a/components/favicon/core/favicon_handler.cc +++ b/components/favicon/core/favicon_handler.cc
@@ -202,7 +202,8 @@ case FaviconDriverObserver::NON_TOUCH_LARGEST: return favicon_base::FAVICON; case FaviconDriverObserver::TOUCH_LARGEST: - return favicon_base::TOUCH_ICON | favicon_base::TOUCH_PRECOMPOSED_ICON; + return favicon_base::TOUCH_ICON | favicon_base::TOUCH_PRECOMPOSED_ICON | + favicon_base::WEB_MANIFEST_ICON; } return 0; } @@ -353,7 +354,7 @@ // See if there is a cached favicon for the manifest. This will update the DB // mappings only if the manifest URL is cached. GetFaviconAndUpdateMappingsUnlessIncognito( - /*icon_url=*/manifest_url_, favicon_base::FAVICON, + /*icon_url=*/manifest_url_, favicon_base::WEB_MANIFEST_ICON, base::Bind(&FaviconHandler::OnFaviconDataForManifestFromFaviconService, base::Unretained(this))); } @@ -371,8 +372,9 @@ !has_valid_result || HasExpiredOrIncompleteResult(preferred_icon_size(), favicon_bitmap_results); - if (has_valid_result && (notification_icon_url_ != manifest_url_ || - notification_icon_type_ != favicon_base::FAVICON)) { + if (has_valid_result && + (notification_icon_url_ != manifest_url_ || + notification_icon_type_ != favicon_base::WEB_MANIFEST_ICON)) { // There is a valid favicon. Notify any observers. It is useful to notify // the observers even if the favicon is expired or incomplete (incorrect // size) because temporarily showing the user an expired favicon or @@ -523,7 +525,9 @@ // manifest URL, if available, is used instead of the icon URL. SetFavicon(manifest_url_.is_empty() ? best_favicon_.candidate.icon_url : manifest_url_, - best_favicon_.image, best_favicon_.candidate.icon_type); + best_favicon_.image, + manifest_url_.is_empty() ? best_favicon_.candidate.icon_type + : favicon_base::WEB_MANIFEST_ICON); } // Clear download related state. current_candidate_index_ = candidates_.size();
diff --git a/components/favicon/core/favicon_handler_unittest.cc b/components/favicon/core/favicon_handler_unittest.cc index 0315f076..be6a075 100644 --- a/components/favicon/core/favicon_handler_unittest.cc +++ b/components/favicon/core/favicon_handler_unittest.cc
@@ -38,6 +38,7 @@ using favicon_base::FaviconRawBitmapResult; using favicon_base::TOUCH_ICON; using favicon_base::TOUCH_PRECOMPOSED_ICON; +using favicon_base::WEB_MANIFEST_ICON; using testing::AnyNumber; using testing::Assign; using testing::Contains; @@ -1491,13 +1492,14 @@ // FaviconHandler::OnUpdateCandidates() is called. TEST_F(FaviconHandlerManifestsEnabledTest, GetFaviconFromManifestInHistoryIfCandidatesSlower) { - favicon_service_.fake()->Store(kPageURL, kManifestURL, - CreateRawBitmapResult(kManifestURL)); + favicon_service_.fake()->Store( + kPageURL, kManifestURL, + CreateRawBitmapResult(kManifestURL, WEB_MANIFEST_ICON)); EXPECT_CALL(favicon_service_, UnableToDownloadFavicon(_)).Times(0); EXPECT_CALL(favicon_service_, - UpdateFaviconMappingsAndFetch(_, kManifestURL, FAVICON, + UpdateFaviconMappingsAndFetch(_, kManifestURL, WEB_MANIFEST_ICON, /*desired_size_in_dip=*/16, _, _)); EXPECT_CALL(delegate_, OnFaviconUpdated(_, FaviconDriverObserver::NON_TOUCH_16_DIP, @@ -1516,15 +1518,16 @@ // FaviconService::OnFaviconDataForManifestFromFaviconService() runs. TEST_F(FaviconHandlerManifestsEnabledTest, GetFaviconFromManifestInHistoryIfCandidatesFaster) { - favicon_service_.fake()->Store(kPageURL, kManifestURL, - CreateRawBitmapResult(kManifestURL)); + favicon_service_.fake()->Store( + kPageURL, kManifestURL, + CreateRawBitmapResult(kManifestURL, WEB_MANIFEST_ICON)); // Defer the database lookup completion to control the exact timing. favicon_service_.fake()->SetRunCallbackManuallyForUrl(kManifestURL); EXPECT_CALL(favicon_service_, UnableToDownloadFavicon(_)).Times(0); EXPECT_CALL(favicon_service_, - UpdateFaviconMappingsAndFetch(_, kManifestURL, FAVICON, + UpdateFaviconMappingsAndFetch(_, kManifestURL, WEB_MANIFEST_ICON, /*desired_size_in_dip=*/16, _, _)); EXPECT_CALL(delegate_, OnFaviconUpdated(_, FaviconDriverObserver::NON_TOUCH_16_DIP, @@ -1554,7 +1557,8 @@ EXPECT_CALL(favicon_service_, UnableToDownloadFavicon(_)).Times(0); - EXPECT_CALL(favicon_service_, SetFavicons(_, kManifestURL, FAVICON, _)); + EXPECT_CALL(favicon_service_, + SetFavicons(_, kManifestURL, WEB_MANIFEST_ICON, _)); EXPECT_CALL(delegate_, OnFaviconUpdated(_, _, kManifestURL, _, _)); RunHandlerWithSimpleFaviconCandidates({kIconURL12x12}, kManifestURL); @@ -1570,9 +1574,10 @@ FaviconURL(kIconURL64x64, FAVICON, kEmptySizes), }; - favicon_service_.fake()->Store(kPageURL, kManifestURL, - CreateRawBitmapResult(kManifestURL, FAVICON, - /*expired=*/true)); + favicon_service_.fake()->Store( + kPageURL, kManifestURL, + CreateRawBitmapResult(kManifestURL, WEB_MANIFEST_ICON, + /*expired=*/true)); delegate_.fake_manifest_downloader().Add(kManifestURL, kManifestIcons); EXPECT_CALL(delegate_, OnFaviconUpdated(_, _, kManifestURL, _, _)).Times(2); @@ -1594,9 +1599,10 @@ FaviconURL(kIconURL64x64, FAVICON, kEmptySizes), }; - favicon_service_.fake()->Store(kSomePreviousPageURL, kManifestURL, - CreateRawBitmapResult(kManifestURL, FAVICON, - /*expired=*/true)); + favicon_service_.fake()->Store( + kSomePreviousPageURL, kManifestURL, + CreateRawBitmapResult(kManifestURL, WEB_MANIFEST_ICON, + /*expired=*/true)); delegate_.fake_manifest_downloader().Add(kManifestURL, kManifestIcons); EXPECT_CALL(delegate_, OnFaviconUpdated(_, _, kManifestURL, _, _)).Times(2); @@ -1853,8 +1859,9 @@ AddKnownManifestViaJavascriptWhileImageDownload) { const GURL kSomePreviousPageURL("https://www.google.com/previous"); - favicon_service_.fake()->Store(kSomePreviousPageURL, kManifestURL, - CreateRawBitmapResult(kManifestURL)); + favicon_service_.fake()->Store( + kSomePreviousPageURL, kManifestURL, + CreateRawBitmapResult(kManifestURL, WEB_MANIFEST_ICON)); // Defer the image download completion to control the exact timing. delegate_.fake_image_downloader().SetRunCallbackManuallyForUrl(kIconURL16x16);
diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc index df9f2e32e..bc2ebc2e 100644 --- a/components/favicon/core/large_icon_service.cc +++ b/components/favicon/core/large_icon_service.cc
@@ -311,6 +311,7 @@ : favicon_service_(favicon_service), background_task_runner_(background_task_runner), image_fetcher_(std::move(image_fetcher)) { + large_icon_types_.push_back(favicon_base::IconType::WEB_MANIFEST_ICON); large_icon_types_.push_back(favicon_base::IconType::FAVICON); large_icon_types_.push_back(favicon_base::IconType::TOUCH_ICON); large_icon_types_.push_back(favicon_base::IconType::TOUCH_PRECOMPOSED_ICON);
diff --git a/components/favicon/ios/favicon_url_util.cc b/components/favicon/ios/favicon_url_util.cc index 95bcfda..54b072c50 100644 --- a/components/favicon/ios/favicon_url_util.cc +++ b/components/favicon/ios/favicon_url_util.cc
@@ -23,6 +23,8 @@ return favicon_base::TOUCH_ICON; case web::FaviconURL::TOUCH_PRECOMPOSED_ICON: return favicon_base::TOUCH_PRECOMPOSED_ICON; + case web::FaviconURL::WEB_MANIFEST_ICON: + return favicon_base::WEB_MANIFEST_ICON; case web::FaviconURL::INVALID_ICON: return favicon_base::INVALID_ICON; }
diff --git a/components/favicon_base/favicon_types.h b/components/favicon_base/favicon_types.h index 47c63aeb..7ad22ff 100644 --- a/components/favicon_base/favicon_types.h +++ b/components/favicon_base/favicon_types.h
@@ -23,13 +23,13 @@ // Defines the icon types. They are also stored in icon_type field of favicons // table. // The values of the IconTypes are used to select the priority in which favicon -// data is returned in HistoryBackend and ThumbnailDatabase. Data for the -// largest IconType takes priority if data for multiple IconTypes is available. +// data is returned in HistoryBackend and ThumbnailDatabase. enum IconType { INVALID_ICON = 0x0, FAVICON = 1 << 0, TOUCH_ICON = 1 << 1, - TOUCH_PRECOMPOSED_ICON = 1 << 2 + TOUCH_PRECOMPOSED_ICON = 1 << 2, + WEB_MANIFEST_ICON = 1 << 3, }; // Defines a gfx::Image of size desired_size_in_dip composed of image
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc index 9c24373..bb21144 100644 --- a/components/history/core/browser/history_backend.cc +++ b/components/history/core/browser/history_backend.cc
@@ -2117,9 +2117,12 @@ DCHECK_LE(icon_ids.size(), kMaxFaviconsPerPage); bool mappings_changed = false; - // Two icon types are considered 'equivalent' if one of the icon types is - // TOUCH_ICON and the other is TOUCH_PRECOMPOSED_ICON. - // + // Two icon types are considered 'equivalent' if both types are one of + // TOUCH_ICON, TOUCH_PRECOMPOSED_ICON or WEB_MANIFEST_ICON. + const int equivalent_types = favicon_base::TOUCH_ICON | + favicon_base::TOUCH_PRECOMPOSED_ICON | + favicon_base::WEB_MANIFEST_ICON; + // Sets the icon mappings from |page_url| for |icon_type| to the favicons // with |icon_ids|. Mappings for |page_url| to favicons of type |icon_type| // whose FaviconID is not in |icon_ids| are removed. All icon mappings for @@ -2143,11 +2146,8 @@ continue; } - if ((icon_type == favicon_base::TOUCH_ICON && - m->icon_type == favicon_base::TOUCH_PRECOMPOSED_ICON) || - (icon_type == favicon_base::TOUCH_PRECOMPOSED_ICON && - m->icon_type == favicon_base::TOUCH_ICON) || - (icon_type == m->icon_type)) { + if (icon_type == m->icon_type || ((icon_type & equivalent_types) != 0 && + (m->icon_type & equivalent_types) != 0)) { thumbnail_db_->DeleteIconMapping(m->mapping_id); // Removing the icon mapping may have orphaned the associated favicon so
diff --git a/components/history/core/browser/history_backend_unittest.cc b/components/history/core/browser/history_backend_unittest.cc index 48cee5b..63dfe4b 100644 --- a/components/history/core/browser/history_backend_unittest.cc +++ b/components/history/core/browser/history_backend_unittest.cc
@@ -1791,9 +1791,23 @@ 0u, NumIconMappingsForPageURL(url1, favicon_base::TOUCH_PRECOMPOSED_ICON)); + // Add a web manifest_icon. + backend_->SetFavicons(url1, favicon_base::WEB_MANIFEST_ICON, icon_url2, + bitmaps); + EXPECT_EQ(1u, + NumIconMappingsForPageURL(url1, favicon_base::WEB_MANIFEST_ICON)); + EXPECT_EQ(1u, NumIconMappingsForPageURL(url1, favicon_base::FAVICON)); + // The TOUCH_ICON_ICON was replaced. + EXPECT_EQ(0u, NumIconMappingsForPageURL(url1, favicon_base::TOUCH_ICON)); + + // The TOUCH_PRECOMPOSED_ICON was replaced. + EXPECT_EQ(0u, NumIconMappingsForPageURL( + url1, favicon_base::TOUCH_PRECOMPOSED_ICON)); + // Add a different favicon. backend_->SetFavicons(url1, favicon_base::FAVICON, icon_url2, bitmaps); - EXPECT_EQ(1u, NumIconMappingsForPageURL(url1, favicon_base::TOUCH_ICON)); + EXPECT_EQ(1u, + NumIconMappingsForPageURL(url1, favicon_base::WEB_MANIFEST_ICON)); EXPECT_EQ(1u, NumIconMappingsForPageURL(url1, favicon_base::FAVICON)); EXPECT_EQ(1u, NumIconMappingsForPageURL(url2, favicon_base::FAVICON)); }
diff --git a/content/browser/bad_message.h b/content/browser/bad_message.h index 5db553de..4af4fe2 100644 --- a/content/browser/bad_message.h +++ b/content/browser/bad_message.h
@@ -193,6 +193,7 @@ RWH_SURFACE_INVARIANTS_VIOLATION = 169, RFH_ILLEGAL_UPLOAD_PARAMS = 170, RFH_BASE_URL_FOR_DATA_URL_SPECIFIED = 171, + RFPH_ILLEGAL_UPLOAD_PARAMS = 172, // Please add new elements here. The naming convention is abbreviated class // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index db82d712a..77be448 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -54,6 +54,7 @@ #include "components/tracing/common/tracing_switches.h" #include "components/viz/display_compositor/host_shared_bitmap_manager.h" #include "content/browser/browser_thread_impl.h" +#include "content/browser/child_process_security_policy_impl.h" #include "content/browser/dom_storage/dom_storage_area.h" #include "content/browser/download/download_resource_handler.h" #include "content/browser/download/save_file_manager.h" @@ -799,6 +800,13 @@ LevelDBWrapperImpl::EnableAggressiveCommitDelay(); } + if (parsed_command_line_.HasSwitch(switches::kIsolateOrigins)) { + ChildProcessSecurityPolicyImpl* policy = + ChildProcessSecurityPolicyImpl::GetInstance(); + policy->AddIsolatedOriginsFromCommandLine( + parsed_command_line_.GetSwitchValueASCII(switches::kIsolateOrigins)); + } + // Enable memory-infra dump providers. InitSkiaEventTracer(); tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess(
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 28ce45a..a9b54d8c 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -14,18 +14,24 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "build/build_config.h" #include "content/browser/site_instance_impl.h" +#include "content/common/resource_request_body_impl.h" #include "content/common/site_isolation_policy.h" +#include "content/public/browser/browser_context.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/storage_partition.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/url_constants.h" #include "net/base/filename_util.h" #include "net/url_request/url_request.h" #include "storage/browser/fileapi/file_permission_policy.h" +#include "storage/browser/fileapi/file_system_context.h" #include "storage/browser/fileapi/file_system_url.h" #include "storage/browser/fileapi/isolated_context.h" #include "storage/common/fileapi/file_system_util.h" @@ -252,14 +258,10 @@ return false; } - bool CanAccessDataForOrigin(const GURL& gurl) { + bool CanAccessDataForOrigin(const GURL& site_url) { if (origin_lock_.is_empty()) return true; - // TODO(creis): We must pass the valid browser_context to convert hosted - // apps URLs. Currently, hosted apps cannot set cookies in this mode. - // See http://crbug.com/160576. - GURL site_gurl = SiteInstanceImpl::GetSiteForURL(NULL, gurl); - return origin_lock_ == site_gurl; + return origin_lock_ == site_url; } void LockToOrigin(const GURL& gurl) { @@ -744,6 +746,68 @@ }); } +bool ChildProcessSecurityPolicyImpl::CanReadRequestBody( + int child_id, + const storage::FileSystemContext* file_system_context, + const scoped_refptr<ResourceRequestBodyImpl>& body) { + if (!body) + return true; + + for (const ResourceRequestBodyImpl::Element& element : *body->elements()) { + switch (element.type()) { + case ResourceRequestBodyImpl::Element::TYPE_FILE: + if (!CanReadFile(child_id, element.path())) + return false; + break; + + case ResourceRequestBodyImpl::Element::TYPE_FILE_FILESYSTEM: + if (!CanReadFileSystemFile(child_id, file_system_context->CrackURL( + element.filesystem_url()))) + return false; + break; + + case ResourceRequestBodyImpl::Element::TYPE_DISK_CACHE_ENTRY: + // TYPE_DISK_CACHE_ENTRY can't be sent via IPC according to + // content/common/resource_messages.cc + NOTREACHED(); + return false; + + case ResourceRequestBodyImpl::Element::TYPE_BYTES: + case ResourceRequestBodyImpl::Element::TYPE_BYTES_DESCRIPTION: + // Data is self-contained within |body| - no need to check access. + break; + + case ResourceRequestBodyImpl::Element::TYPE_BLOB: + // No need to validate - the unguessability of the uuid of the blob is a + // sufficient defense against access from an unrelated renderer. + break; + + case ResourceRequestBodyImpl::Element::TYPE_UNKNOWN: + default: + // Fail safe - deny access. + NOTREACHED(); + return false; + } + } + return true; +} + +bool ChildProcessSecurityPolicyImpl::CanReadRequestBody( + SiteInstance* site_instance, + const scoped_refptr<ResourceRequestBodyImpl>& body) { + DCHECK(site_instance); + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + int child_id = site_instance->GetProcess()->GetID(); + + StoragePartition* storage_partition = BrowserContext::GetStoragePartition( + site_instance->GetBrowserContext(), site_instance); + const storage::FileSystemContext* file_system_context = + storage_partition->GetFileSystemContext(); + + return CanReadRequestBody(child_id, file_system_context, body); +} + bool ChildProcessSecurityPolicyImpl::CanCreateReadWriteFile( int child_id, const base::FilePath& file) { @@ -921,7 +985,16 @@ } bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(int child_id, - const GURL& gurl) { + const GURL& url) { + // It's important to call GetSiteForURL before acquiring |lock_|, since + // GetSiteForURL consults IsIsolatedOrigin, which needs to grab the same + // lock. + // + // TODO(creis): We must pass the valid browser_context to convert hosted apps + // URLs. Currently, hosted apps cannot set cookies in this mode. See + // http://crbug.com/160576. + GURL site_url = SiteInstanceImpl::GetSiteForURL(NULL, url); + base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); if (state == security_state_.end()) { @@ -929,7 +1002,7 @@ // workaround for https://crbug.com/600441 return true; } - return state->second->CanAccessDataForOrigin(gurl); + return state->second->CanAccessDataForOrigin(site_url); } bool ChildProcessSecurityPolicyImpl::HasSpecificPermissionForOrigin( @@ -993,4 +1066,32 @@ return state->second->can_send_midi_sysex(); } +void ChildProcessSecurityPolicyImpl::AddIsolatedOrigin( + const url::Origin& origin) { + CHECK(!origin.unique()) + << "Cannot register a unique origin as an isolated origin."; + CHECK(!IsIsolatedOrigin(origin)) + << "Duplicate isolated origin: " << origin.Serialize(); + + base::AutoLock lock(lock_); + isolated_origins_.insert(origin); +} + +void ChildProcessSecurityPolicyImpl::AddIsolatedOriginsFromCommandLine( + const std::string& origin_list) { + for (const base::StringPiece& origin_piece : + base::SplitStringPiece(origin_list, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY)) { + url::Origin origin((GURL(origin_piece))); + if (!origin.unique()) + AddIsolatedOrigin(origin); + } +} + +bool ChildProcessSecurityPolicyImpl::IsIsolatedOrigin( + const url::Origin& origin) { + base::AutoLock lock(lock_); + return isolated_origins_.find(origin) != isolated_origins_.end(); +} + } // namespace content
diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h index 82f0e9be..165d4d3bf 100644 --- a/content/browser/child_process_security_policy_impl.h +++ b/content/browser/child_process_security_policy_impl.h
@@ -14,11 +14,13 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "base/synchronization/lock.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/common/resource_type.h" #include "storage/common/fileapi/file_system_types.h" +#include "url/origin.h" class GURL; @@ -27,11 +29,15 @@ } namespace storage { +class FileSystemContext; class FileSystemURL; } namespace content { +class SiteInstance; +class ResourceRequestBodyImpl; + class CONTENT_EXPORT ChildProcessSecurityPolicyImpl : NON_EXPORTED_BASE(public ChildProcessSecurityPolicy) { public: @@ -89,6 +95,15 @@ // Returns if |child_id| can read all of the |files|. bool CanReadAllFiles(int child_id, const std::vector<base::FilePath>& files); + // Validate that the renderer process for |site_instance| is allowed to access + // data in the POST body specified by |body|. Has to be called on the UI + // thread. + // TODO(lukasza): Remove code duplication - the method below should be reused + // by RenderFrameHostImpl::OnBeginNavigation and + // ResourceDispatcherHostImpl::ShouldServiceRequest. + bool CanReadRequestBody(SiteInstance* site_instance, + const scoped_refptr<ResourceRequestBodyImpl>& body); + // Pseudo schemes are treated differently than other schemes because they // cannot be requested like normal URLs. There is no mechanism for revoking // pseudo schemes. @@ -170,12 +185,41 @@ // Returns true if sending system exclusive messages is allowed. bool CanSendMidiSysExMessage(int child_id); + // Add an origin to the list of origins that require process isolation. + // When making process model decisions for such origins, the full + // scheme+host+port tuple rather than scheme and eTLD+1 will be used. + // SiteInstances for these origins will also use the full origin as site URL. + // + // Note that |origin| must not be unique. URLs that render with + // unique origins, such as data: URLs, are not supported. Suborigins (see + // https://w3c.github.io/webappsec-suborigins/ -- not to be confused with + // subdomains) and non-standard schemes are also not supported. Sandboxed + // frames (e.g., <iframe sandbox>) + // *are* supported, since process placement decisions will be based on the + // URLs such frames navigate to, and not the origin of committed documents + // (which might be unique). If an isolated origin opens an about:blank + // popup, it will stay in the isolated origin's process. Nested URLs + // (filesystem: and blob:) retain process isolation behavior of their inner + // origin. + void AddIsolatedOrigin(const url::Origin& origin); + + // Register a set of isolated origins as specified on the command line with + // the --isolate-origins flag. |origin_list| is the flag's value, which + // contains the list of comma-separated scheme-host-port origins. See + // AddIsolatedOrigin for definition of an isolated origin. + void AddIsolatedOriginsFromCommandLine(const std::string& origin_list); + + // Helper to check whether an origin requires origin-wide process isolation. + bool IsIsolatedOrigin(const url::Origin& origin); + private: friend class ChildProcessSecurityPolicyInProcessBrowserTest; friend class ChildProcessSecurityPolicyTest; FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak); FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); + FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, + IsolateOriginsFromCommandLine); class SecurityState; @@ -233,6 +277,12 @@ const std::string& filesystem_id, int permission); + // Validate that |child_id| in |file_system_context| is allowed to access + // data in the POST body specified by |body|. Can be called on any thread. + bool CanReadRequestBody(int child_id, + const storage::FileSystemContext* file_system_context, + const scoped_refptr<ResourceRequestBodyImpl>& body); + // You must acquire this lock before reading or writing any members of this // class. You must not block while holding this lock. base::Lock lock_; @@ -260,6 +310,12 @@ FileSystemPermissionPolicyMap file_system_policy_map_; + // Tracks origins for which the entire origin should be treated as a site + // when making process model decisions, rather than the origin's scheme and + // eTLD+1. Each of these origins requires a dedicated process. This set is + // protected by |lock_|. + std::set<url::Origin> isolated_origins_; + DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); };
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index d0a347c..3da1c80 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc
@@ -893,4 +893,29 @@ p->Remove(kRendererID); } +// Verifies parsing logic that extracts origins from --isolate-origins. +TEST_F(ChildProcessSecurityPolicyTest, IsolateOriginsFromCommandLine) { + // Invalid and unique origins are not permitted. + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + policy->AddIsolatedOriginsFromCommandLine("foo"); + policy->AddIsolatedOriginsFromCommandLine(""); + policy->AddIsolatedOriginsFromCommandLine("about:blank"); + EXPECT_EQ(0U, policy->isolated_origins_.size()); + + policy->AddIsolatedOriginsFromCommandLine("http://isolated.foo.com"); + EXPECT_EQ(1U, policy->isolated_origins_.size()); + EXPECT_TRUE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://isolated.foo.com")))); + + policy->AddIsolatedOriginsFromCommandLine( + "http://a.com,https://b.com,,https://c.com:8000"); + EXPECT_EQ(4U, policy->isolated_origins_.size()); + EXPECT_TRUE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://isolated.foo.com")))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(GURL("http://a.com")))); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(GURL("https://b.com")))); + EXPECT_TRUE( + policy->IsIsolatedOrigin(url::Origin(GURL("https://c.com:8000")))); +} + } // namespace content
diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc index 601909e..f0c8e1f 100644 --- a/content/browser/cross_site_transfer_browsertest.cc +++ b/content/browser/cross_site_transfer_browsertest.cc
@@ -15,6 +15,7 @@ #include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/browser/resource_throttle.h" @@ -515,6 +516,97 @@ ::testing::HasSubstr("form-data; name=\"file\"")); } +// Test that verifies that if navigation originator doesn't have access to a +// file, then no access is granted after a cross-process transfer of POST data. +// This is a regression test for https://crbug.com/726067. +// +// This test is somewhat similar to +// http/tests/navigation/form-targets-cross-site-frame-post.html layout test +// except that it 1) tests with files, 2) simulates a malicious scenario and 3) +// verifies file access (all of these 3 things are not possible with layout +// tests). +// +// This test is very similar to CrossSiteTransferTest.PostWithFileData above, +// except that it simulates a malicious form / POST originator. +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, MaliciousPostWithFileData) { + // The initial test window is a named form target. + GURL initial_target_url( + embedded_test_server()->GetURL("initial-target.com", "/title1.html")); + EXPECT_TRUE(NavigateToURL(shell(), initial_target_url)); + WebContents* target_contents = shell()->web_contents(); + EXPECT_TRUE(ExecuteScript(target_contents, "window.name = 'form-target';")); + + // Create a new window containing a form targeting |target_contents|. + GURL form_url(embedded_test_server()->GetURL( + "main.com", "/form_that_posts_cross_site.html")); + Shell* other_window = OpenPopup(target_contents, form_url, "form-window"); + WebContents* form_contents = other_window->web_contents(); + EXPECT_TRUE(ExecuteScript( + form_contents, + "document.getElementById('file-form').target = 'form-target';")); + + // Verify the current locations and process placement of |target_contents| + // and |form_contents|. + EXPECT_EQ(initial_target_url, target_contents->GetLastCommittedURL()); + EXPECT_EQ(form_url, form_contents->GetLastCommittedURL()); + EXPECT_NE(target_contents->GetMainFrame()->GetProcess()->GetID(), + form_contents->GetMainFrame()->GetProcess()->GetID()); + + // Prepare a file to upload. + base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir; + base::ScopedTempDir temp_dir; + base::FilePath file_path; + std::string file_content("test-file-content"); + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.GetPath(), &file_path)); + ASSERT_LT( + 0, base::WriteFile(file_path, file_content.data(), file_content.size())); + + // Fill out the form to refer to the test file. + std::unique_ptr<FileChooserDelegate> delegate( + new FileChooserDelegate(file_path)); + form_contents->Focus(); + form_contents->SetDelegate(delegate.get()); + EXPECT_TRUE( + ExecuteScript(form_contents, "document.getElementById('file').click();")); + EXPECT_TRUE(delegate->file_chosen()); + ChildProcessSecurityPolicyImpl* security_policy = + ChildProcessSecurityPolicyImpl::GetInstance(); + EXPECT_TRUE(security_policy->CanReadFile( + form_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); + + // Simulate a malicious situation, where the renderer doesn't really have + // access to the file. + security_policy->RevokeAllPermissionsForFile( + form_contents->GetMainFrame()->GetProcess()->GetID(), file_path); + EXPECT_FALSE(security_policy->CanReadFile( + form_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); + EXPECT_FALSE(security_policy->CanReadFile( + target_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); + + // Submit the form and wait until the malicious renderer gets killed. + RenderProcessHostWatcher process_exit_observer( + form_contents->GetMainFrame()->GetProcess(), + RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + EXPECT_TRUE(ExecuteScript( + form_contents, + "setTimeout(\n" + " function() { document.getElementById('file-form').submit(); },\n" + " 0);")); + process_exit_observer.Wait(); + EXPECT_FALSE(process_exit_observer.did_exit_normally()); + + // The target frame should still be at the original location - the malicious + // navigation should have been stopped. + EXPECT_EQ(initial_target_url, target_contents->GetLastCommittedURL()); + + // Both processes still shouldn't have access. + EXPECT_FALSE(security_policy->CanReadFile( + form_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); + EXPECT_FALSE(security_policy->CanReadFile( + target_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); +} + INSTANTIATE_TEST_CASE_P(CrossSiteTransferTest, CrossSiteTransferTest, ::testing::Values(TestParameter::LOADING_WITHOUT_MOJO,
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc index b0796e3..a0063ae 100644 --- a/content/browser/download/download_item_impl.cc +++ b/content/browser/download/download_item_impl.cc
@@ -1066,12 +1066,6 @@ // notified when the download transitions to the IN_PROGRESS state. } -void DownloadItemImpl::CancelRequestWithOffset(int64_t offset) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (job_) - job_->CancelRequestWithOffset(offset); -} - void DownloadItemImpl::NotifyRemoved() { for (auto& observer : observers_) observer.OnDownloadRemoved(this); @@ -1327,20 +1321,10 @@ TransitionTo(TARGET_PENDING_INTERNAL); - job_->Start(); -} - -void DownloadItemImpl::StartDownload() { - BrowserThread::PostTask( - BrowserThread::FILE, FROM_HERE, - base::Bind(&DownloadFile::Initialize, - // Safe because we control download file lifetime. - base::Unretained(download_file_.get()), - base::Bind(&DownloadItemImpl::OnDownloadFileInitialized, - weak_ptr_factory_.GetWeakPtr()), - base::Bind(&DownloadItemImpl::CancelRequestWithOffset, - weak_ptr_factory_.GetWeakPtr()), - received_slices_, job_ && job_->IsParallelizable())); + job_->Start(download_file_.get(), + base::Bind(&DownloadItemImpl::OnDownloadFileInitialized, + weak_ptr_factory_.GetWeakPtr()), + GetReceivedSlices()); } void DownloadItemImpl::OnDownloadFileInitialized(
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h index 0e3c33a..61fb7b7 100644 --- a/content/browser/download/download_item_impl.h +++ b/content/browser/download/download_item_impl.h
@@ -410,9 +410,6 @@ // this is. void Init(bool active, DownloadType download_type); - // Start a series of events that result in the file being downloaded. - void StartDownload(); - // Callback from file thread when we initialize the DownloadFile. void OnDownloadFileInitialized(DownloadInterruptReason result); @@ -509,9 +506,6 @@ virtual void UpdateValidatorsOnResumption( const DownloadCreateInfo& new_create_info); - // Cancel a particular request that starts from |offset|. - void CancelRequestWithOffset(int64_t offset); - static DownloadState InternalToExternalState( DownloadInternalState internal_state); static DownloadInternalState ExternalToInternalState(
diff --git a/content/browser/download/download_job.cc b/content/browser/download/download_job.cc index b7f5dfc5..64c3a09 100644 --- a/content/browser/download/download_job.cc +++ b/content/browser/download/download_job.cc
@@ -5,14 +5,15 @@ #include "content/browser/download/download_job.h" #include "base/bind_helpers.h" -#include "content/browser/download/download_file.h" #include "content/browser/download/download_item_impl.h" #include "content/public/browser/browser_thread.h" namespace content { DownloadJob::DownloadJob(DownloadItemImpl* download_item) - : download_item_(download_item), is_paused_(false) {} + : download_item_(download_item), + is_paused_(false), + weak_ptr_factory_(this) {} DownloadJob::~DownloadJob() = default; @@ -24,8 +25,25 @@ is_paused_ = false; } -void DownloadJob::StartDownload() const { - download_item_->StartDownload(); +void DownloadJob::Start(DownloadFile* download_file_, + const DownloadFile::InitializeCallback& callback, + const DownloadItem::ReceivedSlices& received_slices) { + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, + base::Bind(&DownloadFile::Initialize, + // Safe because we control download file lifetime. + base::Unretained(download_file_), + base::Bind(&DownloadJob::OnDownloadFileInitialized, + weak_ptr_factory_.GetWeakPtr(), callback), + base::Bind(&DownloadJob::CancelRequestWithOffset, + weak_ptr_factory_.GetWeakPtr()), + received_slices, IsParallelizable())); +} + +void DownloadJob::OnDownloadFileInitialized( + const DownloadFile::InitializeCallback& callback, + DownloadInterruptReason result) { + callback.Run(result); } bool DownloadJob::AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
diff --git a/content/browser/download/download_job.h b/content/browser/download/download_job.h index cef1c47..b7df008 100644 --- a/content/browser/download/download_job.h +++ b/content/browser/download/download_job.h
@@ -6,8 +6,10 @@ #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_ #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "content/browser/byte_stream.h" +#include "content/browser/download/download_file.h" #include "content/common/content_export.h" #include "content/public/browser/download_danger_type.h" #include "content/public/browser/download_interrupt_reasons.h" @@ -26,7 +28,11 @@ virtual ~DownloadJob(); // Download operations. - virtual void Start() = 0; + // TODO(qinmin): Remove the |callback| and |download_file_| parameter if + // DownloadJob owns download file. + void Start(DownloadFile* download_file_, + const DownloadFile::InitializeCallback& callback, + const DownloadItem::ReceivedSlices& received_slices); virtual void Cancel(bool user_cancel) = 0; virtual void Pause(); virtual void Resume(bool resume_request); @@ -50,7 +56,10 @@ virtual void CancelRequestWithOffset(int64_t offset); protected: - void StartDownload() const; + // Callback from file thread when we initialize the DownloadFile. + virtual void OnDownloadFileInitialized( + const DownloadFile::InitializeCallback& callback, + DownloadInterruptReason result); // Add a byte stream to the download sink. Return false if we start to // destroy download file. @@ -64,6 +73,8 @@ // If the download progress is paused by the user. bool is_paused_; + base::WeakPtrFactory<DownloadJob> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(DownloadJob); };
diff --git a/content/browser/download/download_job_impl.cc b/content/browser/download/download_job_impl.cc index 82b6ed86..76527dc 100644 --- a/content/browser/download/download_job_impl.cc +++ b/content/browser/download/download_job_impl.cc
@@ -18,10 +18,6 @@ DownloadJobImpl::~DownloadJobImpl() = default; -void DownloadJobImpl::Start() { - DownloadJob::StartDownload(); -} - void DownloadJobImpl::Cancel(bool user_cancel) { if (request_handle_) request_handle_->CancelRequest();
diff --git a/content/browser/download/download_job_impl.h b/content/browser/download/download_job_impl.h index 59522a71..4dc857d 100644 --- a/content/browser/download/download_job_impl.h +++ b/content/browser/download/download_job_impl.h
@@ -22,7 +22,6 @@ ~DownloadJobImpl() override; // DownloadJob implementation. - void Start() override; void Cancel(bool user_cancel) override; void Pause() override; void Resume(bool resume_request) override;
diff --git a/content/browser/download/mock_download_job.h b/content/browser/download/mock_download_job.h index 25a4ad037..5243561 100644 --- a/content/browser/download/mock_download_job.h +++ b/content/browser/download/mock_download_job.h
@@ -24,7 +24,9 @@ DownloadItemImpl* download_item() { return download_item_; } // DownloadJob implementation. - MOCK_METHOD0(Start, void()); + MOCK_METHOD2(Start, + void(const DownloadFile::InitializeCallback&, + const DownloadItem::ReceivedSlices&)); MOCK_METHOD1(Cancel, void(bool)); MOCK_METHOD0(Pause, void()); MOCK_METHOD1(Resume, void(bool));
diff --git a/content/browser/download/parallel_download_job.cc b/content/browser/download/parallel_download_job.cc index 20885bd..19d809d 100644 --- a/content/browser/download/parallel_download_job.cc +++ b/content/browser/download/parallel_download_job.cc
@@ -34,10 +34,12 @@ ParallelDownloadJob::~ParallelDownloadJob() = default; -void ParallelDownloadJob::Start() { - DownloadJobImpl::Start(); - - BuildParallelRequestAfterDelay(); +void ParallelDownloadJob::OnDownloadFileInitialized( + const DownloadFile::InitializeCallback& callback, + DownloadInterruptReason result) { + DownloadJobImpl::OnDownloadFileInitialized(callback, result); + if (result == DOWNLOAD_INTERRUPT_REASON_NONE) + BuildParallelRequestAfterDelay(); } void ParallelDownloadJob::Cancel(bool user_cancel) {
diff --git a/content/browser/download/parallel_download_job.h b/content/browser/download/parallel_download_job.h index 907bd5d..68c648f 100644 --- a/content/browser/download/parallel_download_job.h +++ b/content/browser/download/parallel_download_job.h
@@ -30,13 +30,17 @@ ~ParallelDownloadJob() override; // DownloadJobImpl implementation. - void Start() override; void Cancel(bool user_cancel) override; void Pause() override; void Resume(bool resume_request) override; void CancelRequestWithOffset(int64_t offset) override; protected: + // DownloadJobImpl implementation. + void OnDownloadFileInitialized( + const DownloadFile::InitializeCallback& callback, + DownloadInterruptReason result) override; + // Virtual for testing. virtual int GetParallelRequestCount() const; virtual int64_t GetMinSliceSize() const;
diff --git a/content/browser/download/parallel_download_job_unittest.cc b/content/browser/download/parallel_download_job_unittest.cc index 0c730c3..41a3b79 100644 --- a/content/browser/download/parallel_download_job_unittest.cc +++ b/content/browser/download/parallel_download_job_unittest.cc
@@ -8,6 +8,9 @@ #include <vector> #include "base/memory/ptr_util.h" +#include "base/run_loop.h" +#include "content/browser/download/download_destination_observer.h" +#include "content/browser/download/download_file_impl.h" #include "content/browser/download/download_item_impl_delegate.h" #include "content/browser/download/mock_download_item_impl.h" #include "content/browser/download/parallel_download_utils.h" @@ -15,7 +18,9 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using ::testing::_; using ::testing::NiceMock; +using ::testing::StrictMock; namespace content { @@ -31,6 +36,31 @@ MOCK_CONST_METHOD0(DebugString, std::string()); }; +class MockDownloadDestinationObserver : public DownloadDestinationObserver { + public: + MOCK_METHOD3(DestinationUpdate, + void(int64_t, + int64_t, + const std::vector<DownloadItem::ReceivedSlice>&)); + void DestinationError( + DownloadInterruptReason reason, + int64_t bytes_so_far, + std::unique_ptr<crypto::SecureHash> hash_state) override {} + void DestinationCompleted( + int64_t total_bytes, + std::unique_ptr<crypto::SecureHash> hash_state) override {} + MOCK_METHOD2(CurrentUpdateStatus, void(int64_t, int64_t)); +}; + +class MockByteStreamReader : public ByteStreamReader { + public: + MOCK_METHOD2(Read, + ByteStreamReader::StreamState(scoped_refptr<net::IOBuffer>*, + size_t*)); + MOCK_CONST_METHOD0(GetStatus, int()); + MOCK_METHOD1(RegisterCallback, void(const base::Closure&)); +}; + } // namespace class ParallelDownloadJobForTest : public ParallelDownloadJob { @@ -106,6 +136,7 @@ job_ = base::MakeUnique<ParallelDownloadJobForTest>( download_item_.get(), std::move(request_handle), info, request_count, min_slice_size, min_remaining_time); + file_initialized_ = false; } void DestroyParallelJob() { @@ -138,10 +169,15 @@ EXPECT_EQ(length, job_->workers_[offset]->length()); } + void OnFileInitialized(DownloadInterruptReason result) { + file_initialized_ = true; + } + content::TestBrowserThreadBundle browser_threads_; std::unique_ptr<DownloadItemImplDelegate> item_delegate_; std::unique_ptr<MockDownloadItemImpl> download_item_; std::unique_ptr<ParallelDownloadJobForTest> job_; + bool file_initialized_; // Request handle for the original request. MockDownloadRequestHandle* mock_request_handle_; }; @@ -320,4 +356,33 @@ DestroyParallelJob(); } +// Test that parallel request is not created until download file is initialized. +TEST_F(ParallelDownloadJobTest, ParallelRequestNotCreatedUntilFileInitialized) { + auto save_info = base::MakeUnique<DownloadSaveInfo>(); + StrictMock<MockByteStreamReader>* input_stream = + new StrictMock<MockByteStreamReader>(); + auto observer = + base::MakeUnique<StrictMock<MockDownloadDestinationObserver>>(); + base::WeakPtrFactory<DownloadDestinationObserver> observer_factory( + observer.get()); + auto download_file = base::MakeUnique<DownloadFileImpl>( + std::move(save_info), base::FilePath(), + std::unique_ptr<ByteStreamReader>(input_stream), net::NetLogWithSource(), + observer_factory.GetWeakPtr()); + CreateParallelJob(0, 100, DownloadItem::ReceivedSlices(), 2, 0, 0); + job_->Start(download_file.get(), + base::Bind(&ParallelDownloadJobTest::OnFileInitialized, + base::Unretained(this)), + DownloadItem::ReceivedSlices()); + EXPECT_FALSE(file_initialized_); + EXPECT_EQ(0u, job_->workers().size()); + EXPECT_CALL(*input_stream, RegisterCallback(_)); + EXPECT_CALL(*input_stream, Read(_, _)); + EXPECT_CALL(*(observer.get()), DestinationUpdate(_, _, _)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(file_initialized_); + EXPECT_EQ(1u, job_->workers().size()); + DestroyParallelJob(); +} + } // namespace content
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 92a8c11..7e28d33 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1238,6 +1238,12 @@ void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { GURL validated_url(params.url); GetProcess()->FilterURL(false, &validated_url); + if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRequestBody( + GetSiteInstance(), params.resource_request_body)) { + bad_message::ReceivedBadMessage(GetProcess(), + bad_message::RFH_ILLEGAL_UPLOAD_PARAMS); + return; + } if (params.is_history_navigation_in_new_child) { // Try to find a FrameNavigationEntry that matches this frame instead, based
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc index 1107e77f..725492d 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -8,6 +8,7 @@ #include "base/lazy_instance.h" #include "content/browser/bad_message.h" +#include "content/browser/child_process_security_policy_impl.h" #include "content/browser/frame_host/cross_process_frame_connector.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree_node.h" @@ -32,7 +33,8 @@ RoutingIDFrameProxyMap; base::LazyInstance<RoutingIDFrameProxyMap>::DestructorAtExit g_routing_id_frame_proxy_map = LAZY_INSTANCE_INITIALIZER; -} + +} // namespace // static RenderFrameProxyHost* RenderFrameProxyHost::FromID(int process_id, @@ -250,6 +252,15 @@ if (!site_instance_->IsRelatedSiteInstance(current_rfh->GetSiteInstance())) return; + // Verify if the request originator (*not* |current_rfh|) has access to the + // contents of the POST body. + if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRequestBody( + GetSiteInstance(), params.resource_request_body)) { + bad_message::ReceivedBadMessage(GetProcess(), + bad_message::RFPH_ILLEGAL_UPLOAD_PARAMS); + return; + } + // Since this navigation targeted a specific RenderFrameProxy, it should stay // in the current tab. DCHECK_EQ(WindowOpenDisposition::CURRENT_TAB, params.disposition);
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc new file mode 100644 index 0000000..95dab99 --- /dev/null +++ b/content/browser/isolated_origin_browsertest.cc
@@ -0,0 +1,274 @@ +// 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. + +#include "base/command_line.h" +#include "content/browser/child_process_security_policy_impl.h" +#include "content/browser/web_contents/web_contents_impl.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/common/content_switches.h" +#include "content/public/test/browser_test_utils.h" +#include "content/public/test/content_browser_test.h" +#include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/test_frame_navigation_observer.h" +#include "content/public/test/test_navigation_observer.h" +#include "content/public/test/test_utils.h" +#include "content/shell/browser/shell.h" +#include "content/test/content_browser_test_utils_internal.h" +#include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "url/gurl.h" + +namespace content { + +class IsolatedOriginTest : public ContentBrowserTest { + public: + IsolatedOriginTest() {} + ~IsolatedOriginTest() override {} + + void SetUpCommandLine(base::CommandLine* command_line) override { + ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); + + std::string origin_list = + embedded_test_server()->GetURL("isolated.foo.com", "/").spec() + "," + + embedded_test_server()->GetURL("isolated.bar.com", "/").spec(); + command_line->AppendSwitchASCII(switches::kIsolateOrigins, origin_list); + } + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + embedded_test_server()->StartAcceptingConnections(); + } + + WebContentsImpl* web_contents() const { + return static_cast<WebContentsImpl*>(shell()->web_contents()); + } +}; + +// Check that navigating a main frame from an non-isolated origin to an +// isolated origin and vice versa swaps processes and uses a new SiteInstance, +// both for browser-initiated and renderer-initiated navigations. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, MainFrameNavigation) { + GURL unisolated_url( + embedded_test_server()->GetURL("www.foo.com", "/title1.html")); + GURL isolated_url( + embedded_test_server()->GetURL("isolated.foo.com", "/title2.html")); + + EXPECT_TRUE(NavigateToURL(shell(), unisolated_url)); + + // Open a same-site popup to keep the www.foo.com process alive. + Shell* popup = OpenPopup(shell(), GURL(url::kAboutBlankURL), "foo"); + SiteInstance* unisolated_instance = + popup->web_contents()->GetMainFrame()->GetSiteInstance(); + RenderProcessHost* unisolated_process = + popup->web_contents()->GetMainFrame()->GetProcess(); + + // Perform a browser-initiated navigation to an isolated origin and ensure + // that this ends up in a new process and SiteInstance for isolated.foo.com. + EXPECT_TRUE(NavigateToURL(shell(), isolated_url)); + + scoped_refptr<SiteInstance> isolated_instance = + web_contents()->GetSiteInstance(); + EXPECT_NE(isolated_instance, unisolated_instance); + EXPECT_NE(web_contents()->GetMainFrame()->GetProcess(), unisolated_process); + + // The site URL for isolated.foo.com should be the full origin rather than + // scheme and eTLD+1. + EXPECT_EQ(isolated_url.GetOrigin(), isolated_instance->GetSiteURL()); + + // Now perform a renderer-initiated navigation to an unisolated origin, + // www.foo.com. This should end up in the |popup|'s process. + { + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE(ExecuteScript( + web_contents(), "location.href = '" + unisolated_url.spec() + "'")); + observer.Wait(); + } + + EXPECT_EQ(unisolated_instance, web_contents()->GetSiteInstance()); + EXPECT_EQ(unisolated_process, web_contents()->GetMainFrame()->GetProcess()); + + // Go to isolated.foo.com again, this time with a renderer-initiated + // navigation from the unisolated www.foo.com. + { + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE(ExecuteScript(web_contents(), + "location.href = '" + isolated_url.spec() + "'")); + observer.Wait(); + } + + EXPECT_EQ(isolated_instance, web_contents()->GetSiteInstance()); + EXPECT_NE(unisolated_process, web_contents()->GetMainFrame()->GetProcess()); + + // Go back to www.foo.com: this should end up in the unisolated process. + { + TestNavigationObserver back_observer(web_contents()); + web_contents()->GetController().GoBack(); + back_observer.Wait(); + } + + EXPECT_EQ(unisolated_instance, web_contents()->GetSiteInstance()); + EXPECT_EQ(unisolated_process, web_contents()->GetMainFrame()->GetProcess()); + + // Go back again. This should go to isolated.foo.com in an isolated process. + { + TestNavigationObserver back_observer(web_contents()); + web_contents()->GetController().GoBack(); + back_observer.Wait(); + } + + EXPECT_EQ(isolated_instance, web_contents()->GetSiteInstance()); + EXPECT_NE(unisolated_process, web_contents()->GetMainFrame()->GetProcess()); + + // Do a renderer-initiated navigation from isolated.foo.com to another + // isolated origin and ensure there is a different isolated process. + GURL second_isolated_url( + embedded_test_server()->GetURL("isolated.bar.com", "/title3.html")); + { + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE( + ExecuteScript(web_contents(), + "location.href = '" + second_isolated_url.spec() + "'")); + observer.Wait(); + } + + EXPECT_EQ(second_isolated_url.GetOrigin(), + web_contents()->GetSiteInstance()->GetSiteURL()); + EXPECT_NE(isolated_instance, web_contents()->GetSiteInstance()); + EXPECT_NE(unisolated_instance, web_contents()->GetSiteInstance()); +} + +// Check that opening a popup for an isolated origin puts it into a new process +// and its own SiteInstance. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, Popup) { + GURL unisolated_url( + embedded_test_server()->GetURL("foo.com", "/title1.html")); + GURL isolated_url( + embedded_test_server()->GetURL("isolated.foo.com", "/title2.html")); + + EXPECT_TRUE(NavigateToURL(shell(), unisolated_url)); + + // Open a popup to a URL with an isolated origin and ensure that there was a + // process swap. + Shell* popup = OpenPopup(shell(), isolated_url, "foo"); + + EXPECT_NE(shell()->web_contents()->GetSiteInstance(), + popup->web_contents()->GetSiteInstance()); + + // The popup's site URL should match the full isolated origin. + EXPECT_EQ(isolated_url.GetOrigin(), + popup->web_contents()->GetSiteInstance()->GetSiteURL()); + + // Now open a second popup from an isolated origin to a URL with an + // unisolated origin and ensure that there was another process swap. + Shell* popup2 = OpenPopup(popup, unisolated_url, "bar"); + EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), + popup2->web_contents()->GetSiteInstance()); + EXPECT_NE(popup->web_contents()->GetSiteInstance(), + popup2->web_contents()->GetSiteInstance()); +} + +// Check that navigating a subframe to an isolated origin puts the subframe +// into an OOPIF and its own SiteInstance. Also check that the isolated +// frame's subframes also end up in correct SiteInstance. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, Subframe) { + GURL top_url( + embedded_test_server()->GetURL("www.foo.com", "/page_with_iframe.html")); + EXPECT_TRUE(NavigateToURL(shell(), top_url)); + + GURL isolated_url(embedded_test_server()->GetURL("isolated.foo.com", + "/page_with_iframe.html")); + + FrameTreeNode* root = web_contents()->GetFrameTree()->root(); + FrameTreeNode* child = root->child_at(0); + + NavigateIframeToURL(web_contents(), "test_iframe", isolated_url); + EXPECT_EQ(child->current_url(), isolated_url); + + // Verify that the child frame is an OOPIF with a different SiteInstance. + EXPECT_NE(web_contents()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_TRUE(child->current_frame_host()->IsCrossProcessSubframe()); + EXPECT_EQ(isolated_url.GetOrigin(), + child->current_frame_host()->GetSiteInstance()->GetSiteURL()); + + // Verify that the isolated frame's subframe (which starts out at a relative + // path) is kept in the isolated parent's SiteInstance. + FrameTreeNode* grandchild = child->child_at(0); + EXPECT_EQ(child->current_frame_host()->GetSiteInstance(), + grandchild->current_frame_host()->GetSiteInstance()); + + // Navigating the grandchild to www.foo.com should put it into the top + // frame's SiteInstance. + GURL non_isolated_url( + embedded_test_server()->GetURL("www.foo.com", "/title3.html")); + TestFrameNavigationObserver observer(grandchild); + EXPECT_TRUE(ExecuteScript( + grandchild, "location.href = '" + non_isolated_url.spec() + "';")); + observer.Wait(); + EXPECT_EQ(non_isolated_url, grandchild->current_url()); + + EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), + grandchild->current_frame_host()->GetSiteInstance()); + EXPECT_NE(child->current_frame_host()->GetSiteInstance(), + grandchild->current_frame_host()->GetSiteInstance()); +} + +// Check that when an non-isolated origin foo.com embeds a subframe from an +// isolated origin, which then navigates to a non-isolated origin bar.com, +// bar.com goes back to the main frame's SiteInstance. See +// https://crbug.com/711006. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, + NoOOPIFWhenIsolatedOriginNavigatesToNonIsolatedOrigin) { + if (AreAllSitesIsolatedForTesting()) + return; + + GURL top_url( + embedded_test_server()->GetURL("www.foo.com", "/page_with_iframe.html")); + EXPECT_TRUE(NavigateToURL(shell(), top_url)); + + FrameTreeNode* root = web_contents()->GetFrameTree()->root(); + FrameTreeNode* child = root->child_at(0); + + GURL isolated_url(embedded_test_server()->GetURL("isolated.foo.com", + "/page_with_iframe.html")); + + NavigateIframeToURL(web_contents(), "test_iframe", isolated_url); + EXPECT_EQ(isolated_url, child->current_url()); + + // Verify that the child frame is an OOPIF with a different SiteInstance. + EXPECT_NE(web_contents()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_TRUE(child->current_frame_host()->IsCrossProcessSubframe()); + EXPECT_EQ(isolated_url.GetOrigin(), + child->current_frame_host()->GetSiteInstance()->GetSiteURL()); + + // Navigate the child frame cross-site, but to a non-isolated origin. When + // not in --site-per-process, this should bring the subframe back into the + // main frame's SiteInstance. + GURL bar_url(embedded_test_server()->GetURL("bar.com", "/title1.html")); + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + EXPECT_FALSE(policy->IsIsolatedOrigin(url::Origin(bar_url))); + NavigateIframeToURL(web_contents(), "test_iframe", bar_url); + EXPECT_EQ(web_contents()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_FALSE(child->current_frame_host()->IsCrossProcessSubframe()); +} + +// Check that isolated origins can access cookies. This requires cookie checks +// on the IO thread to be aware of isolated origins. +IN_PROC_BROWSER_TEST_F(IsolatedOriginTest, Cookies) { + GURL isolated_url( + embedded_test_server()->GetURL("isolated.foo.com", "/title2.html")); + EXPECT_TRUE(NavigateToURL(shell(), isolated_url)); + + EXPECT_TRUE(ExecuteScript(web_contents(), "document.cookie = 'foo=bar';")); + + std::string cookie; + EXPECT_TRUE(ExecuteScriptAndExtractString( + web_contents(), "window.domAutomationController.send(document.cookie);", + &cookie)); + EXPECT_EQ("foo=bar", cookie); +} + +} // namespace content
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index ec0d400..dde83fd 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2142,6 +2142,7 @@ switches::kIgnoreAutoplayRestrictionsForTests, switches::kInertVisualViewport, switches::kIPCConnectionTimeout, + switches::kIsolateOrigins, switches::kIsRunningInMash, switches::kJavaScriptFlags, switches::kLoggingLevel,
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index cf003bfe0..872cdd4 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -559,4 +559,57 @@ ResourceDispatcherHost::Get()->SetDelegate(nullptr); } +// Test that a compromised renderer cannot ask to upload an arbitrary file in +// OpenURL. This is a regression test for https://crbug.com/726067. +IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, + OpenUrl_ResourceRequestBody) { + GURL start_url(embedded_test_server()->GetURL("/title1.html")); + GURL target_url(embedded_test_server()->GetURL("/echoall")); + EXPECT_TRUE(NavigateToURL(shell(), start_url)); + + FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root(); + + RenderProcessHostWatcher exit_observer( + root->current_frame_host()->GetProcess(), + RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + + // Prepare a file to upload. + base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir; + base::ScopedTempDir temp_dir; + base::FilePath file_path; + std::string file_content("test-file-content"); + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.GetPath(), &file_path)); + ASSERT_LT( + 0, base::WriteFile(file_path, file_content.data(), file_content.size())); + + // Simulate an IPC message asking to POST a file that the renderer shouldn't + // have access to. + FrameHostMsg_OpenURL_Params params; + params.url = target_url; + params.uses_post = true; + params.resource_request_body = new ResourceRequestBodyImpl; + params.resource_request_body->AppendFileRange( + file_path, 0, file_content.size(), base::Time()); + params.disposition = WindowOpenDisposition::CURRENT_TAB; + params.should_replace_current_entry = true; + params.user_gesture = true; + params.is_history_navigation_in_new_child = false; + + FrameHostMsg_OpenURL msg(root->current_frame_host()->routing_id(), params); + IPC::IpcSecurityTestUtil::PwnMessageReceived( + root->current_frame_host()->GetProcess()->GetChannel(), msg); + + // Verify that the malicious navigation did not commit the navigation to + // |target_url|. + WaitForLoadStop(shell()->web_contents()); + EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); + + // Verify that the malicious renderer got killed. + exit_observer.Wait(); + EXPECT_FALSE(exit_observer.did_exit_normally()); +} + } // namespace content
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index a68c0d7..d8b0d28 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -4,6 +4,7 @@ #include "content/browser/site_instance_impl.h" +#include "base/macros.h" #include "base/memory/ptr_util.h" #include "content/browser/browsing_instance.h" #include "content/browser/child_process_security_policy_impl.h" @@ -308,7 +309,22 @@ if (dest_url == blank_page) return true; + // If either URL has an isolated origin, compare origins rather than sites. + url::Origin src_origin(src_url); + url::Origin dest_origin(dest_url); + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + if (policy->IsIsolatedOrigin(src_origin) || + policy->IsIsolatedOrigin(dest_origin)) + return src_origin == dest_origin; + // If the schemes differ, they aren't part of the same site. + // + // Note that this happens after the isolated origin check, since blob or + // filesystem URLs will fail this check even though they might have the + // same origin. + // + // TODO(alexmos): This check seems broken for nested URLs involving + // non-isolated origins too. See https://crbug.com/726370. if (src_url.scheme() != dest_url.scheme()) return false; @@ -328,6 +344,11 @@ GURL url = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url); url::Origin origin(url); + // Isolated origins should use the full origin as their site URL. + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + if (policy->IsIsolatedOrigin(origin)) + return origin.GetURL(); + // If the url has a host, then determine the site. if (!origin.host().empty()) { // Only keep the scheme and registered domain of |origin|. @@ -353,6 +374,12 @@ // static GURL SiteInstanceImpl::GetEffectiveURL(BrowserContext* browser_context, const GURL& url) { + // Don't resolve URLs corresponding to isolated origins, as isolated origins + // take precedence over hosted apps. + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + if (policy->IsIsolatedOrigin(url::Origin(url))) + return url; + return GetContentClient()->browser()-> GetEffectiveURL(browser_context, url); } @@ -365,10 +392,15 @@ if (SiteIsolationPolicy::UseDedicatedProcessesForAllSites()) return true; + // Always require a dedicated process for isolated origins. + GURL site_url = GetSiteForURL(browser_context, url); + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + if (policy->IsIsolatedOrigin(url::Origin(site_url))) + return true; + // Let the content embedder enable site isolation for specific URLs. Use the // canonical site url for this check, so that schemes with nested origins // (blob and filesystem) work properly. - GURL site_url = GetSiteForURL(browser_context, url); if (GetContentClient()->IsSupplementarySiteIsolationModeEnabled() && GetContentClient()->browser()->DoesSiteRequireDedicatedProcess( browser_context, site_url)) {
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h index 6c2f058a..001790f 100644 --- a/content/browser/site_instance_impl.h +++ b/content/browser/site_instance_impl.h
@@ -8,7 +8,6 @@ #include <stddef.h> #include <stdint.h> -#include "base/macros.h" #include "base/observer_list.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/common/content_export.h"
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 6c8455ed5..845c274b 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc
@@ -843,4 +843,70 @@ EXPECT_EQ(1, browser_client()->GetAndClearBrowsingInstanceDeleteCount()); } +TEST_F(SiteInstanceTest, IsolatedOrigins) { + GURL foo_url("http://www.foo.com"); + GURL isolated_foo_url("http://isolated.foo.com"); + GURL isolated_bar_url("http://isolated.bar.com"); + + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + + EXPECT_FALSE(policy->IsIsolatedOrigin(url::Origin(isolated_foo_url))); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, foo_url, isolated_foo_url)); + + policy->AddIsolatedOrigin(url::Origin(isolated_foo_url)); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_foo_url))); + EXPECT_FALSE(policy->IsIsolatedOrigin(url::Origin(foo_url))); + EXPECT_FALSE(policy->IsIsolatedOrigin(url::Origin(GURL("http://foo.com")))); + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("http://www.bar.com")))); + EXPECT_FALSE( + policy->IsIsolatedOrigin(url::Origin(GURL("https://isolated.foo.com")))); + EXPECT_FALSE(policy->IsIsolatedOrigin( + url::Origin(GURL("http://isolated.foo.com:12345")))); + EXPECT_FALSE(policy->IsIsolatedOrigin( + url::Origin(GURL("http://bar.isolated.foo.com")))); + + policy->AddIsolatedOrigin(url::Origin(isolated_bar_url)); + EXPECT_TRUE(policy->IsIsolatedOrigin(url::Origin(isolated_bar_url))); + + // IsSameWebSite should compare origins rather than sites if either URL is an + // isolated origin. + EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, foo_url, isolated_foo_url)); + EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, foo_url)); + EXPECT_FALSE( + SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, isolated_bar_url)); + EXPECT_TRUE( + SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, isolated_foo_url)); + + // Ensure blob and filesystem URLs with isolated origins are compared + // correctly. + GURL isolated_blob_foo_url("blob:http://isolated.foo.com/uuid"); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, + isolated_blob_foo_url)); + GURL isolated_filesystem_foo_url("filesystem:http://isolated.foo.com/bar/"); + EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, isolated_foo_url, + isolated_filesystem_foo_url)); + + // The site URL for an isolated origin should be the full origin rather than + // eTLD+1. + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, isolated_foo_url)); + EXPECT_EQ(isolated_bar_url, + SiteInstance::GetSiteForURL(nullptr, isolated_bar_url)); + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, isolated_blob_foo_url)); + EXPECT_EQ(isolated_foo_url, + SiteInstance::GetSiteForURL(nullptr, isolated_filesystem_foo_url)); + + // Isolated origins always require a dedicated process. + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, isolated_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, isolated_bar_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, isolated_blob_foo_url)); + EXPECT_TRUE(SiteInstanceImpl::DoesSiteRequireDedicatedProcess( + nullptr, isolated_filesystem_foo_url)); +} + } // namespace content
diff --git a/content/common/site_isolation_policy.cc b/content/common/site_isolation_policy.cc index 41c3653..7fa66c2 100644 --- a/content/common/site_isolation_policy.cc +++ b/content/common/site_isolation_policy.cc
@@ -19,7 +19,7 @@ // investigated. #if defined(OS_ANDROID) return UseDedicatedProcessesForAllSites() || - IsTopDocumentIsolationEnabled() || + IsTopDocumentIsolationEnabled() || AreIsolatedOriginsEnabled() || GetContentClient()->IsSupplementarySiteIsolationModeEnabled() || base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames); #else @@ -42,4 +42,14 @@ return base::FeatureList::IsEnabled(::features::kTopDocumentIsolation); } +// static +bool SiteIsolationPolicy::AreIsolatedOriginsEnabled() { + // TODO(alexmos): This currently assumes that isolated origins are only added + // via the command-line switch, which may not be true in the future. Remove + // this function when AreCrossProcessFramesPossible becomes true on Android + // above. + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kIsolateOrigins); +} + } // namespace content
diff --git a/content/common/site_isolation_policy.h b/content/common/site_isolation_policy.h index 3e70f64..84d87a9 100644 --- a/content/common/site_isolation_policy.h +++ b/content/common/site_isolation_policy.h
@@ -41,6 +41,11 @@ // different process from the main frame. static bool IsTopDocumentIsolationEnabled(); + // Returns true if there exist origins that require process isolation. Such + // origins require a dedicated process, and hence they make cross-process + // iframes possible. + static bool AreIsolatedOriginsEnabled(); + private: SiteIsolationPolicy(); // Not instantiable.
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc index 5602261..b071e6b 100644 --- a/content/common/user_agent.cc +++ b/content/common/user_agent.cc
@@ -78,11 +78,7 @@ #endif #if defined(OS_ANDROID) - std::string android_version_str; - base::StringAppendF( - &android_version_str, "%d.%d", os_major_version, os_minor_version); - if (os_bugfix_version != 0) - base::StringAppendF(&android_version_str, ".%d", os_bugfix_version); + std::string android_version_str = base::SysInfo::OperatingSystemVersion(); std::string android_info_str;
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 3a01702..0f91ff0b 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -589,6 +589,11 @@ // connection from the browser before killing itself. const char kIPCConnectionTimeout[] = "ipc-connection-timeout"; +// Require dedicated processes for a set of origins, specified as a +// comma-separated list. For example: +// --isolate-origins=https://www.foo.com,https://www.bar.com +const char kIsolateOrigins[] = "isolate-origins"; + // Chrome is running in Mash. const char kIsRunningInMash[] = "is-running-in-mash";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 2638248..eb66c49e 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -180,6 +180,7 @@ CONTENT_EXPORT extern const char kInertVisualViewport[]; CONTENT_EXPORT extern const char kInProcessGPU[]; CONTENT_EXPORT extern const char kIPCConnectionTimeout[]; +CONTENT_EXPORT extern const char kIsolateOrigins[]; CONTENT_EXPORT extern const char kIsRunningInMash[]; CONTENT_EXPORT extern const char kJavaScriptFlags[]; CONTENT_EXPORT extern const char kJavaScriptHarmony[];
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index a5d2f98..c6fb195 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -637,6 +637,7 @@ "../browser/indexed_db/indexed_db_browsertest.cc", "../browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc", "../browser/indexed_db/mock_browsertest_indexed_db_class_factory.h", + "../browser/isolated_origin_browsertest.cc", "../browser/loader/async_resource_handler_browsertest.cc", "../browser/loader/cross_site_resource_handler_browsertest.cc", "../browser/loader/reload_cache_control_browsertest.cc",
diff --git a/gpu/command_buffer/service/command_buffer_direct.cc b/gpu/command_buffer/service/command_buffer_direct.cc index 2f1643d..765edd1b 100644 --- a/gpu/command_buffer/service/command_buffer_direct.cc +++ b/gpu/command_buffer/service/command_buffer_direct.cc
@@ -32,7 +32,7 @@ AsyncAPIInterface* handler, const MakeCurrentCallback& callback, SyncPointManager* sync_point_manager) - : service_(transfer_buffer_manager, handler), + : service_(this, transfer_buffer_manager, handler), make_current_callback_(callback), sync_point_manager_(sync_point_manager), command_buffer_id_( @@ -133,6 +133,13 @@ service_.DestroyTransferBuffer(id); } +CommandBufferServiceClient::CommandBatchProcessedResult +CommandBufferDirect::OnCommandBatchProcessed() { + return kContinueExecution; +} + +void CommandBufferDirect::OnParseError() {} + gpu::CommandBufferNamespace CommandBufferDirect::GetNamespaceID() const { return gpu::CommandBufferNamespace::IN_PROCESS; }
diff --git a/gpu/command_buffer/service/command_buffer_direct.h b/gpu/command_buffer/service/command_buffer_direct.h index 4bcbe4e..1c94cc6 100644 --- a/gpu/command_buffer/service/command_buffer_direct.h +++ b/gpu/command_buffer/service/command_buffer_direct.h
@@ -20,7 +20,8 @@ class SyncPointOrderData; struct SyncToken; -class GPU_EXPORT CommandBufferDirect : public CommandBuffer { +class GPU_EXPORT CommandBufferDirect : public CommandBuffer, + public CommandBufferServiceClient { public: using MakeCurrentCallback = base::Callback<bool()>; @@ -47,6 +48,10 @@ scoped_refptr<Buffer> CreateTransferBuffer(size_t size, int32_t* id) override; void DestroyTransferBuffer(int32_t id) override; + // CommandBufferServiceBase implementation: + CommandBatchProcessedResult OnCommandBatchProcessed() override; + void OnParseError() override; + CommandBufferNamespace GetNamespaceID() const; CommandBufferId GetCommandBufferID() const;
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc index c4765b4..edbf4e1 100644 --- a/gpu/command_buffer/service/command_buffer_service.cc +++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -40,9 +40,15 @@ } // anonymous namespace CommandBufferService::CommandBufferService( + CommandBufferServiceClient* client, TransferBufferManager* transfer_buffer_manager, AsyncAPIInterface* handler) - : transfer_buffer_manager_(transfer_buffer_manager), handler_(handler) { + : client_(client), + transfer_buffer_manager_(transfer_buffer_manager), + handler_(handler) { + DCHECK(client_); + DCHECK(transfer_buffer_manager_); + DCHECK(handler_); state_.token = 0; } @@ -69,12 +75,14 @@ DCHECK(scheduled()); + if (paused_) { + paused_ = false; + TRACE_COUNTER_ID1("gpu", "CommandBufferService::Paused", this, paused_); + } + error::Error error = error::kNoError; handler_->BeginDecoding(); while (put_offset_ != state_.get_offset) { - if (PauseExecution()) - break; - error = ProcessCommands(kParseCommandsSlice); if (error::IsError(error)) { @@ -82,8 +90,12 @@ break; } - if (!command_processed_callback_.is_null()) - command_processed_callback_.Run(); + if (client_->OnCommandBatchProcessed() == + CommandBufferServiceClient::kPauseExecution) { + paused_ = true; + TRACE_COUNTER_ID1("gpu", "CommandBufferService::Paused", this, paused_); + break; + } if (!scheduled()) break; @@ -194,8 +206,7 @@ void CommandBufferService::SetParseError(error::Error error) { if (state_.error == error::kNoError) { state_.error = error; - if (!parse_error_callback_.is_null()) - parse_error_callback_.Run(); + client_->OnParseError(); } } @@ -204,39 +215,12 @@ state_.context_lost_reason = reason; } -void CommandBufferService::SetPauseExecutionCallback( - const PauseExecutionCallback& callback) { - pause_execution_callback_ = callback; -} - -void CommandBufferService::SetCommandProcessedCallback( - const base::Closure& callback) { - command_processed_callback_ = callback; -} - -void CommandBufferService::SetParseErrorCallback( - const base::Closure& callback) { - parse_error_callback_ = callback; -} - void CommandBufferService::SetScheduled(bool scheduled) { TRACE_EVENT2("gpu", "CommandBufferService:SetScheduled", "this", this, "scheduled", scheduled); scheduled_ = scheduled; } -bool CommandBufferService::PauseExecution() { - if (pause_execution_callback_.is_null()) - return false; - - bool pause = pause_execution_callback_.Run(); - if (paused_ != pause) { - TRACE_COUNTER_ID1("gpu", "CommandBufferService::Paused", this, pause); - paused_ = pause; - } - return pause; -} - error::Error CommandBufferService::ProcessCommands(int num_commands) { int num_entries = put_offset_ < state_.get_offset ? num_entries_ - state_.get_offset
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h index 96296c2..730a9a1 100644 --- a/gpu/command_buffer/service/command_buffer_service.h +++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -46,6 +46,24 @@ virtual void SetContextLostReason(error::ContextLostReason) = 0; }; +class GPU_EXPORT CommandBufferServiceClient { + public: + enum CommandBatchProcessedResult { + kContinueExecution, + kPauseExecution, + }; + + virtual ~CommandBufferServiceClient() {} + + // Called every time a batch of commands was processed by the + // CommandBufferService. The return value indicates whether the + // CommandBufferService should continue execution of commands or pause it. + virtual CommandBatchProcessedResult OnCommandBatchProcessed() = 0; + + // Called when the CommandBufferService gets into an error state. + virtual void OnParseError() = 0; +}; + union CommandBufferEntry; // An object that implements a shared memory command buffer and a synchronous @@ -53,9 +71,9 @@ class GPU_EXPORT CommandBufferService : public CommandBufferServiceBase { public: static const int kParseCommandsSlice = 20; - using PauseExecutionCallback = base::Callback<bool(void)>; - CommandBufferService(TransferBufferManager* transfer_buffer_manager, + CommandBufferService(CommandBufferServiceClient* client, + TransferBufferManager* transfer_buffer_manager, AsyncAPIInterface* handler); ~CommandBufferService() override; @@ -67,10 +85,6 @@ void SetParseError(error::Error error) override; void SetContextLostReason(error::ContextLostReason) override; - void SetPauseExecutionCallback(const PauseExecutionCallback& callback); - void SetCommandProcessedCallback(const base::Closure& callback); - void SetParseErrorCallback(const base::Closure& callback); - // Setup the shared memory that shared state should be copied into. void SetSharedStateBuffer(std::unique_ptr<BufferBacking> shared_state_buffer); @@ -109,9 +123,9 @@ int32_t put_offset() const { return put_offset_; } private: - bool PauseExecution(); error::Error ProcessCommands(int num_commands); + CommandBufferServiceClient* client_; TransferBufferManager* transfer_buffer_manager_; AsyncAPIInterface* handler_; @@ -126,11 +140,6 @@ std::unique_ptr<BufferBacking> shared_state_buffer_; CommandBufferSharedState* shared_state_ = nullptr; - // If this callback returns true, exit FlushHelper early. - PauseExecutionCallback pause_execution_callback_; - base::Closure command_processed_callback_; - base::Closure parse_error_callback_; - // Whether the scheduler is currently able to process more commands. bool scheduled_ = true; bool paused_ = false;
diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc index d5df30d..1e249a9 100644 --- a/gpu/command_buffer/service/command_buffer_service_unittest.cc +++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc
@@ -27,7 +27,8 @@ // Test fixture for CommandBufferService test - Creates a mock // AsyncAPIInterface, and a fixed size memory buffer. Also provides a simple API // to create a CommandBufferService. -class CommandBufferServiceTest : public testing::Test { +class CommandBufferServiceTest : public testing::Test, + public CommandBufferServiceClient { public: MOCK_METHOD0(OnCommandProcessed, void()); @@ -48,9 +49,7 @@ void MakeService(unsigned int entry_count) { transfer_buffer_manager_ = base::MakeUnique<TransferBufferManager>(nullptr); command_buffer_service_ = base::MakeUnique<CommandBufferService>( - transfer_buffer_manager_.get(), api_mock()); - command_buffer_service_->SetParseErrorCallback(base::Bind( - &CommandBufferServiceTest::OnParseError, base::Unretained(this))); + this, transfer_buffer_manager_.get(), api_mock()); SetNewGetBuffer(entry_count * sizeof(CommandBufferEntry)); } @@ -92,6 +91,10 @@ Mock::VerifyAndClearExpectations(api_mock()); } + // CommandBufferServiceBase implementation: + CommandBatchProcessedResult OnCommandBatchProcessed() override { + return kContinueExecution; + } MOCK_METHOD0(OnParseError, void()); private: @@ -397,16 +400,6 @@ Mock::VerifyAndClearExpectations(this); } -TEST_F(CommandBufferServiceTest, CommandsProcessed) { - MakeService(3); - command_buffer_service()->SetCommandProcessedCallback(base::Bind( - &CommandBufferServiceTest::OnCommandProcessed, base::Unretained(this))); - AddDoCommandsExpect(error::kNoError, 2, 1); - AddDoCommandsExpect(error::kNoError, 1, 1); - EXPECT_CALL(*this, OnCommandProcessed()).Times(2); - EXPECT_EQ(error::kNoError, SetPutAndProcessAllCommands(2)); -} - class CommandBufferServicePauseExecutionTest : public CommandBufferServiceTest { public: // Will pause the command buffer execution after 2 runs. @@ -414,36 +407,35 @@ const volatile void* buffer, int num_entries, int* entries_processed) { - ++calls_; - if (calls_ == 2) - pause_ = true; *entries_processed = 1; return error::kNoError; } - bool PauseExecution() { return pause_; } + CommandBatchProcessedResult OnCommandBatchProcessed() override { + ++calls_; + if (calls_ == 2) + pause_ = true; + return pause_ ? kPauseExecution : kContinueExecution; + } protected: int calls_ = 0; bool pause_ = false; }; +TEST_F(CommandBufferServicePauseExecutionTest, CommandsProcessed) { + MakeService(3); + AddDoCommandsExpect(error::kNoError, 2, 1); + AddDoCommandsExpect(error::kNoError, 1, 1); + EXPECT_EQ(error::kNoError, SetPutAndProcessAllCommands(2)); + EXPECT_EQ(2, calls_); +} + TEST_F(CommandBufferServicePauseExecutionTest, PauseExecution) { MakeService(5); - command_buffer_service()->SetPauseExecutionCallback( - base::Bind(&CommandBufferServicePauseExecutionTest::PauseExecution, - base::Unretained(this))); - EXPECT_CALL(*api_mock(), DoCommands(_, _, _, _)) - .WillRepeatedly( - Invoke(this, &CommandBufferServicePauseExecutionTest::DoCommands)); // Command buffer processing should stop after 2 commands. - EXPECT_EQ(error::kNoError, SetPutAndProcessAllCommands(4)); - EXPECT_EQ(2, GetGet()); - EXPECT_EQ(4, GetPut()); - EXPECT_EQ(2, calls_); - EXPECT_TRUE(pause_); - - // Processing shouldn't do anything while paused. + AddDoCommandsExpect(error::kNoError, 4, 1); + AddDoCommandsExpect(error::kNoError, 3, 1); EXPECT_EQ(error::kNoError, SetPutAndProcessAllCommands(4)); EXPECT_EQ(2, GetGet()); EXPECT_EQ(4, GetPut()); @@ -452,6 +444,8 @@ // Processing should continue after resume. pause_ = false; + AddDoCommandsExpect(error::kNoError, 2, 1); + AddDoCommandsExpect(error::kNoError, 1, 1); EXPECT_EQ(error::kNoError, SetPutAndProcessAllCommands(4)); EXPECT_EQ(4, GetGet()); EXPECT_EQ(4, GetPut());
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 7c982457..5dbc207 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1916,9 +1916,16 @@ // state of |texture| is updated to reflect the new state. void DoCopyTexImage(Texture* texture, GLenum textarget, gl::GLImage* image); - // This will call DoCopyTexImage if texture has an image but that image is - // not bound or copied to the texture. - void DoCopyTexImageIfNeeded(Texture* texture, GLenum textarget); + // If the texture has an image but that image is not bound or copied to the + // texture, this will first attempt to bind it, and if that fails + // DoCopyTexImage on it. texture_unit is the texture unit it should be bound + // to, or 0 if it doesn't matter - setting it to 0 will cause the previous + // binding to be restored after the operation. This returns true if a copy + // or bind happened and the caller needs to restore the previous texture + // binding. + bool DoBindOrCopyTexImageIfNeeded(Texture* texture, + GLenum textarget, + GLuint texture_unit); // Returns false if textures were replaced. bool PrepareTexturesForRender(); @@ -2522,9 +2529,12 @@ ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state_, function_name_); } -static void RestoreCurrentTextureBindings(ContextState* state, GLenum target) { +static void RestoreCurrentTextureBindings(ContextState* state, + GLenum target, + GLuint texture_unit) { DCHECK(!state->texture_units.empty()); - TextureUnit& info = state->texture_units[0]; + DCHECK_LT(texture_unit, state->texture_units.size()); + TextureUnit& info = state->texture_units[texture_unit]; GLuint last_id; TextureRef* texture_ref = info.GetInfoForTarget(target); if (texture_ref) { @@ -2534,7 +2544,6 @@ } glBindTexture(target, last_id); - glActiveTexture(GL_TEXTURE0 + state->active_texture_unit); } ScopedTextureBinder::ScopedTextureBinder(ContextState* state, @@ -2554,7 +2563,8 @@ ScopedTextureBinder::~ScopedTextureBinder() { ScopedGLErrorSuppressor suppressor( "ScopedTextureBinder::dtor", state_->GetErrorState()); - RestoreCurrentTextureBindings(state_, target_); + RestoreCurrentTextureBindings(state_, target_, 0); + state_->RestoreActiveTexture(); } ScopedRenderBufferBinder::ScopedRenderBufferBinder(ContextState* state, @@ -7782,7 +7792,7 @@ } if (texture_ref) - DoCopyTexImageIfNeeded(texture_ref->texture(), textarget); + DoBindOrCopyTexImageIfNeeded(texture_ref->texture(), textarget, 0); std::vector<GLenum> attachments; if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { @@ -9660,20 +9670,33 @@ DCHECK(rv) << "CopyTexImage() failed"; } -void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture, - GLenum textarget) { +bool GLES2DecoderImpl::DoBindOrCopyTexImageIfNeeded(Texture* texture, + GLenum textarget, + GLuint texture_unit) { // Image is already in use if texture is attached to a framebuffer. if (texture && !texture->IsAttachedToFramebuffer()) { Texture::ImageState image_state; gl::GLImage* image = texture->GetLevelImage(textarget, 0, &image_state); if (image && image_state == Texture::UNBOUND) { ScopedGLErrorSuppressor suppressor( - "GLES2DecoderImpl::DoCopyTexImageIfNeeded", GetErrorState()); + "GLES2DecoderImpl::DoBindOrCopyTexImageIfNeeded", GetErrorState()); + if (texture_unit) + glActiveTexture(texture_unit); glBindTexture(textarget, texture->service_id()); - DoCopyTexImage(texture, textarget, image); - RestoreCurrentTextureBindings(&state_, textarget); + if (image->BindTexImage(textarget)) { + image_state = Texture::BOUND; + } else { + DoCopyTexImage(texture, textarget, image); + } + if (!texture_unit) { + RestoreCurrentTextureBindings(&state_, textarget, + state_.active_texture_unit); + return false; + } + return true; } } + return false; } void GLES2DecoderImpl::DoCopyBufferSubData(GLenum readtarget, @@ -9728,16 +9751,9 @@ if (textarget != GL_TEXTURE_CUBE_MAP) { Texture* texture = texture_ref->texture(); - Texture::ImageState image_state; - gl::GLImage* image = - texture->GetLevelImage(textarget, 0, &image_state); - if (image && image_state == Texture::UNBOUND && - !texture->IsAttachedToFramebuffer()) { - ScopedGLErrorSuppressor suppressor( - "GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState()); + if (DoBindOrCopyTexImageIfNeeded(texture, textarget, + GL_TEXTURE0 + texture_unit_index)) { textures_set = true; - glActiveTexture(GL_TEXTURE0 + texture_unit_index); - DoCopyTexImage(texture, textarget, image); continue; } } @@ -16921,7 +16937,8 @@ dest_type, nullptr); GLenum error = LOCAL_PEEK_GL_ERROR(kFunctionName); if (error != GL_NO_ERROR) { - RestoreCurrentTextureBindings(&state_, dest_binding_target); + RestoreCurrentTextureBindings(&state_, dest_binding_target, + state_.active_texture_unit); return; } @@ -16946,7 +16963,7 @@ return; } - DoCopyTexImageIfNeeded(source_texture, source_target); + DoBindOrCopyTexImageIfNeeded(source_texture, source_target, 0); // GL_TEXTURE_EXTERNAL_OES texture requires that we apply a transform matrix // before presenting. @@ -17158,7 +17175,7 @@ } } - DoCopyTexImageIfNeeded(source_texture, source_target); + DoBindOrCopyTexImageIfNeeded(source_texture, source_target, 0); // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix // before presenting. @@ -17335,7 +17352,8 @@ NULL); GLenum error = LOCAL_PEEK_GL_ERROR(kFunctionName); if (error != GL_NO_ERROR) { - RestoreCurrentTextureBindings(&state_, dest_texture->target()); + RestoreCurrentTextureBindings(&state_, dest_texture->target(), + state_.active_texture_unit); return; } @@ -17356,7 +17374,7 @@ "gpu", "GLES2DecoderImpl::DoCompressedCopyTextureCHROMIUM, fallback"); - DoCopyTexImageIfNeeded(source_texture, source_texture->target()); + DoBindOrCopyTexImageIfNeeded(source_texture, source_texture->target(), 0); // As a fallback, copy into a non-compressed GL_RGBA texture. LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(kFunctionName); @@ -17364,7 +17382,8 @@ 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); GLenum error = LOCAL_PEEK_GL_ERROR(kFunctionName); if (error != GL_NO_ERROR) { - RestoreCurrentTextureBindings(&state_, dest_texture->target()); + RestoreCurrentTextureBindings(&state_, dest_texture->target(), + state_.active_texture_unit); return; } @@ -17682,7 +17701,7 @@ texture_ref = CreateTexture(client_id, service_id); texture_manager()->SetTarget(texture_ref, target); glBindTexture(target, service_id); - RestoreCurrentTextureBindings(&state_, target); + RestoreCurrentTextureBindings(&state_, target, state_.active_texture_unit); } }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc index d95c373..6e25022e 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -3128,9 +3128,11 @@ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, _)) .Times(2) .RetiresOnSaturation(); - EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) - .Times(1) - .RetiresOnSaturation(); + EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)).Times(1).RetiresOnSaturation(); + + ActiveTexture& texture_cmd = *GetImmediateAs<ActiveTexture>(); + texture_cmd.Init(GL_TEXTURE1); + EXPECT_EQ(error::kNoError, ExecuteCmd(texture_cmd)); CreateAndConsumeTextureINTERNALImmediate& consume_cmd = *GetImmediateAs<CreateAndConsumeTextureINTERNALImmediate>(); @@ -3175,9 +3177,11 @@ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, _)) .Times(2) .RetiresOnSaturation(); - EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) - .Times(1) - .RetiresOnSaturation(); + EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)).Times(1).RetiresOnSaturation(); + + ActiveTexture& texture_cmd = *GetImmediateAs<ActiveTexture>(); + texture_cmd.Init(GL_TEXTURE1); + EXPECT_EQ(error::kNoError, ExecuteCmd(texture_cmd)); // Attempt to consume the mailbox with a different target. GLuint new_texture_id = kNewClientId; @@ -3561,7 +3565,7 @@ // Bind image to texture. EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) .Times(1) - .WillOnce(Return(false)) + .WillRepeatedly(Return(false)) .RetiresOnSaturation(); EXPECT_CALL(*image.get(), GetSize()) .Times(1) @@ -3573,6 +3577,13 @@ .RetiresOnSaturation(); // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId); + Mock::VerifyAndClearExpectations(gl_.get()); + + EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)).Times(1).RetiresOnSaturation(); + ActiveTexture texture_cmd; + texture_cmd.Init(GL_TEXTURE1); + EXPECT_EQ(error::kNoError, ExecuteCmd(texture_cmd)); + Mock::VerifyAndClearExpectations(gl_.get()); AddExpectationsForSimulatedAttrib0(kNumVertices, 0); SetupExpectationsForApplyingDefaultDirtyState(); @@ -3582,27 +3593,45 @@ .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)).Times(2).RetiresOnSaturation(); - EXPECT_CALL(*image.get(), CopyTexImage(GL_TEXTURE_2D)) - .Times(1) - .WillOnce(Return(true)) - .RetiresOnSaturation(); - EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) + EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)) .Times(1) .RetiresOnSaturation(); + { + InSequence seq; + EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) + .Times(1) + .WillRepeatedly(Return(false)) + .RetiresOnSaturation(); + EXPECT_CALL(*image.get(), CopyTexImage(GL_TEXTURE_2D)) + .Times(1) + .WillOnce(Return(true)) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)) + .Times(1) + .RetiresOnSaturation(); + } + DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); + + Mock::VerifyAndClearExpectations(gl_.get()); // Re-bind image to texture. ReleaseTexImage2DCHROMIUM release_tex_image_2d_cmd; release_tex_image_2d_cmd.Init(GL_TEXTURE_2D, kImageId); EXPECT_EQ(error::kNoError, ExecuteCmd(release_tex_image_2d_cmd)); EXPECT_CALL(*image.get(), BindTexImage(GL_TEXTURE_2D)) - .Times(1) - .WillOnce(Return(false)) + .Times(2) + .WillRepeatedly(Return(false)) .RetiresOnSaturation(); EXPECT_CALL(*image.get(), GetSize()) .Times(1) @@ -3621,7 +3650,6 @@ .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)).Times(1).RetiresOnSaturation(); EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)) .Times(2) .RetiresOnSaturation();
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json index 38e15cf..15aa3aa3 100644 --- a/gpu/config/gpu_driver_bug_list.json +++ b/gpu/config/gpu_driver_bug_list.json
@@ -1,6 +1,6 @@ { "name": "gpu driver bug list", - "version": "10.9", + "version": "10.10", "entries": [ { "id": 1, @@ -1053,7 +1053,10 @@ { "id": 116, "description": "Adreno 420 support for EXT_multisampled_render_to_texture is buggy on Android < 5.1", - "cr_bugs": [490379], + "comment": [ + "Disabling EXT_multisampled_render_to_texture triggers the explicit multisample resolve path, which is broken on Adreno 4xx/5xx." + ], + "cr_bugs": [490379, 696126], "os": { "type": "android", "version": { @@ -1064,6 +1067,9 @@ "gl_renderer": "Adreno \\(TM\\) 4.*", "disabled_extensions": [ "GL_EXT_multisampled_render_to_texture" + ], + "features": [ + "disable_chromium_framebuffer_multisample" ] }, { @@ -1739,7 +1745,7 @@ "id": 174, "description": "Adreno 4xx support for EXT_multisampled_render_to_texture is buggy on Android 7.0", "comment": [ - "Disabling EXT_multisampled_render_to_texture triggers the explicit multisample resolve path, which is broken on the same configurations. (See also software rendering list entry #147.)" + "Disabling EXT_multisampled_render_to_texture triggers the explicit multisample resolve path, which is broken on Adreno 4xx/5xx." ], "cr_bugs": [612474, 696126], "os": { @@ -1762,7 +1768,10 @@ { "id": 175, "description": "Adreno 5xx support for EXT_multisampled_render_to_texture is buggy on Android < 7.0", - "cr_bugs": [612474], + "comment": [ + "Disabling EXT_multisampled_render_to_texture triggers the explicit multisample resolve path, which is broken on Adreno 4xx/5xx." + ], + "cr_bugs": [612474, 696126], "os": { "type": "android", "version": { @@ -1773,6 +1782,9 @@ "gl_renderer": "Adreno \\(TM\\) 5.*", "disabled_extensions": [ "GL_EXT_multisampled_render_to_texture" + ], + "features": [ + "disable_chromium_framebuffer_multisample" ] }, { @@ -2160,7 +2172,10 @@ { "id": 205, "description": "Adreno 5xx support for EXT_multisampled_render_to_texture is buggy on Android 7.1", - "cr_bugs": [663811], + "comment": [ + "Disabling EXT_multisampled_render_to_texture triggers the explicit multisample resolve path, which is broken on Adreno 4xx/5xx." + ], + "cr_bugs": [663811, 696126], "os": { "type": "android", "version": { @@ -2171,6 +2186,9 @@ "gl_renderer": "Adreno \\(TM\\) 5.*", "disabled_extensions": [ "GL_EXT_multisampled_render_to_texture" + ], + "features": [ + "disable_chromium_framebuffer_multisample" ] }, {
diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json index 620eb19..006cc6d 100644 --- a/gpu/config/software_rendering_list.json +++ b/gpu/config/software_rendering_list.json
@@ -1,6 +1,6 @@ { "name": "software rendering list", - "version": "13.7", + "version": "13.8", "entries": [ { "id": 1, @@ -1503,25 +1503,6 @@ "features": [ "webgl2" ] - }, - { - "id": 147, - "description": "Explicit multisample resolve is broken on Adreno 4xx on Android 7.0", - "comment": "Corresponds to GPU driver bug #174", - "cr_bugs": [696126], - "os": { - "type": "android", - "version": { - "op": "between", - "value": "7.0.0", - "value2": "7.0.99", - "comment": "Only initial version of N." - } - }, - "gl_renderer": "Adreno \\(TM\\) 4.*", - "features": [ - "webgl2" - ] } ], "comment": [
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc index d8a4008..1fcfeeb 100644 --- a/gpu/ipc/in_process_command_buffer.cc +++ b/gpu/ipc/in_process_command_buffer.cc
@@ -309,9 +309,7 @@ decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); command_buffer_ = base::MakeUnique<CommandBufferService>( - transfer_buffer_manager_.get(), decoder_.get()); - command_buffer_->SetParseErrorCallback(base::Bind( - &InProcessCommandBuffer::OnContextLostOnGpuThread, gpu_thread_weak_ptr_)); + this, transfer_buffer_manager_.get(), decoder_.get()); decoder_->set_command_buffer_service(command_buffer_.get()); @@ -472,7 +470,12 @@ DCHECK(!sequence_checker_ || sequence_checker_->CalledOnValidSequence()); } -void InProcessCommandBuffer::OnContextLostOnGpuThread() { +CommandBufferServiceClient::CommandBatchProcessedResult +InProcessCommandBuffer::OnCommandBatchProcessed() { + return kContinueExecution; +} + +void InProcessCommandBuffer::OnParseError() { if (!origin_task_runner_) return OnContextLost(); // Just kidding, we're on the client thread. origin_task_runner_->PostTask(
diff --git a/gpu/ipc/in_process_command_buffer.h b/gpu/ipc/in_process_command_buffer.h index 48293f4..5e10bb1c 100644 --- a/gpu/ipc/in_process_command_buffer.h +++ b/gpu/ipc/in_process_command_buffer.h
@@ -25,6 +25,7 @@ #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/common/activity_flags.h" #include "gpu/command_buffer/common/command_buffer.h" +#include "gpu/command_buffer/service/command_buffer_service.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/config/gpu_driver_bug_workarounds.h" @@ -66,7 +67,6 @@ class ShaderTranslatorCache; } -class CommandBufferService; class GpuMemoryBufferManager; class ImageFactory; class TransferBufferManager; @@ -77,6 +77,7 @@ // class) from different client threads is undefined. class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer, public GpuControl, + public CommandBufferServiceClient, public ImageTransportSurfaceDelegate { public: class Service; @@ -139,6 +140,10 @@ void AddLatencyInfo( const std::vector<ui::LatencyInfo>& latency_info) override; + // CommandBufferServiceClient implementation: + CommandBatchProcessedResult OnCommandBatchProcessed() override; + void OnParseError() override; + // ImageTransportSurfaceDelegate implementation: #if defined(OS_WIN) void DidCreateAcceleratedSurfaceChildWindow( @@ -270,8 +275,6 @@ void SetGetBufferOnGpuThread(int32_t shm_id, base::WaitableEvent* completion); // Callbacks on the gpu thread. - void OnContextLostOnGpuThread(); - void PumpCommandsOnGpuThread(); void PerformDelayedWorkOnGpuThread(); // Callback implementations on the client thread. void OnContextLost();
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc index 6e6bb79f..89ba24c 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.cc +++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -637,21 +637,12 @@ decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); command_buffer_.reset(new CommandBufferService( - context_group_->transfer_buffer_manager(), decoder_.get())); + this, context_group_->transfer_buffer_manager(), decoder_.get())); sync_point_client_state_ = channel_->sync_point_manager()->CreateSyncPointClientState( CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_); - if (channel_->scheduler()) { - command_buffer_->SetPauseExecutionCallback( - base::Bind(&Scheduler::ShouldYield, - base::Unretained(channel_->scheduler()), sequence_id_)); - } else if (channel_->preempted_flag()) { - command_buffer_->SetPauseExecutionCallback( - base::Bind(&PreemptionFlag::IsSet, channel_->preempted_flag())); - } - decoder_->set_command_buffer_service(command_buffer_.get()); if (offscreen) { @@ -802,14 +793,6 @@ base::Bind(&GpuCommandBufferStub::OnRescheduleAfterFinished, base::Unretained(this))); - command_buffer_->SetParseErrorCallback( - base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this))); - - if (channel_->watchdog()) { - command_buffer_->SetCommandProcessedCallback(base::Bind( - &GpuCommandBufferStub::OnCommandProcessed, base::Unretained(this))); - } - const size_t kSharedStateSize = sizeof(CommandBufferSharedState); if (!shared_state_shm->Map(kSharedStateSize)) { DLOG(ERROR) << "Failed to map shared state buffer."; @@ -871,6 +854,19 @@ decoder_->ReturnFrontBuffer(mailbox, is_lost); } +CommandBufferServiceClient::CommandBatchProcessedResult +GpuCommandBufferStub::OnCommandBatchProcessed() { + if (channel_->watchdog()) + channel_->watchdog()->CheckArmed(); + bool pause = false; + if (channel_->scheduler()) { + pause = channel_->scheduler()->ShouldYield(sequence_id_); + } else if (channel_->preempted_flag()) { + pause = channel_->preempted_flag()->IsSet(); + } + return pause ? kPauseExecution : kContinueExecution; +} + void GpuCommandBufferStub::OnParseError() { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); DCHECK(command_buffer_.get()); @@ -1014,11 +1010,6 @@ command_buffer_->DestroyTransferBuffer(id); } -void GpuCommandBufferStub::OnCommandProcessed() { - DCHECK(channel_->watchdog()); - channel_->watchdog()->CheckArmed(); -} - void GpuCommandBufferStub::ReportState() { command_buffer_->UpdateState(); }
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.h b/gpu/ipc/service/gpu_command_buffer_stub.h index 3e9000f..1bc8325f 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.h +++ b/gpu/ipc/service/gpu_command_buffer_stub.h
@@ -54,6 +54,7 @@ class GPU_EXPORT GpuCommandBufferStub : public IPC::Listener, public IPC::Sender, + public CommandBufferServiceClient, public ImageTransportSurfaceDelegate, public base::SupportsWeakPtr<GpuCommandBufferStub> { public: @@ -90,6 +91,10 @@ // IPC::Sender implementation: bool Send(IPC::Message* msg) override; + // CommandBufferServiceClient implementation: + CommandBatchProcessedResult OnCommandBatchProcessed() override; + void OnParseError() override; + // ImageTransportSurfaceDelegate implementation: #if defined(OS_WIN) void DidCreateAcceleratedSurfaceChildWindow( @@ -193,8 +198,6 @@ void OnCreateStreamTexture(uint32_t texture_id, int32_t stream_id, bool* succeeded); - void OnCommandProcessed(); - void OnParseError(); void ReportState();
diff --git a/ios/web/public/favicon_url.h b/ios/web/public/favicon_url.h index 409f329..c0e1972 100644 --- a/ios/web/public/favicon_url.h +++ b/ios/web/public/favicon_url.h
@@ -20,7 +20,8 @@ INVALID_ICON = 0x0, FAVICON = 1 << 0, TOUCH_ICON = 1 << 1, - TOUCH_PRECOMPOSED_ICON = 1 << 2 + TOUCH_PRECOMPOSED_ICON = 1 << 2, + WEB_MANIFEST_ICON = 1 << 3, }; FaviconURL();
diff --git a/ios/web/public/web_state/navigation_context.h b/ios/web/public/web_state/navigation_context.h index ee7073b..cbfcc19c 100644 --- a/ios/web/public/web_state/navigation_context.h +++ b/ios/web/public/web_state/navigation_context.h
@@ -42,6 +42,15 @@ // * same document history navigation virtual bool IsSameDocument() const = 0; + // Whether the initial navigation is done using HTTP POST method. This will + // not change during the navigation (even after encountering a server + // redirect). + // + // Note: page and frame navigations can only be done using POST or GET + // methods Therefore API exposes only |bool IsPost()| as opposed to + // |const std::string& GetMethod()| method. + virtual bool IsPost() const = 0; + // Returns error if the navigation has failed. virtual NSError* GetError() const = 0;
diff --git a/ios/web/test/web_int_test.h b/ios/web/test/web_int_test.h index 4330b1f..4bd312eb 100644 --- a/ios/web/test/web_int_test.h +++ b/ios/web/test/web_int_test.h
@@ -51,6 +51,9 @@ // Navigates |web_state_| to |url| and waits for the page to be loaded. void LoadUrl(const GURL& url); + // Navigates |web_state_| using |params| and waits for the page to be loaded. + void LoadWithParams(const NavigationManager::WebLoadParams& params); + // Synchronously removes data from |data_store|. // |websiteDataTypes| is from the constants defined in // "WebKit/WKWebsiteDataRecord".
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm index e2dd64038..067e312a 100644 --- a/ios/web/test/web_int_test.mm +++ b/ios/web/test/web_int_test.mm
@@ -102,10 +102,16 @@ } void WebIntTest::LoadUrl(const GURL& url) { - ExecuteBlockAndWaitForLoad(url, ^{ - web::NavigationManager::WebLoadParams params(url); - params.transition_type = ui::PageTransition::PAGE_TRANSITION_TYPED; - navigation_manager()->LoadURLWithParams(params); + web::NavigationManager::WebLoadParams params(url); + params.transition_type = ui::PageTransition::PAGE_TRANSITION_TYPED; + LoadWithParams(params); +} + +void WebIntTest::LoadWithParams( + const NavigationManager::WebLoadParams& params) { + NavigationManager::WebLoadParams block_params(params); + ExecuteBlockAndWaitForLoad(params.url, ^{ + navigation_manager()->LoadURLWithParams(block_params); }); }
diff --git a/ios/web/web_state/navigation_callbacks_inttest.mm b/ios/web/web_state/navigation_callbacks_inttest.mm index 56e2e82..0b18bd3c 100644 --- a/ios/web/web_state/navigation_callbacks_inttest.mm +++ b/ios/web/web_state/navigation_callbacks_inttest.mm
@@ -6,6 +6,7 @@ #include <string> #include "base/memory/ptr_util.h" +#include "base/strings/stringprintf.h" #import "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h" #import "ios/web/public/test/http_server.h" @@ -38,6 +39,7 @@ PageTransitionCoreTypeIs(ui::PageTransition::PAGE_TRANSITION_TYPED, (*context)->GetPageTransition())); EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); ASSERT_FALSE((*context)->GetResponseHeaders()); NavigationManager* navigation_manager = web_state->GetNavigationManager(); @@ -58,6 +60,7 @@ PageTransitionCoreTypeIs(ui::PageTransition::PAGE_TRANSITION_TYPED, (*context)->GetPageTransition())); EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); ASSERT_TRUE((*context)->GetResponseHeaders()); std::string mime_type; @@ -69,6 +72,47 @@ EXPECT_EQ(url, item->GetURL()); } +// Verifies correctness of |NavigationContext| (|arg0|) for navigations via POST +// HTTP methods passed to |DidStartNavigation|. Stores |NavigationContext| in +// |context| pointer. +ACTION_P3(VerifyPostStartedContext, web_state, url, context) { + *context = arg0; + ASSERT_TRUE(*context); + EXPECT_EQ(web_state, (*context)->GetWebState()); + EXPECT_EQ(url, (*context)->GetUrl()); + EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_TRUE((*context)->IsPost()); + EXPECT_FALSE((*context)->GetError()); + ASSERT_FALSE((*context)->GetResponseHeaders()); + // TODO(crbug.com/676129): Reload does not create a pending item. Remove this + // workaround once the bug is fixed. + if (!ui::PageTransitionTypeIncludingQualifiersIs( + ui::PageTransition::PAGE_TRANSITION_RELOAD, + (*context)->GetPageTransition())) { + NavigationManager* navigation_manager = web_state->GetNavigationManager(); + NavigationItem* item = navigation_manager->GetPendingItem(); + EXPECT_EQ(url, item->GetURL()); + } +} + +// Verifies correctness of |NavigationContext| (|arg0|) for navigations via POST +// HTTP methods passed to |DidFinishNavigation|. Stores |NavigationContext| in +// |context| pointer. +ACTION_P3(VerifyPostFinishedContext, web_state, url, context) { + ASSERT_EQ(*context, arg0); + EXPECT_EQ(web_state, (*context)->GetWebState()); + ASSERT_TRUE((*context)); + EXPECT_EQ(web_state, (*context)->GetWebState()); + EXPECT_EQ(url, (*context)->GetUrl()); + EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_TRUE((*context)->IsPost()); + EXPECT_FALSE((*context)->GetError()); + NavigationManager* navigation_manager = web_state->GetNavigationManager(); + NavigationItem* item = navigation_manager->GetLastCommittedItem(); + EXPECT_GT(item->GetTimestamp().ToInternalValue(), 0); + EXPECT_EQ(url, item->GetURL()); +} + // Verifies correctness of |NavigationContext| (|arg0|) for same page navigation // passed to |DidFinishNavigation|. Stores |NavigationContext| in |context| // pointer. @@ -84,6 +128,7 @@ EXPECT_TRUE(PageTransitionTypeIncludingQualifiersIs( page_transition, (*context)->GetPageTransition())); EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); EXPECT_FALSE((*context)->GetResponseHeaders()); } @@ -103,6 +148,7 @@ EXPECT_TRUE(PageTransitionTypeIncludingQualifiersIs( page_transition, (*context)->GetPageTransition())); EXPECT_TRUE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); EXPECT_FALSE((*context)->GetResponseHeaders()); NavigationManager* navigation_manager = web_state->GetNavigationManager(); @@ -123,6 +169,7 @@ PageTransitionCoreTypeIs(ui::PageTransition::PAGE_TRANSITION_TYPED, (*context)->GetPageTransition())); EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); EXPECT_FALSE((*context)->GetResponseHeaders()); NavigationManager* navigation_manager = web_state->GetNavigationManager(); @@ -142,6 +189,7 @@ PageTransitionCoreTypeIs(ui::PageTransition::PAGE_TRANSITION_TYPED, (*context)->GetPageTransition())); EXPECT_FALSE((*context)->IsSameDocument()); + EXPECT_FALSE((*context)->IsPost()); EXPECT_FALSE((*context)->GetError()); EXPECT_FALSE((*context)->GetResponseHeaders()); NavigationManager* navigation_manager = web_state->GetNavigationManager(); @@ -404,4 +452,131 @@ navigation_manager()->Reload(ReloadType::NORMAL, false /*check_for_repost*/); } +// Tests successful navigation to a new page with post HTTP method. +TEST_F(StartAndFinishNavigationTest, UserInitiatedPostNavigation) { + const GURL url = HttpServer::MakeUrl("http://chromium.test"); + std::map<GURL, std::string> responses; + responses[url] = "Chromium Test"; + web::test::SetUpSimpleHttpServer(responses); + + // Perform new page navigation. + NavigationContext* context = nullptr; + EXPECT_CALL(*observer_, DidStartNavigation(_)) + .WillOnce(VerifyPostStartedContext(web_state(), url, &context)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)) + .WillOnce(VerifyPostFinishedContext(web_state(), url, &context)); + + // Load request using POST HTTP method. + web::NavigationManager::WebLoadParams params(url); + params.post_data.reset( + [[@"foo" dataUsingEncoding:NSUTF8StringEncoding] retain]); + params.extra_headers.reset([@{ @"Content-Type" : @"text/html" } retain]); + LoadWithParams(params); +} + +// Tests successful navigation to a new page with post HTTP method. +TEST_F(StartAndFinishNavigationTest, RendererInitiatedPostNavigation) { + const GURL url = HttpServer::MakeUrl("http://chromium.test"); + std::map<GURL, std::string> responses; + responses[url] = "<form method='post' id='form'></form>"; + web::test::SetUpSimpleHttpServer(responses); + + // Perform new page navigation. + NavigationContext* context = nullptr; + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + LoadUrl(url); + + // Submit the form using JavaScript. + EXPECT_CALL(*observer_, DidStartNavigation(_)) + .WillOnce(VerifyPostStartedContext(web_state(), url, &context)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)) + .WillOnce(VerifyPostFinishedContext(web_state(), url, &context)); + ExecuteJavaScript(@"window.document.getElementById('form').submit();"); +} + +// Tests successful reload of a page returned for post request. +TEST_F(StartAndFinishNavigationTest, ReloadPostNavigation) { + const GURL url = HttpServer::MakeUrl("http://chromium.test"); + std::map<GURL, std::string> responses; + const GURL action = HttpServer::MakeUrl("http://action.test"); + responses[url] = + base::StringPrintf("<form method='post' id='form' action='%s'></form>", + action.spec().c_str()); + web::test::SetUpSimpleHttpServer(responses); + + // Perform new page navigation. + NavigationContext* context = nullptr; + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + LoadUrl(url); + + // Submit the form using JavaScript. + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + ExecuteBlockAndWaitForLoad(action, ^{ + ExecuteJavaScript(@"window.document.getElementById('form').submit();"); + }); + + // Reload the page. + EXPECT_CALL(*observer_, DidStartNavigation(_)) + .WillOnce(VerifyPostStartedContext(web_state(), action, &context)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)) + .WillOnce(VerifyPostFinishedContext(web_state(), action, &context)); + // TODO(crbug.com/700958): ios/web ignores |check_for_repost| flag and current + // delegate does not run callback for ShowRepostFormWarningDialog. Clearing + // the delegate will allow form resubmission. Remove this workaround (clearing + // the delegate, once |check_for_repost| is supported). + web_state()->SetDelegate(nullptr); + ExecuteBlockAndWaitForLoad(action, ^{ + navigation_manager()->Reload(ReloadType::NORMAL, + false /*check_for_repost*/); + }); +} + +// Tests going forward to a page rendered from post response. +TEST_F(StartAndFinishNavigationTest, ForwardPostNavigation) { + const GURL url = HttpServer::MakeUrl("http://chromium.test"); + std::map<GURL, std::string> responses; + const GURL action = HttpServer::MakeUrl("http://action.test"); + responses[url] = + base::StringPrintf("<form method='post' id='form' action='%s'></form>", + action.spec().c_str()); + web::test::SetUpSimpleHttpServer(responses); + + // Perform new page navigation. + NavigationContext* context = nullptr; + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + LoadUrl(url); + + // Submit the form using JavaScript. + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + ExecuteBlockAndWaitForLoad(action, ^{ + ExecuteJavaScript(@"window.document.getElementById('form').submit();"); + }); + + // Go Back. + EXPECT_CALL(*observer_, DidStartNavigation(_)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)); + ExecuteBlockAndWaitForLoad(url, ^{ + navigation_manager()->GoBack(); + }); + + // Go forward. + EXPECT_CALL(*observer_, DidStartNavigation(_)) + .WillOnce(VerifyPostStartedContext(web_state(), action, &context)); + EXPECT_CALL(*observer_, DidFinishNavigation(_)) + .WillOnce(VerifyPostFinishedContext(web_state(), action, &context)); + // TODO(crbug.com/700958): ios/web ignores |check_for_repost| flag and current + // delegate does not run callback for ShowRepostFormWarningDialog. Clearing + // the delegate will allow form resubmission. Remove this workaround (clearing + // the delegate, once |check_for_repost| is supported). + web_state()->SetDelegate(nullptr); + ExecuteBlockAndWaitForLoad(action, ^{ + navigation_manager()->GoForward(); + }); +} + } // namespace web
diff --git a/ios/web/web_state/navigation_context_impl.h b/ios/web/web_state/navigation_context_impl.h index ebb6608..6de51e7 100644 --- a/ios/web/web_state/navigation_context_impl.h +++ b/ios/web/web_state/navigation_context_impl.h
@@ -35,12 +35,14 @@ const GURL& GetUrl() const override; ui::PageTransition GetPageTransition() const override; bool IsSameDocument() const override; + bool IsPost() const override; NSError* GetError() const override; net::HttpResponseHeaders* GetResponseHeaders() const override; ~NavigationContextImpl() override; // Setters for navigation context data members. void SetIsSameDocument(bool is_same_document); + void SetIsPost(bool is_post); void SetError(NSError* error); void SetResponseHeaders( const scoped_refptr<net::HttpResponseHeaders>& response_headers); @@ -58,6 +60,7 @@ GURL url_; ui::PageTransition page_transition_; bool is_same_document_ = false; + bool is_post_ = false; base::scoped_nsobject<NSError> error_; scoped_refptr<net::HttpResponseHeaders> response_headers_; int navigation_item_unique_id_ = -1;
diff --git a/ios/web/web_state/navigation_context_impl.mm b/ios/web/web_state/navigation_context_impl.mm index 80a09c4..62cf17e 100644 --- a/ios/web/web_state/navigation_context_impl.mm +++ b/ios/web/web_state/navigation_context_impl.mm
@@ -48,6 +48,10 @@ return is_same_document_; } +bool NavigationContextImpl::IsPost() const { + return is_post_; +} + NSError* NavigationContextImpl::GetError() const { return error_; } @@ -60,6 +64,10 @@ is_same_document_ = is_same_document; } +void NavigationContextImpl::SetIsPost(bool is_post) { + is_post_ = is_post; +} + void NavigationContextImpl::SetError(NSError* error) { error_.reset(error); }
diff --git a/ios/web/web_state/navigation_context_impl_unittest.mm b/ios/web/web_state/navigation_context_impl_unittest.mm index 9729d51..7358b8ff 100644 --- a/ios/web/web_state/navigation_context_impl_unittest.mm +++ b/ios/web/web_state/navigation_context_impl_unittest.mm
@@ -55,12 +55,21 @@ ASSERT_TRUE(context); ASSERT_FALSE(context->IsSameDocument()); + ASSERT_FALSE(context->IsPost()); ASSERT_FALSE(context->GetError()); ASSERT_NE(response_headers_.get(), context->GetResponseHeaders()); // SetSameDocument context->SetIsSameDocument(true); EXPECT_TRUE(context->IsSameDocument()); + ASSERT_FALSE(context->IsPost()); + EXPECT_FALSE(context->GetError()); + EXPECT_NE(response_headers_.get(), context->GetResponseHeaders()); + + // SetPost + context->SetIsPost(true); + EXPECT_TRUE(context->IsSameDocument()); + ASSERT_TRUE(context->IsPost()); EXPECT_FALSE(context->GetError()); EXPECT_NE(response_headers_.get(), context->GetResponseHeaders()); @@ -68,12 +77,14 @@ NSError* error = [[[NSError alloc] init] autorelease]; context->SetError(error); EXPECT_TRUE(context->IsSameDocument()); + ASSERT_TRUE(context->IsPost()); EXPECT_EQ(error, context->GetError()); EXPECT_NE(response_headers_.get(), context->GetResponseHeaders()); // SetResponseHeaders context->SetResponseHeaders(response_headers_); EXPECT_TRUE(context->IsSameDocument()); + ASSERT_TRUE(context->IsPost()); EXPECT_EQ(error, context->GetError()); EXPECT_EQ(response_headers_.get(), context->GetResponseHeaders()); }
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 7e7dfc3..051d2da 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1541,6 +1541,7 @@ item = self.navigationManagerImpl->GetLastCommittedItem(); } context->SetNavigationItemUniqueID(item->GetUniqueID()); + context->SetIsPost([self isCurrentNavigationItemPOST]); _webStateImpl->SetIsLoading(true); _webStateImpl->OnNavigationStarted(context.get()); return context;
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index e919761..3d17e0492 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -363,6 +363,7 @@ EXPECT_TRUE(PageTransitionTypeIncludingQualifiersIs( context->GetPageTransition(), actual_context->GetPageTransition())); EXPECT_FALSE(actual_context->IsSameDocument()); + EXPECT_FALSE(actual_context->IsPost()); EXPECT_FALSE(actual_context->GetError()); EXPECT_FALSE(actual_context->GetResponseHeaders()); @@ -376,6 +377,7 @@ EXPECT_TRUE(PageTransitionTypeIncludingQualifiersIs( context->GetPageTransition(), actual_context->GetPageTransition())); EXPECT_FALSE(actual_context->IsSameDocument()); + EXPECT_FALSE(actual_context->IsPost()); EXPECT_FALSE(actual_context->GetError()); EXPECT_FALSE(actual_context->GetResponseHeaders());
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index e04993e..9d59baa 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -282,6 +282,11 @@ const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding", base::FEATURE_DISABLED_BY_DEFAULT}; +// Does NV12->NV12 video copy on the main thread right before the texture's +// used by GL. +const base::Feature kDelayCopyNV12Textures{"DelayCopyNV12Textures", + base::FEATURE_ENABLED_BY_DEFAULT}; + // Enables H264 HW encode acceleration using Media Foundation for Windows. const base::Feature kMediaFoundationH264Encoding{ "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/media/base/media_switches.h b/media/base/media_switches.h index c1ef880..b33e9529 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h
@@ -130,6 +130,7 @@ #if defined(OS_WIN) MEDIA_EXPORT extern const base::Feature kD3D11VideoDecoding; +MEDIA_EXPORT extern const base::Feature kDelayCopyNV12Textures; MEDIA_EXPORT extern const base::Feature kMediaFoundationH264Encoding; #endif // defined(OS_WIN)
diff --git a/media/gpu/dxva_picture_buffer_win.cc b/media/gpu/dxva_picture_buffer_win.cc index 9aa8ea54..d7df906d 100644 --- a/media/gpu/dxva_picture_buffer_win.cc +++ b/media/gpu/dxva_picture_buffer_win.cc
@@ -32,7 +32,9 @@ // gl::GLImage implementation. gfx::Size GetSize() override { return size_; } unsigned GetInternalFormat() override { return GL_BGRA_EXT; } - bool BindTexImage(unsigned target) override { return false; } + // PbufferPictureBuffer::CopySurfaceComplete does the actual binding, so + // this doesn't do anything and always succeeds. + bool BindTexImage(unsigned target) override { return true; } void ReleaseTexImage(unsigned target) override {} bool CopyTexImage(unsigned target) override { return false; } bool CopyTexSubImage(unsigned target, @@ -102,29 +104,44 @@ const DXVAVideoDecodeAccelerator& decoder, const PictureBuffer& buffer, EGLConfig egl_config) { - if (decoder.share_nv12_textures_) { - linked_ptr<EGLStreamPictureBuffer> picture_buffer( - new EGLStreamPictureBuffer(buffer)); - if (!picture_buffer->Initialize()) - return linked_ptr<DXVAPictureBuffer>(nullptr); + switch (decoder.GetPictureBufferMechanism()) { + case DXVAVideoDecodeAccelerator::PictureBufferMechanism::BIND: { + linked_ptr<EGLStreamPictureBuffer> picture_buffer( + new EGLStreamPictureBuffer(buffer)); + if (!picture_buffer->Initialize()) + return linked_ptr<DXVAPictureBuffer>(nullptr); - return picture_buffer; + return picture_buffer; + } + case DXVAVideoDecodeAccelerator::PictureBufferMechanism:: + DELAYED_COPY_TO_NV12: { + linked_ptr<EGLStreamDelayedCopyPictureBuffer> picture_buffer( + new EGLStreamDelayedCopyPictureBuffer(buffer)); + if (!picture_buffer->Initialize(decoder)) + return linked_ptr<DXVAPictureBuffer>(nullptr); + + return picture_buffer; + } + case DXVAVideoDecodeAccelerator::PictureBufferMechanism::COPY_TO_NV12: { + linked_ptr<EGLStreamCopyPictureBuffer> picture_buffer( + new EGLStreamCopyPictureBuffer(buffer)); + if (!picture_buffer->Initialize(decoder)) + return linked_ptr<DXVAPictureBuffer>(nullptr); + + return picture_buffer; + } + case DXVAVideoDecodeAccelerator::PictureBufferMechanism::COPY_TO_RGB: { + linked_ptr<PbufferPictureBuffer> picture_buffer( + new PbufferPictureBuffer(buffer)); + + if (!picture_buffer->Initialize(decoder, egl_config)) + return linked_ptr<DXVAPictureBuffer>(nullptr); + + return picture_buffer; + } } - if (decoder.copy_nv12_textures_) { - linked_ptr<EGLStreamCopyPictureBuffer> picture_buffer( - new EGLStreamCopyPictureBuffer(buffer)); - if (!picture_buffer->Initialize(decoder)) - return linked_ptr<DXVAPictureBuffer>(nullptr); - - return picture_buffer; - } - linked_ptr<PbufferPictureBuffer> picture_buffer( - new PbufferPictureBuffer(buffer)); - - if (!picture_buffer->Initialize(decoder, egl_config)) - return linked_ptr<DXVAPictureBuffer>(nullptr); - - return picture_buffer; + NOTREACHED(); + return linked_ptr<DXVAPictureBuffer>(nullptr); } DXVAPictureBuffer::~DXVAPictureBuffer() {} @@ -161,6 +178,7 @@ : picture_buffer_(buffer) {} bool DXVAPictureBuffer::BindSampleToTexture( + DXVAVideoDecodeAccelerator* decoder, base::win::ScopedComPtr<IMFSample> sample) { NOTREACHED(); return false; @@ -375,6 +393,10 @@ return false; } +bool PbufferPictureBuffer::CanBindSamples() const { + return false; +} + PbufferPictureBuffer::PbufferPictureBuffer(const PictureBuffer& buffer) : DXVAPictureBuffer(buffer), decoding_surface_(NULL), @@ -474,6 +496,7 @@ } bool EGLStreamPictureBuffer::BindSampleToTexture( + DXVAVideoDecodeAccelerator* decoder, base::win::ScopedComPtr<IMFSample> sample) { DCHECK_EQ(BOUND, state_); state_ = IN_CLIENT; @@ -518,6 +541,129 @@ return true; } +bool EGLStreamPictureBuffer::CanBindSamples() const { + return true; +} + +EGLStreamDelayedCopyPictureBuffer::EGLStreamDelayedCopyPictureBuffer( + const PictureBuffer& buffer) + : DXVAPictureBuffer(buffer), stream_(nullptr) {} + +EGLStreamDelayedCopyPictureBuffer::~EGLStreamDelayedCopyPictureBuffer() { + // stream_ will be deleted by gl_image_. +} + +bool EGLStreamDelayedCopyPictureBuffer::Initialize( + const DXVAVideoDecodeAccelerator& decoder) { + RETURN_ON_FAILURE(picture_buffer_.service_texture_ids().size() >= 2, + "Not enough texture ids provided", false); + + EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); + const EGLint stream_attributes[] = { + EGL_CONSUMER_LATENCY_USEC_KHR, + 0, + EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR, + 0, + EGL_NONE, + }; + stream_ = eglCreateStreamKHR(egl_display, stream_attributes); + RETURN_ON_FAILURE(!!stream_, "Could not create stream", false); + gl::ScopedActiveTexture texture0(GL_TEXTURE0); + gl::ScopedTextureBinder texture0_binder( + GL_TEXTURE_EXTERNAL_OES, picture_buffer_.service_texture_ids()[0]); + gl::ScopedActiveTexture texture1(GL_TEXTURE1); + gl::ScopedTextureBinder texture1_binder( + GL_TEXTURE_EXTERNAL_OES, picture_buffer_.service_texture_ids()[1]); + + EGLAttrib consumer_attributes[] = { + EGL_COLOR_BUFFER_TYPE, + EGL_YUV_BUFFER_EXT, + EGL_YUV_NUMBER_OF_PLANES_EXT, + 2, + EGL_YUV_PLANE0_TEXTURE_UNIT_NV, + 0, + EGL_YUV_PLANE1_TEXTURE_UNIT_NV, + 1, + EGL_NONE, + }; + EGLBoolean result = eglStreamConsumerGLTextureExternalAttribsNV( + egl_display, stream_, consumer_attributes); + RETURN_ON_FAILURE(result, "Could not set stream consumer", false); + + EGLAttrib producer_attributes[] = { + EGL_NONE, + }; + + result = eglCreateStreamProducerD3DTextureNV12ANGLE(egl_display, stream_, + producer_attributes); + RETURN_ON_FAILURE(result, "Could not create stream producer", false); + scoped_refptr<gl::CopyingGLImageDXGI> copying_image_ = + make_scoped_refptr(new gl::CopyingGLImageDXGI( + base::win::ScopedComPtr<ID3D11Device>(decoder.D3D11Device()), size(), + stream_)); + gl_image_ = copying_image_; + return copying_image_->Initialize(); +} + +bool EGLStreamDelayedCopyPictureBuffer::ReusePictureBuffer() { + DCHECK_NE(UNUSED, state_); + + static_cast<gl::CopyingGLImageDXGI*>(gl_image_.get())->UnbindFromTexture(); + if (current_d3d_sample_) { + dx11_decoding_texture_.Reset(); + current_d3d_sample_.Reset(); + } + state_ = UNUSED; + return true; +} + +bool EGLStreamDelayedCopyPictureBuffer::BindSampleToTexture( + DXVAVideoDecodeAccelerator* decoder, + base::win::ScopedComPtr<IMFSample> sample) { + DCHECK_EQ(BOUND, state_); + state_ = IN_CLIENT; + + current_d3d_sample_ = sample; + + base::win::ScopedComPtr<IMFMediaBuffer> output_buffer; + HRESULT hr = + current_d3d_sample_->GetBufferByIndex(0, output_buffer.GetAddressOf()); + RETURN_ON_HR_FAILURE(hr, "Failed to get buffer from output sample", false); + + base::win::ScopedComPtr<IMFDXGIBuffer> dxgi_buffer; + hr = output_buffer.CopyTo(dxgi_buffer.GetAddressOf()); + RETURN_ON_HR_FAILURE(hr, "Failed to get DXGIBuffer from output sample", + false); + hr = dxgi_buffer->GetResource( + IID_PPV_ARGS(dx11_decoding_texture_.GetAddressOf())); + RETURN_ON_HR_FAILURE(hr, "Failed to get texture from output sample", false); + UINT subresource; + dxgi_buffer->GetSubresourceIndex(&subresource); + if (!decoder->InitializeID3D11VideoProcessor(size().width(), size().height(), + color_space_)) + return false; + + DCHECK(decoder->d3d11_processor_); + DCHECK(decoder->enumerator_); + + gl::GLImageDXGI* gl_image_dxgi = + gl::GLImageDXGI::FromGLImage(gl_image_.get()); + DCHECK(gl_image_dxgi); + + gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); + return static_cast<gl::CopyingGLImageDXGI*>(gl_image_dxgi) + ->InitializeVideoProcessor(decoder->d3d11_processor_, + decoder->enumerator_); +} + +bool EGLStreamDelayedCopyPictureBuffer::AllowOverlay() const { + return true; +} + +bool EGLStreamDelayedCopyPictureBuffer::CanBindSamples() const { + return true; +} + EGLStreamCopyPictureBuffer::EGLStreamCopyPictureBuffer( const PictureBuffer& buffer) : DXVAPictureBuffer(buffer), stream_(nullptr) {} @@ -685,4 +831,8 @@ return true; } +bool EGLStreamCopyPictureBuffer::CanBindSamples() const { + return false; +} + } // namespace media
diff --git a/media/gpu/dxva_picture_buffer_win.h b/media/gpu/dxva_picture_buffer_win.h index 29d502d1..87d627d 100644 --- a/media/gpu/dxva_picture_buffer_win.h +++ b/media/gpu/dxva_picture_buffer_win.h
@@ -48,6 +48,7 @@ bool available() const { return state_ == UNUSED; } State state() const { return state_; } + const PictureBuffer& picture_buffer() const { return picture_buffer_; } int id() const { return picture_buffer_.id(); } @@ -66,6 +67,10 @@ // support. virtual bool AllowOverlay() const = 0; + // Returns true if BindSampleToTexture should be used. Otherwise + // CopyOutputSampleDataToPicture should be used. + virtual bool CanBindSamples() const = 0; + bool waiting_to_reuse() const { return state_ == WAITING_TO_REUSE; } virtual gl::GLFence* reuse_fence(); @@ -73,7 +78,8 @@ // |dest_surface| virtual bool CopySurfaceComplete(IDirect3DSurface9* src_surface, IDirect3DSurface9* dest_surface); - virtual bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample); + virtual bool BindSampleToTexture(DXVAVideoDecodeAccelerator* decoder, + base::win::ScopedComPtr<IMFSample> sample); protected: explicit DXVAPictureBuffer(const PictureBuffer& buffer); @@ -108,6 +114,7 @@ bool CopySurfaceComplete(IDirect3DSurface9* src_surface, IDirect3DSurface9* dest_surface) override; bool AllowOverlay() const override; + bool CanBindSamples() const override; protected: EGLSurface decoding_surface_; @@ -149,8 +156,30 @@ bool Initialize(); bool ReusePictureBuffer() override; - bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample) override; + bool BindSampleToTexture(DXVAVideoDecodeAccelerator* decoder, + base::win::ScopedComPtr<IMFSample> sample) override; bool AllowOverlay() const override; + bool CanBindSamples() const override; + + private: + EGLStreamKHR stream_; + + base::win::ScopedComPtr<IMFSample> current_d3d_sample_; + base::win::ScopedComPtr<ID3D11Texture2D> dx11_decoding_texture_; +}; + +// Shares the decoded texture with ANGLE without copying by using an EGL stream. +class EGLStreamDelayedCopyPictureBuffer : public DXVAPictureBuffer { + public: + explicit EGLStreamDelayedCopyPictureBuffer(const PictureBuffer& buffer); + ~EGLStreamDelayedCopyPictureBuffer() override; + + bool Initialize(const DXVAVideoDecodeAccelerator& decoder); + bool ReusePictureBuffer() override; + bool BindSampleToTexture(DXVAVideoDecodeAccelerator* decoder, + base::win::ScopedComPtr<IMFSample> sample) override; + bool AllowOverlay() const override; + bool CanBindSamples() const override; private: EGLStreamKHR stream_; @@ -175,6 +204,7 @@ bool CopySurfaceComplete(IDirect3DSurface9* src_surface, IDirect3DSurface9* dest_surface) override; bool AllowOverlay() const override; + bool CanBindSamples() const override; private: EGLStreamKHR stream_;
diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc index 42840cf5..5b863cc 100644 --- a/media/gpu/dxva_video_decode_accelerator_win.cc +++ b/media/gpu/dxva_video_decode_accelerator_win.cc
@@ -496,10 +496,11 @@ decoder_thread_("DXVAVideoDecoderThread"), pending_flush_(false), enable_low_latency_(gpu_preferences.enable_low_latency_dxva), - share_nv12_textures_(gpu_preferences.enable_zero_copy_dxgi_video && - !workarounds.disable_dxgi_zero_copy_video), - copy_nv12_textures_(gpu_preferences.enable_nv12_dxgi_video && - !workarounds.disable_nv12_dxgi_video), + support_share_nv12_textures_( + gpu_preferences.enable_zero_copy_dxgi_video && + !workarounds.disable_dxgi_zero_copy_video), + support_copy_nv12_textures_(gpu_preferences.enable_nv12_dxgi_video && + !workarounds.disable_nv12_dxgi_video), use_dx11_(false), use_keyed_mutex_(false), using_angle_device_(false), @@ -543,8 +544,8 @@ if (!config.supported_output_formats.empty() && !base::ContainsValue(config.supported_output_formats, PIXEL_FORMAT_NV12)) { - share_nv12_textures_ = false; - copy_nv12_textures_ = false; + support_share_nv12_textures_ = false; + support_copy_nv12_textures_ = false; } bool profile_supported = false; @@ -806,15 +807,19 @@ RETURN_ON_HR_FAILURE(hr, "MFCreateDXGIDeviceManager failed", false); angle_device_ = gl::QueryD3D11DeviceObjectFromANGLE(); - if (!angle_device_) - copy_nv12_textures_ = false; - if (share_nv12_textures_) { + if (!angle_device_) { + support_copy_nv12_textures_ = false; + } + if (ShouldUseANGLEDevice()) { RETURN_ON_FAILURE(angle_device_.Get(), "Failed to get d3d11 device", false); using_angle_device_ = true; - } + DCHECK(!use_fp16_); + angle_device_->GetImmediateContext(d3d11_device_context_.GetAddressOf()); - if (use_fp16_ || !share_nv12_textures_) { + hr = angle_device_.CopyTo(video_device_.GetAddressOf()); + RETURN_ON_HR_FAILURE(hr, "Failed to get video device", false); + } else { // This array defines the set of DirectX hardware feature levels we support. // The ordering MUST be preserved. All applications are assumed to support // 9.1 unless otherwise stated by the application. @@ -853,11 +858,11 @@ hr = d3d11_device_.CopyTo(video_device_.GetAddressOf()); RETURN_ON_HR_FAILURE(hr, "Failed to get video device", false); - - hr = d3d11_device_context_.CopyTo(video_context_.GetAddressOf()); - RETURN_ON_HR_FAILURE(hr, "Failed to get video context", false); } + hr = d3d11_device_context_.CopyTo(video_context_.GetAddressOf()); + RETURN_ON_HR_FAILURE(hr, "Failed to get video context", false); + D3D11_FEATURE_DATA_D3D11_OPTIONS options; hr = D3D11Device()->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &options, sizeof(options)); @@ -866,7 +871,7 @@ // Need extended resource sharing so we can share the NV12 texture between // ANGLE and the decoder context. if (!options.ExtendedResourceSharing) - copy_nv12_textures_ = false; + support_copy_nv12_textures_ = false; UINT nv12_format_support = 0; hr = @@ -874,7 +879,7 @@ RETURN_ON_HR_FAILURE(hr, "Failed to check NV12 format support", false); if (!(nv12_format_support & D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT)) - copy_nv12_textures_ = false; + support_copy_nv12_textures_ = false; UINT fp16_format_support = 0; hr = D3D11Device()->CheckFormatSupport(DXGI_FORMAT_R16G16B16A16_FLOAT, @@ -979,7 +984,7 @@ // texture ids. This call just causes the texture manager to hold a // reference to the GLImage as long as either texture exists. bind_image_cb_.Run(client_id, GetTextureTarget(), - picture_buffer->gl_image(), true); + picture_buffer->gl_image(), false); } } @@ -1040,6 +1045,16 @@ RETURN_AND_NOTIFY_ON_FAILURE(it->second->ReusePictureBuffer(), "Failed to reuse picture buffer", PLATFORM_FAILURE, ); + if (bind_image_cb_ && (GetPictureBufferMechanism() == + PictureBufferMechanism::DELAYED_COPY_TO_NV12)) { + // Unbind the image to ensure it will be copied again the next time it's + // needed. + for (uint32_t client_id : + it->second->picture_buffer().client_texture_ids()) { + bind_image_cb_.Run(client_id, GetTextureTarget(), + it->second->gl_image(), false); + } + } ProcessPendingSamples(); if (pending_flush_) { @@ -1590,8 +1605,8 @@ if (use_fp16_) { // TODO(hubbe): Share/copy P010/P016 textures. - share_nv12_textures_ = false; - copy_nv12_textures_ = false; + support_share_nv12_textures_ = false; + support_copy_nv12_textures_ = false; } return SetDecoderMediaTypes(); @@ -1647,15 +1662,15 @@ !gl::g_driver_egl.ext.b_EGL_KHR_stream || !gl::g_driver_egl.ext.b_EGL_KHR_stream_consumer_gltexture || !gl::g_driver_egl.ext.b_EGL_NV_stream_consumer_gltexture_yuv) { - share_nv12_textures_ = false; - copy_nv12_textures_ = false; + support_share_nv12_textures_ = false; + support_copy_nv12_textures_ = false; } // The MS VP9 MFT doesn't pass through the bind flags we specify, so // textures aren't created with D3D11_BIND_SHADER_RESOURCE and can't be used // from ANGLE. if (using_ms_vp9_mft_) - share_nv12_textures_ = false; + support_share_nv12_textures_ = false; return true; } @@ -1714,7 +1729,7 @@ const GUID& subtype) { bool result = SetTransformOutputType(decoder_.Get(), subtype, 0, 0); - if (share_nv12_textures_) { + if (GetPictureBufferMechanism() == PictureBufferMechanism::BIND) { base::win::ScopedComPtr<IMFAttributes> out_attributes; HRESULT hr = decoder_->GetOutputStreamAttributes(0, out_attributes.GetAddressOf()); @@ -1942,7 +1957,7 @@ index->second->set_bound(); index->second->set_color_space(pending_sample->color_space); - if (share_nv12_textures_) { + if (index->second->CanBindSamples()) { main_thread_task_runner_->PostTask( FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::BindPictureBufferToSample, @@ -2113,7 +2128,8 @@ // per picture buffer, 1 for the Y channel and 1 for the UV channels. // They're shared to ANGLE using EGL_NV_stream_consumer_gltexture_yuv, so // they need to be GL_TEXTURE_EXTERNAL_OES. - bool provide_nv12_textures = share_nv12_textures_ || copy_nv12_textures_; + bool provide_nv12_textures = + GetPictureBufferMechanism() != PictureBufferMechanism::COPY_TO_RGB; client_->ProvidePictureBuffers( kNumPictureBuffers, provide_nv12_textures ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN, @@ -2593,7 +2609,7 @@ DCHECK(!output_picture_buffers_.empty()); - bool result = picture_buffer->BindSampleToTexture(sample); + bool result = picture_buffer->BindSampleToTexture(this, sample); RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface", PLATFORM_FAILURE, ); @@ -2851,7 +2867,9 @@ d3d11_processor_.Get(), 0, false); } - if (copy_nv12_textures_) { + if (GetPictureBufferMechanism() == PictureBufferMechanism::COPY_TO_NV12 || + GetPictureBufferMechanism() == + PictureBufferMechanism::DELAYED_COPY_TO_NV12) { // If we're copying NV12 textures, make sure we set the same // color space on input and output. D3D11_VIDEO_PROCESSOR_COLOR_SPACE d3d11_color_space = {0}; @@ -3026,12 +3044,46 @@ } uint32_t DXVAVideoDecodeAccelerator::GetTextureTarget() const { - bool provide_nv12_textures = share_nv12_textures_ || copy_nv12_textures_; - return provide_nv12_textures ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D; + switch (GetPictureBufferMechanism()) { + case PictureBufferMechanism::BIND: + case PictureBufferMechanism::DELAYED_COPY_TO_NV12: + case PictureBufferMechanism::COPY_TO_NV12: + return GL_TEXTURE_EXTERNAL_OES; + case PictureBufferMechanism::COPY_TO_RGB: + return GL_TEXTURE_2D; + } + NOTREACHED(); + return 0; } +DXVAVideoDecodeAccelerator::PictureBufferMechanism +DXVAVideoDecodeAccelerator::GetPictureBufferMechanism() const { + if (use_fp16_) + return PictureBufferMechanism::COPY_TO_RGB; + if (support_share_nv12_textures_) + return PictureBufferMechanism::BIND; + if (base::FeatureList::IsEnabled(kDelayCopyNV12Textures) && + support_copy_nv12_textures_) + return PictureBufferMechanism::DELAYED_COPY_TO_NV12; + if (support_copy_nv12_textures_) + return PictureBufferMechanism::COPY_TO_NV12; + return PictureBufferMechanism::COPY_TO_RGB; +} + +bool DXVAVideoDecodeAccelerator::ShouldUseANGLEDevice() const { + switch (GetPictureBufferMechanism()) { + case PictureBufferMechanism::BIND: + case PictureBufferMechanism::DELAYED_COPY_TO_NV12: + return true; + case PictureBufferMechanism::COPY_TO_NV12: + case PictureBufferMechanism::COPY_TO_RGB: + return false; + } + NOTREACHED(); + return false; +} ID3D11Device* DXVAVideoDecodeAccelerator::D3D11Device() const { - return share_nv12_textures_ ? angle_device_.Get() : d3d11_device_.Get(); + return ShouldUseANGLEDevice() ? angle_device_.Get() : d3d11_device_.Get(); } } // namespace media
diff --git a/media/gpu/dxva_video_decode_accelerator_win.h b/media/gpu/dxva_video_decode_accelerator_win.h index a1962307..dc02f98 100644 --- a/media/gpu/dxva_video_decode_accelerator_win.h +++ b/media/gpu/dxva_video_decode_accelerator_win.h
@@ -144,6 +144,7 @@ private: friend class DXVAPictureBuffer; + friend class EGLStreamDelayedCopyPictureBuffer; friend class EGLStreamCopyPictureBuffer; friend class EGLStreamPictureBuffer; friend class PbufferPictureBuffer; @@ -151,6 +152,22 @@ typedef void* EGLSurface; typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs; + enum class PictureBufferMechanism { + // Copy to either a BGRA8 or FP16 texture using the video processor. + COPY_TO_RGB, + + // Copy to another NV12 texture that can be used in ANGLE. + COPY_TO_NV12, + + // Bind the resulting GLImage to the NV12 texture. If the texture's used + // in a an overlay than use it directly, otherwise copy it to another NV12 + // texture when necessary. + DELAYED_COPY_TO_NV12, + + // Bind the NV12 decoder texture directly to the texture used in ANGLE. + BIND + }; + // Returns the minimum resolution for the |profile| passed in. static std::pair<int, int> GetMinResolution(const VideoCodecProfile profile); @@ -375,6 +392,8 @@ uint32_t GetTextureTarget() const; + PictureBufferMechanism GetPictureBufferMechanism() const; + bool ShouldUseANGLEDevice() const; ID3D11Device* D3D11Device() const; // To expose client callbacks from VideoDecodeAccelerator. @@ -517,10 +536,12 @@ // Use CODECAPI_AVLowLatencyMode. bool enable_low_latency_; - bool share_nv12_textures_; + // Supports sharing the decoded NV12 textures with ANGLE + bool support_share_nv12_textures_; - // Copy NV12 texture to another NV12 texture. - bool copy_nv12_textures_; + // Supports copying the NV12 texture to another NV12 texture to use in + // ANGLE. + bool support_copy_nv12_textures_; // Copy video to FP16 scRGB textures. bool use_fp16_ = false;
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.cc b/net/quic/chromium/bidirectional_stream_quic_impl.cc index 17a9f796..2f5ad1d 100644 --- a/net/quic/chromium/bidirectional_stream_quic_impl.cc +++ b/net/quic/chromium/bidirectional_stream_quic_impl.cc
@@ -112,20 +112,25 @@ // If the stream is already closed, there is no body to read. return response_status_; } - int rv = stream_->Read(buffer, buffer_len); - if (rv != ERR_IO_PENDING) { - if (stream_->IsDoneReading()) { - // If the write side is closed, OnFinRead() will call - // BidirectionalStreamQuicImpl::OnClose(). - stream_->OnFinRead(); - } - return rv; + int rv = stream_->ReadBody( + buffer, buffer_len, + base::Bind(&BidirectionalStreamQuicImpl::OnReadDataComplete, + weak_factory_.GetWeakPtr())); + if (rv == ERR_IO_PENDING) { + read_buffer_ = buffer; + read_buffer_len_ = buffer_len; + return ERR_IO_PENDING; } - // Read will complete asynchronously and Delegate::OnReadCompleted will be - // called upon completion. - read_buffer_ = buffer; - read_buffer_len_ = buffer_len; - return ERR_IO_PENDING; + + if (rv < 0) + return rv; + + if (stream_->IsDoneReading()) { + // If the write side is closed, OnFinRead() will call + // BidirectionalStreamQuicImpl::OnClose(). + stream_->OnFinRead(); + } + return rv; } void BidirectionalStreamQuicImpl::SendData(const scoped_refptr<IOBuffer>& data, @@ -236,22 +241,6 @@ // |this| can be destroyed after this point. } -void BidirectionalStreamQuicImpl::OnDataAvailable() { - // Return early if ReadData has not been called. - if (!read_buffer_) - return; - - int rv = ReadData(read_buffer_.get(), read_buffer_len_); - if (rv == ERR_IO_PENDING) { - // Spurrious notification. Wait for the next one. - return; - } - read_buffer_ = nullptr; - read_buffer_len_ = 0; - if (delegate_) - delegate_->OnDataRead(rv); -} - void BidirectionalStreamQuicImpl::OnClose() { DCHECK(stream_); @@ -323,6 +312,21 @@ delegate_->OnHeadersReceived(initial_headers_); } +void BidirectionalStreamQuicImpl::OnReadDataComplete(int rv) { + DCHECK_GE(rv, 0); + read_buffer_ = nullptr; + read_buffer_len_ = 0; + + if (stream_->IsDoneReading()) { + // If the write side is closed, OnFinRead() will call + // BidirectionalStreamQuicImpl::OnClose(). + stream_->OnFinRead(); + } + + if (delegate_) + delegate_->OnDataRead(rv); +} + void BidirectionalStreamQuicImpl::NotifyError(int error) { DCHECK_NE(OK, error); DCHECK_NE(ERR_IO_PENDING, error);
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.h b/net/quic/chromium/bidirectional_stream_quic_impl.h index d5d662d5..28a0f319 100644 --- a/net/quic/chromium/bidirectional_stream_quic_impl.h +++ b/net/quic/chromium/bidirectional_stream_quic_impl.h
@@ -58,7 +58,6 @@ private: // QuicChromiumClientStream::Delegate implementation: - void OnDataAvailable() override; void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, size_t frame_len) override; void OnClose() override;
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc index cdd79fe..f02458b 100644 --- a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc +++ b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
@@ -1762,6 +1762,73 @@ EXPECT_EQ(0, delegate->on_data_sent_count()); } +TEST_P(BidirectionalStreamQuicImplTest, AsyncFinRead) { + const char kBody[] = "here is some data"; + SetRequest("POST", "/", DEFAULT_PRIORITY); + size_t spdy_request_headers_frame_length; + QuicStreamOffset header_stream_offset = 0; + AddWrite(ConstructInitialSettingsPacket(1, &header_stream_offset)); + AddWrite(ConstructRequestHeadersPacketInner( + 2, GetNthClientInitiatedStreamId(0), !kFin, DEFAULT_PRIORITY, + &spdy_request_headers_frame_length, &header_stream_offset)); + AddWrite(ConstructClientMultipleDataFramesPacket(3, kIncludeVersion, kFin, 0, + {kBody})); + AddWrite(ConstructClientAckPacket(4, 3, 1, 1)); + + Initialize(); + + BidirectionalStreamRequestInfo request; + request.method = "POST"; + request.url = GURL("http://www.google.com/"); + request.end_stream_on_headers = false; + request.priority = DEFAULT_PRIORITY; + + scoped_refptr<IOBuffer> read_buffer(new IOBuffer(kReadBufferSize)); + std::unique_ptr<TestDelegateBase> delegate( + new TestDelegateBase(read_buffer.get(), kReadBufferSize)); + + delegate->Start(&request, net_log().bound(), session()->CreateHandle()); + ConfirmHandshake(); + delegate->WaitUntilNextCallback(); // OnStreamReady + + // Send a Data packet with fin set. + scoped_refptr<StringIOBuffer> buf1(new StringIOBuffer(kBody)); + delegate->SendData(buf1, buf1->size(), /*fin*/ true); + delegate->WaitUntilNextCallback(); // OnDataSent + + // Server acks the request. + ProcessPacket(ConstructServerAckPacket(1, 0, 0, 0)); + + // Server sends the response headers. + SpdyHeaderBlock response_headers = ConstructResponseHeaders("200"); + + size_t spdy_response_headers_frame_length; + ProcessPacket(ConstructResponseHeadersPacket( + 2, !kFin, std::move(response_headers), + &spdy_response_headers_frame_length, nullptr)); + + delegate->WaitUntilNextCallback(); // OnHeadersReceived + + EXPECT_EQ("200", delegate->response_headers().find(":status")->second); + + // Read the body, which will complete asynchronously. + TestCompletionCallback cb; + int rv = delegate->ReadData(cb.callback()); + EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); + const char kResponseBody[] = "Hello world!"; + + // Server sends data with the fin set, which should result in the stream + // being closed and hence no RST_STREAM will be sent. + ProcessPacket( + ConstructServerDataPacket(3, !kIncludeVersion, kFin, 0, kResponseBody)); + EXPECT_EQ(static_cast<int64_t>(strlen(kResponseBody)), cb.WaitForResult()); + + base::RunLoop().RunUntilIdle(); + + EXPECT_EQ(1, delegate->on_data_read_count()); + EXPECT_EQ(1, delegate->on_data_sent_count()); +} + TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnTrailersReceived) { SetRequest("GET", "/", DEFAULT_PRIORITY); size_t spdy_request_headers_frame_length;
diff --git a/net/quic/chromium/mock_quic_data.cc b/net/quic/chromium/mock_quic_data.cc index f36029b..63e2db0 100644 --- a/net/quic/chromium/mock_quic_data.cc +++ b/net/quic/chromium/mock_quic_data.cc
@@ -38,6 +38,12 @@ packets_.push_back(std::move(packet)); } +void MockQuicData::AddAsyncWrite(std::unique_ptr<QuicEncryptedPacket> packet) { + writes_.push_back( + MockWrite(ASYNC, packet->data(), packet->length(), sequence_number_++)); + packets_.push_back(std::move(packet)); +} + void MockQuicData::AddWrite(IoMode mode, int rv) { writes_.push_back(MockWrite(mode, rv, sequence_number_++)); }
diff --git a/net/quic/chromium/mock_quic_data.h b/net/quic/chromium/mock_quic_data.h index c58ce2e..980cdb7 100644 --- a/net/quic/chromium/mock_quic_data.h +++ b/net/quic/chromium/mock_quic_data.h
@@ -38,6 +38,10 @@ // |packet|. void AddWrite(std::unique_ptr<QuicEncryptedPacket> packet); + // Adds an asynchronous write at the next sequence number which will write + // |packet|. + void AddAsyncWrite(std::unique_ptr<QuicEncryptedPacket> packet); + // Adds a write at the next sequence number which will return |rv| either // synchronously or asynchronously based on |mode|. void AddWrite(IoMode mode, int rv);
diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc index 3f3843e5d..a2c88c8 100644 --- a/net/quic/chromium/quic_chromium_client_session.cc +++ b/net/quic/chromium/quic_chromium_client_session.cc
@@ -64,6 +64,9 @@ // migrating sessions need to wait for a new network to connect. const size_t kWaitTimeForNewNetworkSecs = 10; +// The maximum size of uncompressed QUIC headers that will be allowed. +const size_t kMaxUncompressedHeaderSize = 256 * 1024; + // Histograms for tracking down the crashes from http://crbug.com/354669 // Note: these values must be kept in sync with the corresponding values in: // tools/metrics/histograms/histograms.xml @@ -675,6 +678,7 @@ base::MakeUnique<HpackEncoderDebugVisitor>()); SetHpackDecoderDebugVisitor( base::MakeUnique<HpackDecoderDebugVisitor>()); + set_max_uncompressed_header_bytes(kMaxUncompressedHeaderSize); } void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking(
diff --git a/net/quic/chromium/quic_chromium_client_stream.cc b/net/quic/chromium/quic_chromium_client_stream.cc index ad706a5..1b1c90e 100644 --- a/net/quic/chromium/quic_chromium_client_stream.cc +++ b/net/quic/chromium/quic_chromium_client_stream.cc
@@ -23,7 +23,10 @@ QuicChromiumClientStream::Handle::Handle(QuicChromiumClientStream* stream, Delegate* delegate) - : stream_(stream), delegate_(delegate), read_headers_buffer_(nullptr) { + : stream_(stream), + delegate_(delegate), + read_headers_buffer_(nullptr), + read_body_buffer_len_(0) { SaveState(); } @@ -58,7 +61,16 @@ } void QuicChromiumClientStream::Handle::OnDataAvailable() { - delegate_->OnDataAvailable(); + if (!read_body_callback_) + return; // Wait for ReadBody to be called. + + int rv = stream_->Read(read_body_buffer_, read_body_buffer_len_); + if (rv == ERR_IO_PENDING) + return; // Spurrious, likely because of trailers? + + read_body_buffer_ = nullptr; + read_body_buffer_len_ = 0; + ResetAndReturn(&read_body_callback_).Run(rv); } void QuicChromiumClientStream::Handle::OnClose() { @@ -98,6 +110,23 @@ return ERR_IO_PENDING; } +int QuicChromiumClientStream::Handle::ReadBody( + IOBuffer* buffer, + int buffer_len, + const CompletionCallback& callback) { + if (!stream_) + return ERR_CONNECTION_CLOSED; + + int rv = stream_->Read(buffer, buffer_len); + if (rv != ERR_IO_PENDING) + return rv; + + read_body_callback_ = callback; + read_body_buffer_ = buffer; + read_body_buffer_len_ = buffer_len; + return ERR_IO_PENDING; +} + size_t QuicChromiumClientStream::Handle::WriteHeaders( SpdyHeaderBlock header_block, bool fin,
diff --git a/net/quic/chromium/quic_chromium_client_stream.h b/net/quic/chromium/quic_chromium_client_stream.h index 9192d5cc..14901d8edc 100644 --- a/net/quic/chromium/quic_chromium_client_stream.h +++ b/net/quic/chromium/quic_chromium_client_stream.h
@@ -43,9 +43,6 @@ virtual void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, size_t frame_len) = 0; - // Called when data is available to be read. - virtual void OnDataAvailable() = 0; - // Called when the stream is closed by the peer. virtual void OnClose() = 0; @@ -76,6 +73,15 @@ int ReadInitialHeaders(SpdyHeaderBlock* header_block, const CompletionCallback& callback); + // Reads at most |buffer_len| bytes of body into |buffer| and returns the + // number of bytes read. If body is not available, returns ERR_IO_PENDING + // and will invoke |callback| asynchronously when data arrive. + // TODO(rch): Invoke |callback| when there is a stream or connection error + // instead of calling OnClose() or OnError(). + int ReadBody(IOBuffer* buffer, + int buffer_len, + const CompletionCallback& callback); + // Writes |header_block| to the peer. Closes the write side if |fin| is // true. If non-null, |ack_notifier_delegate| will be notified when the // headers are ACK'd by the peer. @@ -163,6 +169,10 @@ CompletionCallback read_headers_callback_; SpdyHeaderBlock* read_headers_buffer_; + CompletionCallback read_body_callback_; + IOBuffer* read_body_buffer_; + int read_body_buffer_len_; + QuicStreamId id_; QuicErrorCode connection_error_; QuicRstStreamErrorCode stream_error_;
diff --git a/net/quic/chromium/quic_chromium_client_stream_test.cc b/net/quic/chromium/quic_chromium_client_stream_test.cc index abb4b85..aba5b919 100644 --- a/net/quic/chromium/quic_chromium_client_stream_test.cc +++ b/net/quic/chromium/quic_chromium_client_stream_test.cc
@@ -51,7 +51,6 @@ } MOCK_METHOD2(OnTrailingHeadersAvailableMock, void(const SpdyHeaderBlock& headers, size_t frame_len)); - MOCK_METHOD0(OnDataAvailable, void()); MOCK_METHOD0(OnClose, void()); MOCK_METHOD1(OnError, void(int)); MOCK_METHOD0(HasSendHeadersComplete, bool()); @@ -263,6 +262,10 @@ return QuicSpdySessionPeer::GetNthServerInitiatedStreamId(session_, n); } + void ResetStreamCallback(QuicChromiumClientStream* stream, int /*rv*/) { + stream->Reset(QUIC_STREAM_CANCELLED); + } + QuicCryptoClientConfig crypto_config_; std::unique_ptr<QuicChromiumClientStream::Handle> handle_; testing::StrictMock<MockDelegate> delegate_; @@ -388,25 +391,43 @@ stream_->OnStreamFrame(frame2); } -TEST_P(QuicChromiumClientStreamTest, OnDataAvailableBeforeHeaders) { - EXPECT_CALL(delegate_, OnClose()); - - EXPECT_CALL(delegate_, OnDataAvailable()).Times(0); - stream_->OnDataAvailable(); -} - TEST_P(QuicChromiumClientStreamTest, OnDataAvailable) { InitializeHeaders(); ProcessHeadersFull(headers_); const char data[] = "hello world!"; + int data_len = strlen(data); stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, /*offset=*/0, data)); - EXPECT_CALL(delegate_, OnDataAvailable()) - .WillOnce(testing::Invoke(CreateFunctor( - &QuicChromiumClientStreamTest::ReadData, base::Unretained(this), - QuicStringPiece(data, arraysize(data) - 1)))); + // Read the body and verify that it arrives correctly. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(data_len, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); + EXPECT_EQ(QuicStringPiece(data), QuicStringPiece(buffer->data(), data_len)); + + EXPECT_CALL(delegate_, OnClose()); +} + +TEST_P(QuicChromiumClientStreamTest, OnDataAvailableAfterReadBody) { + InitializeHeaders(); + ProcessHeadersFull(headers_); + + const char data[] = "hello world!"; + int data_len = strlen(data); + + // Start to read the body. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(ERR_IO_PENDING, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); + + stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, + /*offset=*/0, data)); + + EXPECT_EQ(data_len, callback.WaitForResult()); + EXPECT_EQ(QuicStringPiece(data), QuicStringPiece(buffer->data(), data_len)); base::RunLoop().RunUntilIdle(); EXPECT_CALL(delegate_, OnClose()); @@ -434,12 +455,21 @@ EXPECT_CALL(session_, SendRstStream(kTestStreamId, QUIC_STREAM_CANCELLED, 0)); const char data[] = "hello world!"; + int data_len = strlen(data); + + // Start to read the body. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(ERR_IO_PENDING, + handle_->ReadBody( + buffer.get(), 2 * data_len, + base::Bind(&QuicChromiumClientStreamTest::ResetStreamCallback, + base::Unretained(this), stream_))); + + // Receive the data and close the stream during the callback. stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, /*offset=*/0, data)); - EXPECT_CALL(delegate_, OnDataAvailable()) - .WillOnce(testing::Invoke(CreateFunctor( - &QuicChromiumClientStream::Reset, - base::Unretained(stream_), QUIC_STREAM_CANCELLED))); + base::RunLoop().RunUntilIdle(); EXPECT_CALL(delegate_, OnClose()); @@ -457,13 +487,16 @@ ProcessHeadersFull(headers_); const char data[] = "hello world!"; + int data_len = strlen(data); stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, /*offset=*/0, data)); - EXPECT_CALL(delegate_, OnDataAvailable()) - .WillOnce(testing::Invoke(CreateFunctor( - &QuicChromiumClientStreamTest::ReadData, base::Unretained(this), - QuicStringPiece(data, arraysize(data) - 1)))); + // Read the body and verify that it arrives correctly. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(data_len, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); + EXPECT_EQ(QuicStringPiece(data), QuicStringPiece(buffer->data(), data_len)); SpdyHeaderBlock trailers; trailers["bar"] = "foo"; @@ -477,16 +510,9 @@ run_loop.Run(); - // OnDataAvailable callback should follow trailers notification. - base::RunLoop run_loop3; - EXPECT_CALL(delegate_, OnDataAvailable()) - .Times(1) - .WillOnce(testing::DoAll( - testing::Invoke(CreateFunctor(&QuicChromiumClientStreamTest::ReadData, - base::Unretained(this), - QuicStringPiece())), - testing::InvokeWithoutArgs([&run_loop3]() { run_loop3.Quit(); }))); - run_loop3.Run(); + // Read the body and verify that it arrives correctly. + EXPECT_EQ(0, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); // Make sure kFinalOffsetHeaderKey is gone from the delivered actual trailers. trailers.erase(kFinalOffsetHeaderKey); @@ -502,24 +528,21 @@ ProcessHeadersFull(headers_); const char data[] = "hello world!"; + int data_len = strlen(data); stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, /*offset=*/0, data)); - base::RunLoop run_loop; - EXPECT_CALL(delegate_, OnDataAvailable()) - .Times(1) - .WillOnce(testing::DoAll( - testing::Invoke(CreateFunctor( - &QuicChromiumClientStreamTest::ReadData, base::Unretained(this), - QuicStringPiece(data, arraysize(data) - 1))), - testing::Invoke([&run_loop]() { run_loop.Quit(); }))); - - // Wait for the read to complete. - run_loop.Run(); + // Read the body and verify that it arrives correctly. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(data_len, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); + EXPECT_EQ(QuicStringPiece(data), QuicStringPiece(buffer->data(), data_len)); // Read again, and it will be pending. - scoped_refptr<IOBuffer> buffer(new IOBuffer(1)); - EXPECT_THAT(stream_->Read(buffer.get(), 1), IsError(ERR_IO_PENDING)); + EXPECT_THAT( + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()), + IsError(ERR_IO_PENDING)); SpdyHeaderBlock trailers; trailers["bar"] = "foo"; @@ -535,16 +558,8 @@ run_loop2.Run(); - // OnDataAvailable callback should follow trailers notification. - base::RunLoop run_loop3; - EXPECT_CALL(delegate_, OnDataAvailable()) - .Times(1) - .WillOnce(testing::DoAll( - testing::Invoke(CreateFunctor(&QuicChromiumClientStreamTest::ReadData, - base::Unretained(this), - QuicStringPiece())), - testing::InvokeWithoutArgs([&run_loop3]() { run_loop3.Quit(); }))); - run_loop3.Run(); + // Read the body and verify that it arrives correctly. + EXPECT_EQ(0, callback.WaitForResult()); // Make sure the stream is properly closed since trailers and data are all // consumed. @@ -565,20 +580,16 @@ ProcessHeadersFull(headers_); const char data[] = "hello world!"; + int data_len = strlen(data); stream_->OnStreamFrame(QuicStreamFrame(kTestStreamId, /*fin=*/false, /*offset=*/0, data)); - base::RunLoop run_loop; - EXPECT_CALL(delegate_, OnDataAvailable()) - .Times(1) - .WillOnce(testing::DoAll( - testing::Invoke(CreateFunctor( - &QuicChromiumClientStreamTest::ReadData, base::Unretained(this), - QuicStringPiece(data, arraysize(data) - 1))), - testing::Invoke([&run_loop]() { run_loop.Quit(); }))); - - // Wait for the read to complete. - run_loop.Run(); + // Read the body and verify that it arrives correctly. + TestCompletionCallback callback; + scoped_refptr<IOBuffer> buffer(new IOBuffer(2 * data_len)); + EXPECT_EQ(data_len, + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback())); + EXPECT_EQ(QuicStringPiece(data), QuicStringPiece(buffer->data(), data_len)); // Deliver trailers. Delegate notification is posted asynchronously. SpdyHeaderBlock trailers; @@ -587,9 +598,11 @@ QuicHeaderList t = ProcessTrailers(trailers); + EXPECT_FALSE(stream_->IsDoneReading()); // Read again, it return ERR_IO_PENDING. - scoped_refptr<IOBuffer> buffer(new IOBuffer(1)); - EXPECT_THAT(stream_->Read(buffer.get(), 1), ERR_IO_PENDING); + EXPECT_THAT( + handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()), + IsError(ERR_IO_PENDING)); // Trailers are not delivered EXPECT_FALSE(stream_->IsDoneReading()); @@ -602,15 +615,9 @@ run_loop2.Run(); - base::RunLoop run_loop3; + // Read the body and verify that it arrives correctly. // OnDataAvailable() should follow right after and Read() will return 0. - EXPECT_CALL(delegate_, OnDataAvailable()) - .WillOnce(testing::DoAll( - testing::Invoke(CreateFunctor(&QuicChromiumClientStreamTest::ReadData, - base::Unretained(this), - QuicStringPiece())), - testing::Invoke([&run_loop3]() { run_loop3.Quit(); }))); - run_loop3.Run(); + EXPECT_EQ(0, callback.WaitForResult()); // Make sure the stream is properly closed since trailers and data are all // consumed.
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc index 07f34fc6..a299a2612 100644 --- a/net/quic/chromium/quic_http_stream.cc +++ b/net/quic/chromium/quic_http_stream.cc
@@ -357,14 +357,20 @@ if (!stream_) return GetResponseStatus(); - int rv = ReadAvailableData(buf, buf_len); - if (rv != ERR_IO_PENDING) + int rv = stream_->ReadBody(buf, buf_len, + base::Bind(&QuicHttpStream::OnReadBodyComplete, + weak_factory_.GetWeakPtr())); + if (rv == ERR_IO_PENDING) { + callback_ = callback; + user_buffer_ = buf; + user_buffer_len_ = buf_len; + return ERR_IO_PENDING; + } + + if (rv < 0) return rv; - callback_ = callback; - user_buffer_ = buf; - user_buffer_len_ = buf_len; - return ERR_IO_PENDING; + return HandleReadComplete(rv); } void QuicHttpStream::Close(bool /*not_reusable*/) { @@ -472,26 +478,6 @@ } } -void QuicHttpStream::OnDataAvailable() { - if (callback_.is_null()) { - // Data is available, but can't be delivered - return; - } - - CHECK(user_buffer_.get()); - CHECK_NE(0, user_buffer_len_); - int rv = ReadAvailableData(user_buffer_.get(), user_buffer_len_); - if (rv == ERR_IO_PENDING) { - // This was a spurrious notification. Wait for the next one. - return; - } - - CHECK(!callback_.is_null()); - user_buffer_ = nullptr; - user_buffer_len_ = 0; - DoCallback(rv); -} - void QuicHttpStream::OnClose() { quic_connection_error_ = stream_->connection_error(); quic_stream_error_ = stream_->stream_error(); @@ -768,15 +754,15 @@ return OK; } -int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) { - int rv = stream_->Read(buf, buf_len); - // TODO(rtenneti): Temporary fix for crbug.com/585591. Added a check for null - // |stream_| to fix crash bug. Delete |stream_| check and histogram after fix - // is merged. - bool null_stream = stream_ == nullptr; - UMA_HISTOGRAM_BOOLEAN("Net.QuicReadAvailableData.NullStream", null_stream); - if (null_stream) - return rv; +void QuicHttpStream::OnReadBodyComplete(int rv) { + CHECK(callback_); + user_buffer_ = nullptr; + user_buffer_len_ = 0; + rv = HandleReadComplete(rv); + DoCallback(rv); +} + +int QuicHttpStream::HandleReadComplete(int rv) { if (stream_->IsDoneReading()) { stream_->ClearDelegate(); stream_->OnFinRead();
diff --git a/net/quic/chromium/quic_http_stream.h b/net/quic/chromium/quic_http_stream.h index 365a438..be8833c4 100644 --- a/net/quic/chromium/quic_http_stream.h +++ b/net/quic/chromium/quic_http_stream.h
@@ -69,7 +69,6 @@ void SetPriority(RequestPriority priority) override; // QuicChromiumClientStream::Delegate implementation - void OnDataAvailable() override; void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, size_t frame_len) override; void OnClose() override; @@ -125,7 +124,9 @@ void OnReadResponseHeadersComplete(int rv); int ProcessResponseHeaders(const SpdyHeaderBlock& headers); - int ReadAvailableData(IOBuffer* buf, int buf_len); + void OnReadBodyComplete(int rv); + int HandleReadComplete(int rv); + void EnterStateSendHeaders(); void ResetStream();
diff --git a/net/quic/chromium/quic_http_stream_test.cc b/net/quic/chromium/quic_http_stream_test.cc index 4cd7c79..9901f4c 100644 --- a/net/quic/chromium/quic_http_stream_test.cc +++ b/net/quic/chromium/quic_http_stream_test.cc
@@ -110,7 +110,6 @@ Close(false); } - void OnDataAvailable() override { Close(false); } }; // UploadDataStream that always returns errors on data read.
diff --git a/net/quic/chromium/quic_network_transaction_unittest.cc b/net/quic/chromium/quic_network_transaction_unittest.cc index 9ffa06c..570bfaad 100644 --- a/net/quic/chromium/quic_network_transaction_unittest.cc +++ b/net/quic/chromium/quic_network_transaction_unittest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <algorithm> #include <memory> #include <ostream> #include <string> @@ -905,6 +906,112 @@ EXPECT_EQ(3, log_stream_id); } +TEST_P(QuicNetworkTransactionTest, LargeResponseHeaders) { + params_.origins_to_force_quic_on.insert( + HostPortPair::FromString("mail.example.org:443")); + + MockQuicData mock_quic_data; + QuicStreamOffset header_stream_offset = 0; + mock_quic_data.AddWrite( + ConstructInitialSettingsPacket(1, &header_stream_offset)); + mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( + 2, GetNthClientInitiatedStreamId(0), true, true, + GetRequestHeaders("GET", "https", "/"), &header_stream_offset)); + SpdyHeaderBlock response_headers = GetResponseHeaders("200 OK"); + response_headers["key1"] = std::string(30000, 'A'); + response_headers["key2"] = std::string(30000, 'A'); + response_headers["key3"] = std::string(30000, 'A'); + response_headers["key4"] = std::string(30000, 'A'); + response_headers["key5"] = std::string(30000, 'A'); + response_headers["key6"] = std::string(30000, 'A'); + response_headers["key7"] = std::string(30000, 'A'); + response_headers["key8"] = std::string(30000, 'A'); + SpdyHeadersIR headers_frame(GetNthClientInitiatedStreamId(0), + std::move(response_headers)); + SpdyFramer response_framer(SpdyFramer::ENABLE_COMPRESSION); + SpdySerializedFrame spdy_frame = + response_framer.SerializeFrame(headers_frame); + + QuicPacketNumber packet_number = 1; + size_t chunk_size = 1200; + for (size_t offset = 0; offset < spdy_frame.size(); offset += chunk_size) { + size_t len = std::min(chunk_size, spdy_frame.size() - offset); + mock_quic_data.AddRead(ConstructServerDataPacket( + packet_number++, kHeadersStreamId, false, false, offset, + base::StringPiece(spdy_frame.data() + offset, len))); + } + + mock_quic_data.AddRead( + ConstructServerDataPacket(packet_number, GetNthClientInitiatedStreamId(0), + false, true, 0, "hello!")); + mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING); // No more data to read + mock_quic_data.AddAsyncWrite(ConstructClientAckPacket(3, 2, 1, 1)); + mock_quic_data.AddAsyncWrite( + ConstructClientAckPacket(4, packet_number, 3, 1)); + + mock_quic_data.AddSocketDataToFactory(&socket_factory_); + + CreateSession(); + + SendRequestAndExpectQuicResponse("hello!"); +} + +TEST_P(QuicNetworkTransactionTest, TooLargeResponseHeaders) { + params_.origins_to_force_quic_on.insert( + HostPortPair::FromString("mail.example.org:443")); + + MockQuicData mock_quic_data; + QuicStreamOffset header_stream_offset = 0; + mock_quic_data.AddWrite( + ConstructInitialSettingsPacket(1, &header_stream_offset)); + mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( + 2, GetNthClientInitiatedStreamId(0), true, true, + GetRequestHeaders("GET", "https", "/"), &header_stream_offset)); + SpdyHeaderBlock response_headers = GetResponseHeaders("200 OK"); + response_headers["key1"] = std::string(30000, 'A'); + response_headers["key2"] = std::string(30000, 'A'); + response_headers["key3"] = std::string(30000, 'A'); + response_headers["key4"] = std::string(30000, 'A'); + response_headers["key5"] = std::string(30000, 'A'); + response_headers["key6"] = std::string(30000, 'A'); + response_headers["key7"] = std::string(30000, 'A'); + response_headers["key8"] = std::string(30000, 'A'); + response_headers["key9"] = std::string(30000, 'A'); + SpdyHeadersIR headers_frame(GetNthClientInitiatedStreamId(0), + std::move(response_headers)); + SpdyFramer response_framer(SpdyFramer::ENABLE_COMPRESSION); + SpdySerializedFrame spdy_frame = + response_framer.SerializeFrame(headers_frame); + + QuicPacketNumber packet_number = 1; + size_t chunk_size = 1200; + for (size_t offset = 0; offset < spdy_frame.size(); offset += chunk_size) { + size_t len = std::min(chunk_size, spdy_frame.size() - offset); + mock_quic_data.AddRead(ConstructServerDataPacket( + packet_number++, kHeadersStreamId, false, false, offset, + base::StringPiece(spdy_frame.data() + offset, len))); + } + + mock_quic_data.AddRead( + ConstructServerDataPacket(packet_number, GetNthClientInitiatedStreamId(0), + false, true, 0, "hello!")); + mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING); // No more data to read + mock_quic_data.AddAsyncWrite(ConstructClientAckPacket(3, 2, 1, 1)); + mock_quic_data.AddAsyncWrite(ConstructClientAckAndRstPacket( + 4, GetNthClientInitiatedStreamId(0), QUIC_HEADERS_TOO_LARGE, + packet_number, 3, 1)); + + mock_quic_data.AddSocketDataToFactory(&socket_factory_); + + CreateSession(); + + HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get()); + TestCompletionCallback callback; + int rv = trans.Start(&request_, callback.callback(), net_log_.bound()); + EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); + EXPECT_THAT(callback.WaitForResult(), IsError(ERR_QUIC_PROTOCOL_ERROR)); +} + TEST_P(QuicNetworkTransactionTest, ForceQuicForAll) { params_.origins_to_force_quic_on.insert(HostPortPair());
diff --git a/services/BUILD.gn b/services/BUILD.gn index b1007df9..e1580d08 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn
@@ -13,8 +13,8 @@ # To add tests for a new service, please define a "tests" source_set in the # service subdirectory and add it as a dependency here. If your unit tests # use the ServiceTest framework, you must also include corresponding catalog -# entries in the "service_unittests_catalog" target below. -service_test("service_unittests") { +# entries in the "services_unittests_catalog" target below. +service_test("services_unittests") { deps = [ "//services/data_decoder:tests", "//services/device:tests", @@ -37,6 +37,10 @@ if (is_linux && !is_chromeos) { deps += [ "//services/ui/demo:tests" ] } + + if (use_ozone || (!is_chromeos && !is_mac)) { + deps += [ "//services/ui/ws:tests" ] + } } if (is_android) { @@ -59,10 +63,10 @@ test_runner = "//services/test:run_all_service_tests" - catalog = ":service_unittests_catalog" + catalog = ":services_unittests_catalog" } -catalog("service_unittests_catalog") { +catalog("services_unittests_catalog") { testonly = true catalog_deps = [ "//services/device:tests_catalog", @@ -82,6 +86,10 @@ if (is_linux && !is_chromeos) { catalog_deps += [ "//services/ui/demo:tests_catalog" ] } + + if (use_ozone || !is_chromeos) { + catalog_deps += [ "//services/ui/ws:tests_catalog" ] + } } }
diff --git a/services/test/run_all_service_tests.cc b/services/test/run_all_service_tests.cc index c356fa6..deb9fc3 100644 --- a/services/test/run_all_service_tests.cc +++ b/services/test/run_all_service_tests.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/i18n/icu_util.h" #include "base/macros.h" #include "base/path_service.h" #include "base/test/launcher/unit_test_launcher.h" @@ -36,6 +37,9 @@ params.single_process = true; ui::OzonePlatform::InitializeForGPU(params); #endif + + // base::TestSuite and ViewsInit both try to load icu. That's ok for tests. + base::i18n::AllowMultipleInitializeCallsForTesting(); } void Shutdown() override {
diff --git a/services/ui/public/cpp/tests/BUILD.gn b/services/ui/public/cpp/tests/BUILD.gn index 3d147d9..afdfd17 100644 --- a/services/ui/public/cpp/tests/BUILD.gn +++ b/services/ui/public/cpp/tests/BUILD.gn
@@ -10,8 +10,6 @@ sources = [ "property_type_converters_unittest.cc", - "window_server_test_suite.cc", - "window_server_test_suite.h", ] deps = [
diff --git a/services/ui/public/cpp/tests/run_all_unittests.cc b/services/ui/public/cpp/tests/run_all_unittests.cc deleted file mode 100644 index 7bc2699..0000000 --- a/services/ui/public/cpp/tests/run_all_unittests.cc +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/bind.h" -#include "base/test/launcher/unit_test_launcher.h" -#include "services/ui/public/cpp/tests/window_server_test_suite.h" - -int main(int argc, char** argv) { - ui::WindowServerTestSuite test_suite(argc, argv); - - return base::LaunchUnitTests(argc, argv, - base::Bind(&ui::WindowServerTestSuite::Run, - base::Unretained(&test_suite))); -}
diff --git a/services/ui/public/cpp/tests/window_server_test_suite.cc b/services/ui/public/cpp/tests/window_server_test_suite.cc deleted file mode 100644 index b05559f..0000000 --- a/services/ui/public/cpp/tests/window_server_test_suite.cc +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "services/ui/public/cpp/tests/window_server_test_suite.h" - -#include "base/i18n/icu_util.h" - -#if defined(USE_X11) -#include "ui/gfx/x/x11_connection.h" // nogncheck -#endif - -namespace ui { - -WindowServerTestSuite::WindowServerTestSuite(int argc, char** argv) - : TestSuite(argc, argv) {} - -WindowServerTestSuite::~WindowServerTestSuite() {} - -void WindowServerTestSuite::Initialize() { -#if defined(USE_X11) - // Each test ends up creating a new thread for the native viewport service. - // In other words we'll use X on different threads, so tell it that. - gfx::InitializeThreadedX11(); -#endif - - base::TestSuite::Initialize(); - - // base::TestSuite and ViewsInit both try to load icu. That's ok for tests. - base::i18n::AllowMultipleInitializeCallsForTesting(); -} - -} // namespace ui
diff --git a/services/ui/public/cpp/tests/window_server_test_suite.h b/services/ui/public/cpp/tests/window_server_test_suite.h deleted file mode 100644 index 7090aa9..0000000 --- a/services/ui/public/cpp/tests/window_server_test_suite.h +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_SUITE_H_ -#define SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_SUITE_H_ - -#include "base/macros.h" -#include "base/test/test_suite.h" - -namespace ui { - -class WindowServerTestSuite : public base::TestSuite { - public: - WindowServerTestSuite(int argc, char** argv); - ~WindowServerTestSuite() override; - - protected: - void Initialize() override; - - private: - DISALLOW_COPY_AND_ASSIGN(WindowServerTestSuite); -}; - -} // namespace ui - -#endif // SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_SUITE_H_
diff --git a/services/ui/ws/BUILD.gn b/services/ui/ws/BUILD.gn index 73659a52..3119d5a 100644 --- a/services/ui/ws/BUILD.gn +++ b/services/ui/ws/BUILD.gn
@@ -222,14 +222,9 @@ ] } -group("tests") { +source_set("tests") { testonly = true - deps = [ - ":ui_service_unittests", - ] -} -service_test("ui_service_unittests") { sources = [ "cursor_location_manager_unittest.cc", "cursor_state_unittest.cc", @@ -268,8 +263,6 @@ sources += [ "platform_display_default_unittest.cc" ] } - catalog = ":ui_service_unittests_catalog" - deps = [ ":lib", ":test_support", @@ -301,13 +294,12 @@ ] } -service_manifest("ui_service_unittests_app_manifest") { - name = "ui_service_unittests_app" - source = "ui_service_unittests_app_manifest.json" +service_manifest("unittests_manifest") { + name = "ui_service_unittests" + source = "test_manifest.json" } -catalog("ui_service_unittests_catalog") { - embedded_services = [ ":ui_service_unittests_app_manifest" ] - - standalone_services = [ "//services/ui:manifest" ] +catalog("tests_catalog") { + testonly = true + embedded_services = [ ":unittests_manifest" ] }
diff --git a/services/ui/ws/ui_service_unittests_app_manifest.json b/services/ui/ws/test_manifest.json similarity index 78% rename from services/ui/ws/ui_service_unittests_app_manifest.json rename to services/ui/ws/test_manifest.json index 86bcab5..01e893a 100644 --- a/services/ui/ws/ui_service_unittests_app_manifest.json +++ b/services/ui/ws/test_manifest.json
@@ -1,5 +1,5 @@ { - "name": "ui_service_unittests_app", + "name": "ui_service_unittests", "display_name": "Mus Window Server Unittests", "interface_provider_specs": { "service_manager:connector": { @@ -10,7 +10,7 @@ }, "requires": { "*": [ "app" ], - "ui_service_unittests_app": [ "ui:window_tree_client" ], + "ui_service_unittests": [ "ui:window_tree_client" ], "ui": [ "window_manager", "window_tree_host_factory"
diff --git a/services/ui/ws/window_server_service_test_base.cc b/services/ui/ws/window_server_service_test_base.cc index 4381b1e..6a4ccf8 100644 --- a/services/ui/ws/window_server_service_test_base.cc +++ b/services/ui/ws/window_server_service_test_base.cc
@@ -18,7 +18,7 @@ namespace { -const char kTestAppName[] = "ui_service_unittests_app"; +const char kTestAppName[] = "ui_service_unittests"; class WindowServerServiceTestClient : public service_manager::test::ServiceTestClient {
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index bd907a3..4d3fb50 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -688,6 +688,15 @@ "Nougat Phone Tester": { "gtest_tests": [ { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "android_webview_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -720,6 +729,15 @@ "test": "android_webview_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -752,6 +770,15 @@ "test": "base_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "breakpad_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -784,6 +811,15 @@ "test": "breakpad_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "capture_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -816,6 +852,15 @@ "test": "capture_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "cc_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -848,6 +893,15 @@ "test": "cc_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "chrome_public_test_apk" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -881,6 +935,15 @@ "test": "chrome_public_test_apk" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "chrome_sync_shell_test_apk" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -913,6 +976,15 @@ "test": "chrome_sync_shell_test_apk" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "components_browsertests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -945,6 +1017,15 @@ "test": "components_browsertests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "components_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -977,6 +1058,15 @@ "test": "components_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "content_browsertests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1010,6 +1100,15 @@ "test": "content_browsertests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "content_shell_test_apk" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1043,6 +1142,15 @@ "test": "content_shell_test_apk" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "content_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1076,6 +1184,15 @@ "test": "content_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "device_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1108,6 +1225,15 @@ "test": "device_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "events_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1140,6 +1266,15 @@ "test": "events_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gfx_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1172,6 +1307,15 @@ "test": "gfx_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1204,6 +1348,15 @@ "test": "gl_tests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gl_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1236,6 +1389,15 @@ "test": "gl_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_ipc_service_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1268,6 +1430,15 @@ "test": "gpu_ipc_service_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "gpu_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1300,6 +1471,15 @@ "test": "gpu_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ipc_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1332,6 +1512,15 @@ "test": "ipc_tests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "media_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1364,6 +1553,15 @@ "test": "media_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "net_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1397,6 +1595,15 @@ "test": "net_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sandbox_linux_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1429,6 +1636,15 @@ "test": "sandbox_linux_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "sql_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1461,6 +1677,15 @@ "test": "sql_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "storage_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1493,6 +1718,15 @@ "test": "storage_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_android_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1525,6 +1759,15 @@ "test": "ui_android_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_base_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1557,6 +1800,15 @@ "test": "ui_base_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "ui_touch_selection_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1589,6 +1841,15 @@ "test": "ui_touch_selection_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "unit_tests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1621,6 +1882,15 @@ "test": "unit_tests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "vr_shell_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -1653,6 +1923,15 @@ "test": "vr_shell_unittests" }, { + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "webview_instrumentation_test_apk" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 64d40c1..2a42e6c 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -1182,7 +1182,7 @@ } ] }, - "test": "service_unittests" + "test": "services_unittests" }, { "merge": {
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 2df4692..30c76fd 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -366,7 +366,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -414,12 +414,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "ui_touch_selection_unittests" }, { @@ -749,7 +743,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -1101,7 +1095,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index f1f9951..06026343 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -11716,7 +11716,7 @@ "swarming": { "can_use_on_swarming_builders": false }, - "test": "ui_service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -11735,7 +11735,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" + "test": "services_unittests" } ] },
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 26327940..99aa6078 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -5565,7 +5565,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -5977,7 +5977,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false } ], @@ -6410,7 +6410,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false } ], @@ -6854,7 +6854,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false } ], @@ -7337,7 +7337,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -8601,7 +8601,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -9033,7 +9033,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -9449,7 +9449,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -9886,7 +9886,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -10351,7 +10351,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -10913,7 +10913,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -11040,7 +11040,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -11167,7 +11167,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -11294,7 +11294,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -11424,7 +11424,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, { @@ -11554,7 +11554,7 @@ } ] }, - "test": "service_unittests", + "test": "services_unittests", "use_xvfb": false }, {
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 35a1541..e9c3b38 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -2806,7 +2806,7 @@ } ] }, - "test": "service_unittests" + "test": "services_unittests" }, { "merge": { @@ -4019,7 +4019,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -4061,12 +4061,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "ui_touch_selection_unittests" }, { @@ -4680,7 +4674,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -4722,12 +4716,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "ui_touch_selection_unittests" }, { @@ -5095,7 +5083,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -5137,12 +5125,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "ui_touch_selection_unittests" }, {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index dd3f7cb..2773bb8 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -337,7 +337,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -771,7 +771,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -1225,7 +1225,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -1643,7 +1643,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -2042,7 +2042,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": {
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index 601075f0..013d28e0 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -6554,65 +6554,6 @@ }, { "args": [ - "loading.mobile", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "loading.mobile", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 16200, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "loading.mobile", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "loading.mobile.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 16200, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "media.android.tough_video_cases", "-v", "--upload-results", @@ -6672,65 +6613,6 @@ }, { "args": [ - "media.android.tough_video_cases_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "media.android.tough_video_cases_tbmv2", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "media.android.tough_video_cases_tbmv2", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "media.android.tough_video_cases_tbmv2.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "media.mse_cases", "-v", "--upload-results", @@ -7586,65 +7468,6 @@ }, { "args": [ - "service_worker.service_worker", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "service_worker.service_worker", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "service_worker.service_worker.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "service_worker.service_worker_micro_benchmark", "-v", "--upload-results", @@ -8707,65 +8530,6 @@ }, { "args": [ - "smoothness.tough_webgl_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_webgl_ad_cases", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "smoothness.tough_webgl_ad_cases", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "smoothness.tough_webgl_ad_cases.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device1", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "speedometer", "-v", "--upload-results", @@ -57811,6 +57575,65 @@ "isolated_scripts": [ { "args": [ + "battor.steady_state", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "battor.steady_state", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "battor.steady_state", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "battor.steady_state.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "battor.trivial_pages", "-v", "--upload-results", @@ -57988,6 +57811,65 @@ }, { "args": [ + "blink_perf.css", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.css", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blink_perf.css", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.css.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "blink_perf.dom", "-v", "--upload-results", @@ -58047,6 +57929,65 @@ }, { "args": [ + "blink_perf.events", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.events", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blink_perf.events", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.events.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "blink_perf.layout", "-v", "--upload-results", @@ -58224,6 +58165,65 @@ }, { "args": [ + "blink_perf.shadow_dom", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.shadow_dom", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "blink_perf.shadow_dom", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "blink_perf.shadow_dom.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "blink_perf.svg", "-v", "--upload-results", @@ -58814,6 +58814,65 @@ }, { "args": [ + "kraken", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "kraken", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "kraken", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "kraken.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "loading.desktop", "-v", "--upload-results", @@ -58873,6 +58932,65 @@ }, { "args": [ + "media.mse_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "media.mse_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "media.mse_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "media.mse_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "media.tough_video_cases", "-v", "--upload-results", @@ -58932,6 +59050,65 @@ }, { "args": [ + "media.tough_video_cases_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "media.tough_video_cases_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "media.tough_video_cases_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "media.tough_video_cases_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "memory.desktop", "-v", "--upload-results", @@ -59050,6 +59227,65 @@ }, { "args": [ + "memory.long_running_idle_gmail_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "memory.long_running_idle_gmail_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "memory.long_running_idle_gmail_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "memory.long_running_idle_gmail_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "octane", "-v", "--upload-results", @@ -59286,6 +59522,85 @@ }, { "args": [ + "page_cycler_v2_site_isolation.basic_oopif", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "page_cycler_v2_site_isolation.basic_oopif", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "page_cycler_v2_site_isolation.basic_oopif", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "page_cycler_v2_site_isolation.basic_oopif.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [], + "isolate_name": "performance_browser_tests", + "name": "performance_browser_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ "power.idle_platform", "-v", "--upload-results", @@ -59433,6 +59748,65 @@ }, { "args": [ + "rasterize_and_record_micro.partial_invalidation", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "rasterize_and_record_micro.partial_invalidation", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "rasterize_and_record_micro.partial_invalidation", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "rasterize_and_record_micro.partial_invalidation.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "rasterize_and_record_micro.top_25", "-v", "--upload-results", @@ -59669,6 +60043,65 @@ }, { "args": [ + "smoothness.desktop_tough_pinch_zoom_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.desktop_tough_pinch_zoom_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.desktop_tough_pinch_zoom_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.desktop_tough_pinch_zoom_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "smoothness.gpu_rasterization.tough_filters_cases", "-v", "--upload-results", @@ -59728,6 +60161,65 @@ }, { "args": [ + "smoothness.gpu_rasterization.tough_path_rendering_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.gpu_rasterization.tough_path_rendering_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.gpu_rasterization.tough_path_rendering_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.gpu_rasterization.tough_path_rendering_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", "-v", "--upload-results", @@ -59905,6 +60397,65 @@ }, { "args": [ + "smoothness.maps", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.maps", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.maps", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.maps.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "smoothness.scrolling_tough_ad_cases", "-v", "--upload-results", @@ -60082,6 +60633,65 @@ }, { "args": [ + "smoothness.tough_animation_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_animation_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.tough_animation_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_animation_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "smoothness.tough_canvas_cases", "-v", "--upload-results", @@ -60377,6 +60987,124 @@ }, { "args": [ + "smoothness.tough_texture_upload_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_texture_upload_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.tough_texture_upload_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_texture_upload_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.tough_webgl_ad_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_webgl_ad_cases", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "smoothness.tough_webgl_ad_cases", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "smoothness.tough_webgl_ad_cases.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "smoothness.tough_webgl_cases", "-v", "--upload-results", @@ -60613,6 +61341,65 @@ }, { "args": [ + "start_with_ext.warm.blank_page", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "start_with_ext.warm.blank_page", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "start_with_ext.warm.blank_page", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "start_with_ext.warm.blank_page.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "startup.cold.blank_page", "-v", "--upload-results", @@ -60672,6 +61459,65 @@ }, { "args": [ + "startup.large_profile.cold.blank_page", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "startup.large_profile.cold.blank_page", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "startup.large_profile.cold.blank_page", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "startup.large_profile.cold.blank_page.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "startup.large_profile.warm.blank_page", "-v", "--upload-results", @@ -60908,6 +61754,65 @@ }, { "args": [ + "system_health.common_desktop", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "system_health.common_desktop", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "system_health.common_desktop", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "system_health.common_desktop.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "system_health.memory_desktop", "-v", "--upload-results", @@ -60967,6 +61872,65 @@ }, { "args": [ + "system_health.webview_startup", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "system_health.webview_startup", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "system_health.webview_startup", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "system_health.webview_startup.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "tab_switching.typical_25", "-v", "--upload-results", @@ -61439,6 +62403,124 @@ }, { "args": [ + "v8.infinite_scroll-classic_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.infinite_scroll-classic_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.infinite_scroll-classic_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.infinite_scroll-classic_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.infinite_scroll_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.infinite_scroll_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": false, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.infinite_scroll_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.infinite_scroll_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build30-b4", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 36000, + "hard_timeout": 10800, + "ignore_task_failure": true, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.runtime_stats.top_25", "-v", "--upload-results",
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 0ab3168..2cf5a44 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -389,7 +389,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -431,12 +431,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "ui_service_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "ui_touch_selection_unittests" }, { @@ -945,7 +939,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -1480,7 +1474,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -1944,7 +1938,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": {
diff --git a/testing/buildbot/client.v8.chromium.json b/testing/buildbot/client.v8.chromium.json index f1c4a4bc6..bb493a0 100644 --- a/testing/buildbot/client.v8.chromium.json +++ b/testing/buildbot/client.v8.chromium.json
@@ -278,7 +278,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": { @@ -619,7 +619,7 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "service_unittests" + "test": "services_unittests" }, { "swarming": {
diff --git a/testing/buildbot/filters/ash_unittests_mus.filter b/testing/buildbot/filters/ash_unittests_mus.filter index 0882e88..a35f43c 100644 --- a/testing/buildbot/filters/ash_unittests_mus.filter +++ b/testing/buildbot/filters/ash_unittests_mus.filter
@@ -37,6 +37,20 @@ -LockStateControllerTest.ShutdownWithoutButton -MagnificationControllerTest.PanWindowToLeft -MagnificationControllerTest.PanWindowToRight +-MaximizeModeControllerTest.CloseLidWhileInMaximizeMode +-MaximizeModeControllerTest.ForceTouchViewModeTest +-MaximizeModeControllerTest.HingeAligned +-MaximizeModeControllerTest.InitializedWhileTabletModeSwitchOn +-MaximizeModeControllerTest.MaximizeModeAfterExitingDockedMode +-MaximizeModeControllerTest.MaximizeModeTest +-MaximizeModeControllerTest.NoMaximizeModeWithDisabledInternalDisplay +-MaximizeModeControllerTest.StableHingeAnglesWithLidOpened +-MaximizeModeControllerTest.TabletModeTransition +-MaximizeModeControllerTest.TabletModeTransitionNoKeyboardAccelerometer +-MaximizeModeControllerTest.UnstableHingeAnglesWhenLidRecentlyOpened +-MaximizeModeControllerTest.UnstableHingeAnglesWithLidOpened +-MaximizeModeControllerTest.VerticalHingeTest +-MaximizeModeControllerTest.VerticalHingeUnstableAnglesTest -MirrorWindowControllerTest.MirrorCursorBasic -MirrorWindowControllerTest.MirrorCursorLocations -MirrorWindowControllerTest.MirrorCursorMoveOnEnter @@ -54,20 +68,6 @@ -ScreenRotationAnimatorSmoothAnimationTest.RemoveExternalSecondaryDisplayBeforeSecondCopyCallback -ScreenRotationAnimatorSmoothAnimationTest.RemoveExternalPrimaryDisplayBeforeSecondCopyCallback -ShellTest2.DontCrashWhenWindowDeleted --TabletModeControllerTest.CloseLidWhileInTabletMode --TabletModeControllerTest.ForceTouchViewModeTest --TabletModeControllerTest.HingeAligned --TabletModeControllerTest.InitializedWhileTabletModeSwitchOn --TabletModeControllerTest.TabletModeAfterExitingDockedMode --TabletModeControllerTest.TabletModeTest --TabletModeControllerTest.NoTabletModeWithDisabledInternalDisplay --TabletModeControllerTest.StableHingeAnglesWithLidOpened --TabletModeControllerTest.TabletModeTransition --TabletModeControllerTest.TabletModeTransitionNoKeyboardAccelerometer --TabletModeControllerTest.UnstableHingeAnglesWhenLidRecentlyOpened --TabletModeControllerTest.UnstableHingeAnglesWithLidOpened --TabletModeControllerTest.VerticalHingeTest --TabletModeControllerTest.VerticalHingeUnstableAnglesTest -ToastManagerTest.NullMessageHasNoDismissButton -ToastManagerTest.QueueMessage -ToastManagerTest.ShowAndCloseManuallyDuringAnimation @@ -79,11 +79,11 @@ -VirtualKeyboardControllerAlwaysEnabledTest.DoesNotSuppressKeyboard -VirtualKeyboardControllerAutoTest.DisabledIfInternalKeyboardPresent -VirtualKeyboardControllerAutoTest.DisabledIfNoTouchScreen --VirtualKeyboardControllerAutoTest.EnabledDuringTabletMode +-VirtualKeyboardControllerAutoTest.EnabledDuringMaximizeMode -VirtualKeyboardControllerAutoTest.HandleMultipleKeyboardsPresent -VirtualKeyboardControllerAutoTest.SuppressedIfExternalKeyboardPresent -VirtualKeyboardControllerAutoTest.SuppressedInMaximizedMode --VirtualKeyboardControllerTest.EnabledDuringTabletMode +-VirtualKeyboardControllerTest.EnabledDuringMaximizeMode -VirtualKeyboardControllerTest.RestoreKeyboardDevices -WindowManagerTest.MouseEventCursors -WindowManagerTest.TestCursorClientObserver
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index fd11d1d3..ce871ca1 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -833,8 +833,8 @@ "label": "//services:service_junit_tests", "type": "junit_test", }, - "service_unittests": { - "label": "//services:service_unittests", + "services_unittests": { + "label": "//services:services_unittests", "type": "windowed_test_launcher", }, "setup_unittests": { @@ -1013,10 +1013,6 @@ "label": "//ui/android:ui_junit_tests", "type": "junit_test", }, - "ui_service_unittests": { - "label": "//services/ui/ws:ui_service_unittests", - "type": "windowed_test_launcher", - }, "ui_touch_selection_unittests": { "label": "//ui/touch_selection:ui_touch_selection_unittests", "type": "windowed_test_launcher",
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 5ea6c46..48e42e3 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -278,200 +278,468 @@ # ====== LayoutNG-only failures from here ====== # LayoutNG - is a new layout system for Blink. -### external/wpt/css/CSS2/floats-clear -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht [ Skip ] +### virtual/layout_ng flaky tests +### flaky expectations cannot be generated automatically +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-remove-002.xht [ Failure Pass ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-remove-004.xht [ Failure Pass ] +### virtual/layout Mac color palette/font failures +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-007.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002a.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002b.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-valign-001.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-110.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-inherit-001.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-027.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-001.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-002.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-003.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-004.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-005.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-006.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-007.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-009.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-012.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-013.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-014.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-015.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-001.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-002.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-003.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-004.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-005.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-006.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-007.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-009.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-012.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-013.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-014.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-015.xht [ Failure ] + +### virtual/layout_ng/external/wpt/css/CSS2/abspos +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-009a.xht [ Failure ] + +### virtual/layout_ng/external/wpt/css/CSS2/floats +crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001a.xht [ Failure ] +crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001b.xht [ Failure ] +crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001c.xht [ Failure ] +crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule3-outside-left-002.xht [ Failure ] +crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule3-outside-right-002.xht [ Failure ] +crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-left-001.xht [ Failure ] +crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-003r.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht [ Failure ] +crbug.com/723135 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-zero-height-wrap-001.xht [ Failure ] +crbug.com/723135 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-zero-height-wrap-002.xht [ Failure ] + +### virtual/layout_ng/external/wpt/css/CSS2/floats-clear +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-010.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-011.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht [ Skip ] -crbug.com/719615 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-025.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-028.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-029.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-030.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-031.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-036.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-038.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-039.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-101.xht [ Skip ] +crbug.com/719615 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-025.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-028.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-029.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-031.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-036.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-038.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-039.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-101.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-108.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-109.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-110.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-113.xht [ Skip ] -crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-114.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-113.xht [ Failure ] +crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-114.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-126.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-127.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-128.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-129.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-130.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-131.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-132.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-133.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-134.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-136.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-132.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-137.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-138.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-141.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-143.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-144.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-145.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-146.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-153.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-bfc-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-bfc-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-009.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-138.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-141.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-143.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-144.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-145.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-146.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-153.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-018.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-033.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-034.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-035.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-121.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-122.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-123.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-125.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-134.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-142.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-158.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-009.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht [ Failure ] -### external/wpt/css/CSS2/floats -crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule3-outside-left-002.xht [ Skip ] -crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule3-outside-right-002.xht [ Skip ] -crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-left-001.xht [ Skip ] -crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Skip ] -crbug.com/723135 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-zero-height-wrap-001.xht [ Skip ] -crbug.com/723135 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-zero-height-wrap-002.xht [ Skip ] -crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001a.xht [ Skip ] -crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001b.xht [ Skip ] -crbug.com/719620 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-placement-vertical-001c.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-001-right-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-right-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-bfc-003r.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht [ Skip ] +### virtual/layout_ng/external/wpt/css/CSS2/linebox +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-001.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-002.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-003.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/empty-inline-002.xht [ Crash ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-001.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-002.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-003.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-004.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-005.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-006.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-007.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-010b.xht [ Skip ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-012.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-013.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-022.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-023.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-002.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-004.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-005.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-013.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-015.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-016.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-024.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-026.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-027.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-035.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-037.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-038.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-046.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-048.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-049.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-057.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-059.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-060.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-068.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-070.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-071.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-079.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-081.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-082.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-090.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-092.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-093.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-101.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-103.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-104.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-125.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-129.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-bleed-001.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-bleed-002.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-117a.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-118a.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-121.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-baseline-004a.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-baseline-005a.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-sub-001.xht [ Failure ] +crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-super-001.xht [ Failure ] -### external/wpt/css/CSS2/positioning -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-010.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-011.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-010.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-019.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-020.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-021.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-022.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-023.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-025.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-011.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-018.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-019.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-025.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-032.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-033.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-036.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-023.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-030.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-031.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-032.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-037.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-038.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-051.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-052.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-064.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-065.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-066.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-067.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-071.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-011.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-019.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-020.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-007.xht [ Skip ] +### virtual/layout_ng/external/wpt/css/CSS2/normal-flow +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001a.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001f.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-002f.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-008a.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-009.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-010.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-011.xht [ Failure ] +crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001a.xht [ Failure ] +crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001b.xht [ Failure ] +crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-002a.xht [ Failure ] +crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-002b.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-percents-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-non-replaced-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-non-replaced-width-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-replaced-width-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-replaced-width-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-017.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-018.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-019.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-025.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-016.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-023.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-034.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-035.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-037.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-038.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-045.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-046.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-048.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-049.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-056.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-057.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-059.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-060.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-067.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-068.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-070.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-071.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-078.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-079.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-081.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-082.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-089.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-090.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-092.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-093.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-114.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-percentage-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-002.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-003.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-004.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-005.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-height-008.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-valign-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-height-008.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-zorder-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-003.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-004.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-005.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-006.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-016.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-017.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-020.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-016.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-035.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-037.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-038.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-046.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-048.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-049.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-057.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-059.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-060.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-068.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-070.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-071.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-079.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-081.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-082.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-090.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-092.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-093.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-101.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-percentage-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-percentage-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-106.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-014.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-016.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-023.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-034.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-035.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-037.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-038.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-045.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-046.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-048.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-049.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-056.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-057.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-059.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-060.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-067.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-068.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-070.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-071.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-078.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-079.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-081.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-082.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-089.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-090.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-092.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-093.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-100.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-101.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-102.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-104.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-106.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-014.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/replaced-intrinsic-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/replaced-intrinsic-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/root-box-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/table-in-inline-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-applies-to-012.xht [ Failure ] + +### virtual/layout_ng/external/wpt/css/CSS2/positioning +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-010.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-011.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-006.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-010.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-015.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-019.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-020.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-021.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-022.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-023.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-025.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-011.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-018.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-019.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-025.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-026.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-032.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-033.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-height-036.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-013.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-023.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-030.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-031.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-032.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-037.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-038.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-051.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-052.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-064.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-065.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-066.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-067.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-replaced-width-071.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-007.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-008.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-011.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-012.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-019.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-020.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-024.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-containing-block-007.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-inline-001.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-inline-002.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-inline-003.xht [ Skip ] @@ -480,630 +748,256 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-inline-006.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-paged-001.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-paged-002.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-001.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-002.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-003.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-004.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-005.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-006.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-007.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-009.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-012.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-013.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-014.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/bottom-applies-to-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/left-offset-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/left-offset-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/left-offset-percentage-001.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/left-offset-003.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/left-offset-percentage-001.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-absolute-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-absolute-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-absolute-006.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-001.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-002.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-003.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-004.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-005.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-006.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-007.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-009.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-012.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-013.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-014.xht [ Skip ] -crbug.com/713891 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-applies-to-015.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-fixed-003.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-fixed-004.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-fixed-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-003.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-020.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-021.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-022.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-028.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-029.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-030.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-031.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-032.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-027.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-028.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-029.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-030.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-031.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-034.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-035.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-035.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-036.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-037.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-static-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/relpos-calcs-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/relpos-calcs-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-019.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-020.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-031.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-032.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-043.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-044.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-055.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-056.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-067.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-068.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-079.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-080.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-091.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-092.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-103.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-104.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-113.xht [ Skip ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-037.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-static-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-001.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-002.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/relpos-calcs-004.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/relpos-calcs-005.xht [ Failure ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-007.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-008.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-019.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-020.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-031.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-032.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-043.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-044.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-055.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-056.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-067.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-068.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-079.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-080.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-091.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-092.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-103.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-104.xht [ Crash ] +crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/top-113.xht [ Crash ] -#### external/wpt/css/CSS2/abspos -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/abspos/abspos-containing-block-initial-009a.xht [ Skip ] +### virtual/layout_ng/fast/block/basic +crbug.com/635619 virtual/layout_ng/fast/block/basic/003.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/006.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/011.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/013.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/014.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/015.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/016.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/018.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/020.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/adding-near-anonymous-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/fieldset-stretch-to-legend.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/min-pref-width-nowrap-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-height.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-percent-height-grandchild.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/text-indent-rtl.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/truncation-rtl.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/white-space-pre-wraps.html [ Failure ] -#### external/wpt/css/CSS2/normal-flow -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001a.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001f.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-002f.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-008a.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-009.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-010.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-011.xht [ Skip ] -crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001a.xht [ Skip ] -crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001b.xht [ Skip ] -crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-002a.xht [ Skip ] -crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-002b.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-percents-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-non-replaced-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-non-replaced-width-007.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-replaced-width-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-017.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-018.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-019.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-025.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-016.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-023.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-034.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-035.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-037.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-038.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-045.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-046.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-048.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-049.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-056.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-057.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-059.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-060.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-067.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-068.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-070.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-071.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-078.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-079.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-081.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-082.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-089.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-090.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-091.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-092.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-093.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-104.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-114.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-applies-to-014.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-percentage-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-height-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-valign-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-zorder-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-width-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-height-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-height-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-011.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-014.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-replaced-width-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002a.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002b.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-valign-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-zorder-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-zorder-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-016.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-017.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-020.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-016.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-035.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-037.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-038.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-046.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-047.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-048.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-049.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-057.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-059.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-060.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-068.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-070.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-071.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-079.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-081.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-082.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-090.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-091.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-092.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-093.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-101.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-104.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-applies-to-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-percentage-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-percentage-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-106.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-110.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-applies-to-014.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-percentage-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-003.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-004.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-013.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-015.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-016.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-023.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-024.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-026.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-027.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-034.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-035.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-037.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-038.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-045.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-046.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-047.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-048.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-049.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-056.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-057.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-059.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-060.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-067.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-068.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-070.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-071.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-078.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-079.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-081.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-082.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-089.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-090.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-091.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-092.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-093.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-100.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-101.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-102.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-103.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-104.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-106.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-height-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-005.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-006.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-applies-to-014.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/min-width-percentage-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/replaced-intrinsic-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/replaced-intrinsic-002.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/root-box-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/table-in-inline-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-applies-to-012.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-inherit-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-percentage-001.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-percentage-002.xht [ Skip ] +### virtual/layout_ng/fast/block/float +crbug.com/635619 virtual/layout_ng/fast/block/float/002.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/003.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/008.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/010.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/012.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/013.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/014.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/015.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/016.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/017.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/018.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/019.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/020.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/021.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/022.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/023.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/024.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/025.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/026.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/027.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/028.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/029.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/030.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/031.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/032.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/033.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/035.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/add-float-back-to-anonymous-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-and-ensure-layout-on-containers-of-removed-floats.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html [ Crash ] +crbug.com/719615 virtual/layout_ng/fast/block/float/add-inlines-in-block-children-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-3.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-4.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-5.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-6.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-compat.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-strict.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-rtl.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoiding-float-centered.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/block-with-negative-margin-clears-float.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear-2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/canvas-with-floats-marked-for-layout.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/centered-float-avoidance-complexity.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/checkbox-and-radio-avoid-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/clear-element-too-wide-for-containing-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/clear-intruding-floats-when-moving-to-inline-parent-3.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/clear-to-fit.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/containing-block-change-compositing.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/crash-on-absolute-positioning.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/crash-replaced-display-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/dynamic-unfloat-pref-width.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/editable-text-overlapping-float.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/element-clears-float-without-clearance.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/fit_line_below_floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-at-start-of-clean-lines-that-are-subsequently-dirtied-vertical-rl.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-at-start-of-clean-lines-that-are-subsequently-dirtied.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-avoidance.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-forced-below-other-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-in-float-hit-testing.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-in-float-painting.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-inserted-into-clean-line.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-list-changed-before-layout-crash.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-first-letter.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling-crash.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling3.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling5.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-pre-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-empty-line.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-line-large-and-small-float-below.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-line-obeys-container-padding.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-zero-height-line.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-overflow-hidden-containing-block-width.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-overhangs-root.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-reinsertion-failure.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-reparent-during-detach-crash.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent-rl.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-do-not-overhang-from-block-formatting-context.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk-line-height.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict-line-height.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-quirk-line-height.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-strict-line-height.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-with-margin-should-not-wrap.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-001.htm [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-002.htm [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-003.htm [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-004.htm [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-007.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/formatting-context-changes.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/independent-align-positioning.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-painted-twice.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/logical-bottom-exceeds-layoutunit-max.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/margin-top-changes.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/marquee-shrink-to-avoid-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/multiple-float-positioning.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/negative-margin-on-element-avoiding-floats-with-margin-on-parent.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/negative-margin-on-element-avoiding-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/nested-clearance.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/nested-floats-expand-formatting-context.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/nopaint-after-layer-destruction.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/nopaint-after-layer-destruction2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/nowrap-clear-min-width.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-add-in-static-position-block.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-add-in-static-position-block2.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-container-add-compositing.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-absolute-position-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-fixed-position-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-fixed-position-block2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-tall-block.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overlapping-floats-paint-hittest-order-1.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overlapping-floats-paint-hittest-order-2.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/override-property-float.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-abspos-001.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-float-001.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/relative-painted-twice.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/remove-line-above-float-above-line-crash.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-made-inline-crash.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash-2.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-avoid-float-complexity.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-fit-width.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/split-inline-sibling-of-float-crash.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/table-relayout.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-layout-2.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-layout.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/vertical-move-relayout.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/float/width-update-after-clear.html [ Failure ] -#### fast/block/basic -crbug.com/635619 virtual/layout_ng/fast/block/basic/001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/003.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/010.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/011.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/012.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/013.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/014.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/015.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/016.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/018.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/020.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/adding-near-anonymous-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/fieldset-stretch-to-legend.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/minheight.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-height.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-percent-height-grandchild.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/text-indent-rtl.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/truncation-rtl.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/white-space-pre-wraps.html [ Skip ] -# Crashes related to the margin calculation in NGBlockLayoutAlgorithm::PrepareChildLayout -crbug.com/635619 virtual/layout_ng/fast/block/basic/min-pref-width-nowrap-floats.html [ Failure Crash ] +### virtual/layout_ng/fast/block/margin-collapse +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/006.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/016.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/025.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/030.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/032.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/033.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/043.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/044.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/057.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/101.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/102.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/103.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/104.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/bfc-beside-float-complex-margin-collapsing.html [ Failure ] -#### fast/block/margin-collapse -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/004.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/016.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/018.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/021.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/022.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/025.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/028.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/029.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/030.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/031.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/032.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/033.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/035.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/037.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/038.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/042.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/043.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/044.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/055.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/057.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/058.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/062.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/063.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/100.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/101.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/102.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/103.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/104.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/bfc-beside-float-complex-margin-collapsing.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/001.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/002.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/003.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/004.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/005.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/010.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/011.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/012.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/015.html [ Skip ] -crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/018.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/016.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/021.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/022.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/025.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/empty-clear-blocks.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-creates-block-formatting-context.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-getting-layout-set.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-children.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-descendants.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-with-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/table-beside-float-complex-margin-collapsing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-container.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Skip ] +### virtual/layout_ng/fast/block/margin-collapse/block-inside-inline +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/001.html [ Failure ] +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/002.html [ Failure ] +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/003.html [ Failure ] +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/004.html [ Failure ] +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/005.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/006.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/010.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/011.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/012.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/015.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/016.html [ Failure ] +crbug.com/719646 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/018.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/021.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/022.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/025.html [ Failure ] -#### fast/block/float -crbug.com/635619 virtual/layout_ng/fast/block/float/001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/002.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/003.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/004.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/005.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/007.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/008.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/009.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/010.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/012.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/013.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/014.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/015.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/016.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/017.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/018.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/019.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/020.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/021.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/022.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/023.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/024.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/025.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/026.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/027.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/028.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/029.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/030.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/031.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/032.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/033.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/034.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/035.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/4145535Crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/add-float-back-to-anonymous-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-between-floats-with-preceding-anonymous-box.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-and-ensure-layout-on-containers-of-removed-floats.html [ Skip ] -crbug.com/719615 virtual/layout_ng/fast/block/float/add-inlines-in-block-children-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-3.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-4.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-5.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-6.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-with-negative-margins.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-compat.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-strict.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-rtl.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoiding-float-centered.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/block-with-negative-margin-clears-float.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/canvas-with-floats-marked-for-layout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/centered-float-avoidance-complexity.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/checkbox-and-radio-avoid-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/clamped-right-float.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/clear-element-too-wide-for-containing-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/clear-intruding-floats-when-moving-to-inline-parent-3.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/clear-negative-margin-top.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/clear-to-fit.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/containing-block-change-compositing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/crash-on-absolute-positioning.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/crash-replaced-display-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/dynamic-unfloat-pref-width.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/editable-text-overlapping-float.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/element-clears-float-without-clearance.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/fit_line_below_floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-at-start-of-clean-lines-that-are-subsequently-dirtied-vertical-rl.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-at-start-of-clean-lines-that-are-subsequently-dirtied.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-avoidance.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-change-composited-scrolling.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-forced-below-other-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-in-float-hit-testing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-in-float-painting.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-inserted-into-clean-line.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-list-changed-before-layout-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-mark-descendants-for-layout-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-crash2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling3.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling5.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-pre-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-empty-line.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-line-large-and-small-float-below.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-line-obeys-container-padding.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-zero-height-line.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-overflow-hidden-containing-block-width.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-overhangs-root.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-reinsertion-failure.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-reparent-during-detach-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent-rl.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-do-not-overhang-from-block-formatting-context.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk-line-height.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict-line-height.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-quirk-line-height.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-strict-line-height.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-with-margin-should-not-wrap.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-007.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/formatting-context-changes.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/in-margin.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/independent-align-positioning.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-not-removed-writing-mode.xhtml [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-sibling-with-margin.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-painted-twice.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/logical-bottom-exceeds-layoutunit-max.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/marquee-shrink-to-avoid-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/max-width-clear-float-with-overflow-hidden.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/multiple-float-positioning.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/negative-margin-clear.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/negative-margin-on-element-avoiding-floats-with-margin-on-parent.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/negative-margin-on-element-avoiding-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nested-clearance.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nested-floats-expand-formatting-context.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nestedAnonymousBlocks.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nestedAnonymousBlocks2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nopaint-after-layer-destruction.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nopaint-after-layer-destruction2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/nowrap-clear-min-width.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-after-height-decrease-offsets.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-after-height-decrease.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-add-in-static-position-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-add-in-static-position-block2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-container-add-compositing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-absolute-position-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-absolute-position-block2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-fixed-position-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-fixed-position-block2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-tall-block.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-from-second-last-sibling.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-from-third-last-sibling.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overlapping-floats-paint-hittest-order-1.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overlapping-floats-paint-hittest-order-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overlapping-floats-with-overflow-hidden.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/override-property-float.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-abspos-001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-abspos-002.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-float-001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/previous-sibling-float-002.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/relative-painted-twice.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/remove-line-above-float-above-line-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-made-inline-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-avoid-float-complexity.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-fit-width.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/split-inline-sibling-of-float-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/table-relayout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-layout-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-layout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/vertical-move-relayout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/width-update-after-clear.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-first-letter.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-not-cleared-from-grand-parents.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/relayout-nested-float-after-line.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/selection-gap-clip-out-tiger-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling4.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/line-break-after-white-space-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/margin-top-changes.html [ Skip ] - -#### external/wpt/css/CSS2/linebox -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-001.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-002.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/border-padding-bleed-003.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/empty-inline-002.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-001.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-002.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-003.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-004.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-005.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-006.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-007.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-009.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-010b.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-012.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-013.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-015.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-022.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-023.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-002.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-004.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-005.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-013.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-015.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-016.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-024.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-026.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-027.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-035.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-037.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-038.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-046.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-048.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-049.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-057.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-059.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-060.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-068.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-070.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-071.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-079.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-081.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-082.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-090.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-092.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-093.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-101.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-103.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-104.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-125.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-126.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-129.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-bleed-001.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-bleed-002.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-117a.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-118a.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-121.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-applies-to-008.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-baseline-004a.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-baseline-005a.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-sub-001.xht [ Skip ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/vertical-align-super-001.xht [ Skip ] +### virtual/layout_ng/fast/block/margin-collapse +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/empty-clear-blocks.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-creates-block-formatting-context.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-getting-layout-set.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-children.html [ Crash ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-descendants.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-with-floats.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/table-beside-float-complex-margin-collapsing.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-container.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Failure ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Failure ] # ====== LayoutNG-only failures until here ======
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index 1ad0d073..dd9705c8 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -170,6 +170,7 @@ last_text_node_ended_with_collapsed_space_(false), sorted_text_boxes_position_(0), behavior_(AdjustBehaviorFlags<Strategy>(behavior)), + needs_handle_pre_formatted_text_node_(false), handled_first_letter_(false), should_stop_(false), handle_shadow_root_(false), @@ -274,6 +275,8 @@ text_state_.ResetRunInformation(); + // TODO(xiaochengh): Wrap the following code into HandleRememberedProgress(). + // handle remembered node that needed a newline after the text node's newline if (needs_another_newline_) { // Emit the extra newline, and position it *inside* m_node, after m_node's @@ -291,12 +294,18 @@ if (ShouldProceedToRemainingText()) ProceedToRemainingText(); - // handle remembered text box + // Handle remembered text box if (text_box_) { HandleTextBox(); if (text_state_.PositionNode()) return; } + // Handle remembered pre-formatted text node. + if (needs_handle_pre_formatted_text_node_) { + HandlePreFormattedTextNode(); + if (text_state_.PositionNode()) + return; + } while (node_ && (node_ != past_end_node_ || shadow_depth_ > 0)) { if (!should_stop_ && StopsOnFormControls() && @@ -516,18 +525,21 @@ } template <typename Strategy> -bool TextIteratorAlgorithm<Strategy>::HandlePreFormattedTextNode() { +void TextIteratorAlgorithm<Strategy>::HandlePreFormattedTextNode() { // TODO(xiaochengh): Get rid of repeated computation of these fields. Text* const text_node = ToText(node_); LayoutText* const layout_object = text_node->GetLayoutObject(); const String str = layout_object->GetText(); + needs_handle_pre_formatted_text_node_ = false; + if (last_text_node_ended_with_collapsed_space_ && HasVisibleTextNode(layout_object)) { if (!behavior_.CollapseTrailingSpace() || (offset_ > 0 && str[offset_ - 1] == ' ')) { SpliceBuffer(kSpaceCharacter, text_node, 0, offset_, offset_); - return false; + needs_handle_pre_formatted_text_node_ = true; + return; } } if (ShouldHandleFirstLetter(*layout_object)) { @@ -544,16 +556,18 @@ first_letter_text_ = nullptr; text_box_ = 0; offset_ = run_end; - return stops_in_first_letter; + if (!stops_in_first_letter) + needs_handle_pre_formatted_text_node_ = true; + return; } // We are here only if the DOM and/or layout trees are broken. // For robustness, we should stop processing this node. NOTREACHED(); - return false; + return; } if (layout_object->Style()->Visibility() != EVisibility::kVisible && !IgnoresStyleVisibility()) - return false; + return; DCHECK_GE(static_cast<unsigned>(offset_), layout_object->TextStartOffset()); const unsigned run_start = offset_ - layout_object->TextStartOffset(); const unsigned str_length = str.length(); @@ -563,10 +577,9 @@ const unsigned run_end = std::min(str_length, end); if (run_start >= run_end) - return true; + return; EmitText(text_node, text_node->GetLayoutObject(), run_start, run_end); - return true; } template <typename Strategy> @@ -579,6 +592,9 @@ return true; } + DCHECK_NE(last_text_node_, node_) + << "We should never call HandleTextNode on the same node twice"; + Text* text_node = ToText(node_); LayoutText* layout_object = text_node->GetLayoutObject(); @@ -586,8 +602,10 @@ String str = layout_object->GetText(); // handle pre-formatted text - if (!layout_object->Style()->CollapseWhiteSpace()) - return HandlePreFormattedTextNode(); + if (!layout_object->Style()->CollapseWhiteSpace()) { + HandlePreFormattedTextNode(); + return true; + } if (layout_object->FirstTextBox()) text_box_ = layout_object->FirstTextBox();
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h index dd19dbf..64f48c8 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -141,7 +141,7 @@ // not always clearly control the iteration progress. Should consider removing // the return values and control the iteration in a cleaner way. bool HandleTextNode(); - bool HandlePreFormattedTextNode(); + void HandlePreFormattedTextNode(); bool HandleReplacedElement(); bool HandleNonTextNode(); @@ -250,6 +250,8 @@ const TextIteratorBehavior behavior_; + // Remember if we are in the middle of handling a pre-formatted text node. + bool needs_handle_pre_formatted_text_node_; // Used when deciding text fragment created by :first-letter should be looked // into. bool handled_first_letter_;
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index 463937a..88836a29 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -865,6 +865,9 @@ if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled()) return true; + if (MemoryCoordinator::IsLowEndDevice()) + return false; + if (!RuntimeEnabledFeatures::displayList2dCanvasEnabled()) return false;
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp index de68c82..7e6ca63 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -604,6 +604,9 @@ // Stop the animation. StopAnimation(); + if (!GetImageObserver()) + return false; + // See if anyone is still paying attention to this animation. If not, we // don't advance, and will remain suspended at the current frame until the // animation is resumed. @@ -654,7 +657,8 @@ } void BitmapImage::NotifyObserversOfAnimationAdvance(TimerBase*) { - GetImageObserver()->AnimationAdvanced(this); + if (GetImageObserver()) + GetImageObserver()->AnimationAdvanced(this); } } // namespace blink
diff --git a/third_party/khronos/EGL/eglext.h b/third_party/khronos/EGL/eglext.h index b6811a1..d07a7b7 100644 --- a/third_party/khronos/EGL/eglext.h +++ b/third_party/khronos/EGL/eglext.h
@@ -1214,6 +1214,32 @@ #endif #endif +#ifndef EGL_ANGLE_stream_producer_d3d_texture_nv12 +#define EGL_ANGLE_stream_producer_d3d_texture_nv12 +#define EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB +typedef EGLBoolean( + EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERD3DTEXTURENV12ANGLEPROC)( + EGLDisplay dpy, + EGLStreamKHR stream, + const EGLAttrib* attrib_list); +typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMPOSTD3DTEXTURENV12ANGLEPROC)( + EGLDisplay dpy, + EGLStreamKHR stream, + void* texture, + const EGLAttrib* attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY +eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy, + EGLStreamKHR stream, + const EGLAttrib* attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY +eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy, + EGLStreamKHR stream, + void* texture, + const EGLAttrib* attrib_list); +#endif +#endif + #ifdef __cplusplus } #endif
diff --git a/third_party/khronos/README.chromium b/third_party/khronos/README.chromium index 82662e6..83eaa5a2 100644 --- a/third_party/khronos/README.chromium +++ b/third_party/khronos/README.chromium
@@ -33,6 +33,7 @@ - Added EGLNative*Type for native linux framebuffers. EGL/eglext.h - Added support for EGL_EXT_image_flush_external extension + - Added support for EGL_ANGLE_stream_producer_d3d_texture_nv12 KHR/khrplatform.h - Modified KHRONOS_APICALL DEPS
diff --git a/tools/battor_agent/battor_connection_impl.cc b/tools/battor_agent/battor_connection_impl.cc index e3dfa2d..a6b86187 100644 --- a/tools/battor_agent/battor_connection_impl.cc +++ b/tools/battor_agent/battor_connection_impl.cc
@@ -222,13 +222,7 @@ return; } - if (bytes_read == 0) { - // If we didn't have a message before, and we weren't able to read any - // additional bytes, then there's no valid message available. - LogSerial("Read failed due to no bytes being read."); - EndReadBytes(false, BATTOR_MESSAGE_TYPE_CONTROL, nullptr); - return; - } + // NOTE: Zero bytes may have been read. if (pending_read_message_type_ == BATTOR_MESSAGE_TYPE_SAMPLES) { // If we're reading samples, don't log every byte that we receive. This
diff --git a/tools/determinism/deterministic_build_whitelist.pyl b/tools/determinism/deterministic_build_whitelist.pyl index 6007a28..5721b9d 100644 --- a/tools/determinism/deterministic_build_whitelist.pyl +++ b/tools/determinism/deterministic_build_whitelist.pyl
@@ -334,7 +334,6 @@ 'udp_proxy.exe', 'ui_base_unittests.exe', 'ui_library.dll', - 'ui_service_unittests.exe', 'ui_struct_traits_unittests.exe', 'ui_touch_selection_unittests.exe', 'unit_tests.exe',
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 0afb7ec..3c89c35 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -2225,6 +2225,7 @@ <int value="169" label="RWH_SURFACE_INVARIANTS_VIOLATION"/> <int value="170" label="RFH_ILLEGAL_UPLOAD_PARAMS"/> <int value="171" label="RFH_BASE_URL_FOR_DATA_URL_SPECIFIED"/> + <int value="172" label="RFPH_ILLEGAL_UPLOAD_PARAMS"/> </enum> <enum name="BadMessageReasonExtensions" type="int"> @@ -21877,6 +21878,7 @@ <int value="-836123854" label="wallet-service-use-sandbox"/> <int value="-835672415" label="PointerEventV1SpecCapturing:disabled"/> <int value="-834661509" label="ModalPermissionPrompts:disabled"/> + <int value="-832561975" label="enable-picture-in-picture"/> <int value="-825942229" label="tab-management-experiment-type-elderberry"/> <int value="-823165021" label="MaterialDesignUserMenu:enabled"/> <int value="-820041355" label="enable-transition-compositing"/> @@ -22527,6 +22529,7 @@ <int value="1612974229" label="allow-insecure-localhost"/> <int value="1617187093" label="enable-improved-a2hs"/> <int value="1622131033" label="ozone-test-single-overlay-support"/> + <int value="1633456034" label="chrome-home-swipe-logic"/> <int value="1634897915" label="password-import-export:enabled"/> <int value="1636962093" label="disable-material-design-ntp"/> <int value="1646498561" label="OfflineBookmarks:disabled"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 5f4ea6b..7e30653 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -37667,6 +37667,9 @@ </histogram> <histogram name="Net.QuicReadAvailableData.NullStream" enum="BooleanNullStream"> + <obsolete> + Removed as of 05/2017. + </obsolete> <owner>rch@chromium.org</owner> <summary> The number of times QuicHttpStream's stream_ is a nullptr before @@ -85139,6 +85142,25 @@ <affected-histogram name="Arc.boot_progress"/> </histogram_suffixes> +<histogram_suffixes name="AndroidBootTypes" separator="."> + <suffix name="FirstBoot" label="For the very first boot, aka opt-in."/> + <suffix name="FirstBootAfterUpdate" + label="For the first boot after Chrome OS update."/> + <suffix name="RegularBoot" label="For a regular boot."/> + <affected-histogram name="Arc.AndroidBootTime"/> + <affected-histogram name="Arc.boot_progress_ams_ready"/> + <affected-histogram name="Arc.boot_progress_enable_screen"/> + <affected-histogram name="Arc.boot_progress_pms_data_scan_start"/> + <affected-histogram name="Arc.boot_progress_pms_ready"/> + <affected-histogram name="Arc.boot_progress_pms_scan_end"/> + <affected-histogram name="Arc.boot_progress_pms_start"/> + <affected-histogram name="Arc.boot_progress_pms_system_scan_start"/> + <affected-histogram name="Arc.boot_progress_preload_end"/> + <affected-histogram name="Arc.boot_progress_preload_start"/> + <affected-histogram name="Arc.boot_progress_start"/> + <affected-histogram name="Arc.boot_progress_system_run"/> +</histogram_suffixes> + <histogram_suffixes name="AndroidCrashUploadTypes" separator="_"> <suffix name="Browser" label="Measures browser crash uploads."/> <suffix name="GPU" label="Measures GPU crash uploads."/>
diff --git a/tools/perf/benchmarks/webrtc.py b/tools/perf/benchmarks/webrtc.py index d1f81675..eb2aeb9f 100644 --- a/tools/perf/benchmarks/webrtc.py +++ b/tools/perf/benchmarks/webrtc.py
@@ -27,7 +27,8 @@ '-*', 'toplevel', # WebRTC - 'webrtc', + # TODO(ehmaldonado): Re-enable once http://crbug.com/725502 is fixed. + # 'webrtc', ] category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( @@ -35,7 +36,8 @@ options = timeline_based_measurement.Options(category_filter) options.SetTimelineBasedMetrics([ 'cpuTimeMetric', - 'webrtcRenderingMetric', + # TODO(ehmaldonado): Re-enable once http://crbug.com/725502 is fixed. + # 'webrtcRenderingMetric', ]) return options
diff --git a/tools/perf/core/benchmark_sharding_map.json b/tools/perf/core/benchmark_sharding_map.json index 360475908..edaaaa5 100644 --- a/tools/perf/core/benchmark_sharding_map.json +++ b/tools/perf/core/benchmark_sharding_map.json
@@ -2516,7 +2516,7 @@ "v8.mobile_infinite_scroll-classic_tbmv2" ] }, - "build8-b1": { + "build30-b4": { "benchmarks": [ "battor.steady_state", "blink_perf.css", @@ -4507,4 +4507,4 @@ "v8.runtimestats.browsing_mobile_turbo", "webrtc" ] -} \ No newline at end of file +}
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index 90d65daa..d0c4e33 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -446,10 +446,11 @@ 'os': 'Mac-10.11', 'pool': 'Chrome-perf', 'device_ids': [ - 'build4-b1', 'build5-b1', 'build6-b1', 'build7-b1', 'build8-b1' + 'build4-b1', 'build5-b1', 'build6-b1', 'build7-b1', + 'build30-b4' # replacing build8-b1. crbug.com/724998 ], 'perf_tests': [ - ('performance_browser_tests', 'build8-b1') + ('performance_browser_tests', 'build30-b4') ] } ]) @@ -692,7 +693,7 @@ # Devices which are broken right now. Tests will not be scheduled on them. # Please add a comment with a bug for replacing the device. BLACKLISTED_DEVICES = [ - 'build8-b1', # https://crbug.com/724998 + 'build75-b1--device1', # crbug.com/726874 ] @@ -715,21 +716,26 @@ return sorted(all_benchmarks, key=lambda b: b.Name()) -def RemoveBlacklistedTests(tests, blacklist): +def remove_blacklisted_device_tests(tests, blacklisted_devices): new_tests = [] + blacklist_device_to_test = collections.defaultdict(list) for test in tests: if test.get('swarming', None): swarming = test['swarming'] new_dimensions = [] for dimension in swarming['dimension_sets']: - if dimension['id'] in blacklist: + if dimension['id'] in blacklisted_devices: + blacklist_device_to_test[dimension['id']].append(test['name']) continue new_dimensions.append(dimension) if not new_dimensions: continue new_tests.append(test) - return new_tests + + return new_tests, { + device: sorted(tests) for device, tests + in blacklist_device_to_test.items()} def generate_all_tests(waterfall): @@ -753,8 +759,15 @@ isolated_scripts += generate_cplusplus_isolate_script_test( config['swarming_dimensions'][0]) - isolated_scripts = RemoveBlacklistedTests( + isolated_scripts, devices_to_test_skipped = remove_blacklisted_device_tests( isolated_scripts, BLACKLISTED_DEVICES) + if devices_to_test_skipped: + for device, skipped_tests in devices_to_test_skipped.items(): + print ( + 'Device "%s" is blacklisted. These benchmarks are not scheduled:' % ( + device)) + for test in skipped_tests: + print ' * %s' % test tests[name] = { 'isolated_scripts': sorted(isolated_scripts, key=lambda x: x['name']) }
diff --git a/tools/perf/core/perf_data_generator_unittest.py b/tools/perf/core/perf_data_generator_unittest.py index 538f13d5..4ec50c0 100644 --- a/tools/perf/core/perf_data_generator_unittest.py +++ b/tools/perf/core/perf_data_generator_unittest.py
@@ -199,10 +199,12 @@ 'dimension_sets': [{ 'id': 'build1-b1', }] - } + }, + 'name': 'test', }] self.assertEqual( - perf_data_generator.RemoveBlacklistedTests(tests, []), tests) + perf_data_generator.remove_blacklisted_device_tests(tests, []), ( + tests, {})) def testRemoveBlacklistedTestsShouldRemove(self): tests = [{ @@ -210,9 +212,39 @@ 'dimension_sets': [{ 'id': 'build1-b1', }] - } + }, + 'name': 'test', }] self.assertEqual( - perf_data_generator.RemoveBlacklistedTests(tests, ['build1-b1']), []) + perf_data_generator.remove_blacklisted_device_tests( + tests, ['build1-b1']), ([], {'build1-b1': ['test']})) - + def testRemoveBlacklistedTestsShouldRemoveMultiple(self): + tests = [{ + 'swarming': { + 'dimension_sets': [{ + 'id': 'build1-b1', + }] + }, + 'name': 'test', + }, { + 'swarming': { + 'dimension_sets': [{ + 'id': 'build2-b1', + }] + }, + 'name': 'other_test', + }, { + 'swarming': { + 'dimension_sets': [{ + 'id': 'build2-b1', + }] + }, + 'name': 'test', + }] + self.assertEqual( + perf_data_generator.remove_blacklisted_device_tests( + tests, ['build1-b1', 'build2-b1']), ([], { + 'build1-b1': ['test'], + 'build2-b1': ['other_test', 'test'], + }))
diff --git a/tools/perf/page_sets/webrtc_cases.py b/tools/perf/page_sets/webrtc_cases.py index a6cacbaf..582dc53 100644 --- a/tools/perf/page_sets/webrtc_cases.py +++ b/tools/perf/page_sets/webrtc_cases.py
@@ -110,13 +110,13 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('Action_Create_PeerConnection', repeatable=False): - # Set the number of peer connections to create to 15. + # Set the number of peer connections to create to 10. action_runner.ExecuteJavaScript( - 'document.getElementById("num-peerconnections").value=15') + 'document.getElementById("num-peerconnections").value=10') action_runner.ExecuteJavaScript( 'document.getElementById("cpuoveruse-detection").checked=false') action_runner.ClickElement('button[id="start-test"]') - action_runner.Wait(45) + action_runner.Wait(20) class WebrtcPageSet(story.StorySet): @@ -124,25 +124,35 @@ super(WebrtcPageSet, self).__init__( cloud_storage_bucket=story.PUBLIC_BUCKET) - self.AddStory(GetUserMedia(self, tags=['getusermedia'])) self.AddStory(MultiplePeerConnections(self, tags=['stress'])) - self.AddStory(VideoCall(self, tags=['peerconnection', 'smoothness'])) self.AddStory(DataChannel(self, tags=['datachannel'])) + self.AddStory(GetUserMedia(self, tags=['getusermedia'])) + self.AddStory(VideoCall(self, tags=['peerconnection', 'smoothness'])) self.AddStory(CanvasCapturePeerConnection(self, tags=['smoothness'])) - # TODO(qyearsley, mcasas): Add webrtc.audio when http://crbug.com/468732 - # is fixed, or revert https://codereview.chromium.org/1544573002/ when - # http://crbug.com/568333 is fixed. - # self.AddStory(AudioCall(self, 'OPUS')) - # self.AddStory(AudioCall(self, 'G772')) - # self.AddStory(AudioCall(self, 'PCMU')) - # self.AddStory(AudioCall(self, 'ISAC/1600')) + self.AddStory(AudioCall(self, 'OPUS', tags=['audio'])) + self.AddStory(AudioCall(self, 'G772', tags=['audio'])) + self.AddStory(AudioCall(self, 'PCMU', tags=['audio'])) + self.AddStory(AudioCall(self, 'ISAC/1600', tags=['audio'])) class WebrtcExpectations(story.expectations.StoryExpectations): def SetExpectations(self): - self.DisableStory('multiple_peerconnections', + # TODO(qyearsley, mcasas): Add webrtc.audio when http://crbug.com/468732 + # is fixed, or revert https://codereview.chromium.org/1544573002/ when + # http://crbug.com/568333 is fixed. + self.DisableStory('audio_call_opus_10s', [story.expectations.ALL], - 'crbug.com/725502') + 'crbug.com/468732') + self.DisableStory('audio_call_g772_10s', + [story.expectations.ALL], + 'crbug.com/468732') + self.DisableStory('audio_call_pcmu_10s', + [story.expectations.ALL], + 'crbug.com/468732') + self.DisableStory('audio_call_isac/1600_10s', + [story.expectations.ALL], + 'crbug.com/468732') + self.DisableStory('30s_datachannel_transfer', [story.expectations.ALL_DESKTOP], 'crbug.com/726811')
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 8f9dee0..834eff63 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc
@@ -1383,7 +1383,7 @@ transparent_visual_id_(0), using_software_rendering_(false), have_gpu_argb_visual_(false) { - int visuals_len; + int visuals_len = 0; XVisualInfo visual_template; visual_template.screen = DefaultScreen(display_); gfx::XScopedPtr<XVisualInfo[]> visual_list(XGetVisualInfo(
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc index 20349b4..981c585 100644 --- a/ui/gfx/image/image_skia.cc +++ b/ui/gfx/image/image_skia.cc
@@ -41,6 +41,17 @@ // the image to 1.25. const float kFallbackToSmallerScaleDiff = 0.20f; +// Maps to the closest supported scale. Returns an exact match, a smaller +// scale within 0.2 units, the nearest larger scale, or the min/max +// supported scale. +float MapToSupportedScale(float scale) { + for (float supported_scale : *g_supported_scales) { + if (supported_scale + kFallbackToSmallerScaleDiff >= scale) + return supported_scale; + } + return g_supported_scales->back(); +} + } // namespace namespace internal { @@ -219,18 +230,8 @@ ImageSkiaRep image; float resource_scale = scale; - if (!HasRepresentationAtAllScales() && g_supported_scales) { - if (g_supported_scales->back() <= scale) { - resource_scale = g_supported_scales->back(); - } else { - for (size_t i = 0; i < g_supported_scales->size(); ++i) { - if ((*g_supported_scales)[i] + kFallbackToSmallerScaleDiff >= scale) { - resource_scale = (*g_supported_scales)[i]; - break; - } - } - } - } + if (!HasRepresentationAtAllScales() && g_supported_scales) + resource_scale = MapToSupportedScale(scale); if (scale != resource_scale) { std::vector<ImageSkiaRep>::iterator iter = FindRepresentation(resource_scale, fetch_new_image); @@ -481,6 +482,14 @@ } } +void ImageSkia::RemoveUnsupportedRepresentationsForScale(float scale) { + for (const ImageSkiaRep& image_rep_to_test : image_reps()) { + const float test_scale = image_rep_to_test.scale(); + if (test_scale != scale && MapToSupportedScale(test_scale) == scale) + RemoveRepresentation(test_scale); + } +} + void ImageSkia::Init(const ImageSkiaRep& image_rep) { // TODO(pkotwicz): The image should be null whenever image rep is null. if (image_rep.sk_bitmap().empty()) {
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h index db7447d..92fabe5 100644 --- a/ui/gfx/image/image_skia.h +++ b/ui/gfx/image/image_skia.h
@@ -150,6 +150,10 @@ // the state change in the storage is agnostic to the caller. void EnsureRepsForSupportedScales() const; + // Clears cached representations for non-supported scale factors that are + // based on |scale|. + void RemoveUnsupportedRepresentationsForScale(float scale); + private: friend class test::TestOnThread; FRIEND_TEST_ALL_PREFIXES(ImageSkiaTest, EmptyOnThreadTest);
diff --git a/ui/gl/gl_image_dxgi.cc b/ui/gl/gl_image_dxgi.cc index 2960a6b..a470f33 100644 --- a/ui/gl/gl_image_dxgi.cc +++ b/ui/gl/gl_image_dxgi.cc
@@ -31,7 +31,7 @@ } bool GLImageDXGI::BindTexImage(unsigned target) { - return false; + return true; } void GLImageDXGI::ReleaseTexImage(unsigned target) {} @@ -76,4 +76,107 @@ eglDestroyStreamKHR(egl_display, stream_); } +CopyingGLImageDXGI::CopyingGLImageDXGI( + const base::win::ScopedComPtr<ID3D11Device>& d3d11_device, + const gfx::Size& size, + EGLStreamKHR stream) + : GLImageDXGI(size, stream), d3d11_device_(d3d11_device) {} + +bool CopyingGLImageDXGI::Initialize() { + D3D11_TEXTURE2D_DESC desc; + desc.Width = size_.width(); + desc.Height = size_.height(); + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_NV12; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + HRESULT hr = d3d11_device_->CreateTexture2D( + &desc, nullptr, decoder_copy_texture_.GetAddressOf()); + CHECK(SUCCEEDED(hr)); + EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); + + EGLAttrib frame_attributes[] = { + EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, 0, EGL_NONE, + }; + + EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( + egl_display, stream_, static_cast<void*>(decoder_copy_texture_.Get()), + frame_attributes); + if (!result) + return false; + result = eglStreamConsumerAcquireKHR(egl_display, stream_); + if (!result) + return false; + + d3d11_device_.CopyTo(video_device_.GetAddressOf()); + base::win::ScopedComPtr<ID3D11DeviceContext> context; + d3d11_device_->GetImmediateContext(context.GetAddressOf()); + context.CopyTo(video_context_.GetAddressOf()); + return true; +} + +bool CopyingGLImageDXGI::InitializeVideoProcessor( + const base::win::ScopedComPtr<ID3D11VideoProcessor>& video_processor, + const base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator>& enumerator) { + output_view_.Reset(); + + d3d11_processor_ = video_processor; + enumerator_ = enumerator; + D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC output_view_desc = { + D3D11_VPOV_DIMENSION_TEXTURE2D}; + output_view_desc.Texture2D.MipSlice = 0; + base::win::ScopedComPtr<ID3D11VideoProcessorOutputView> output_view; + HRESULT hr = video_device_->CreateVideoProcessorOutputView( + decoder_copy_texture_.Get(), enumerator_.Get(), &output_view_desc, + output_view_.GetAddressOf()); + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to get output view"; + return false; + } + return true; +} + +void CopyingGLImageDXGI::UnbindFromTexture() { + copied_ = false; +} + +bool CopyingGLImageDXGI::BindTexImage(unsigned target) { + if (copied_) + return true; + + D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC input_view_desc = {0}; + input_view_desc.ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D; + input_view_desc.Texture2D.ArraySlice = (UINT)level_; + input_view_desc.Texture2D.MipSlice = 0; + base::win::ScopedComPtr<ID3D11VideoProcessorInputView> input_view; + HRESULT hr = video_device_->CreateVideoProcessorInputView( + texture_.Get(), enumerator_.Get(), &input_view_desc, + input_view.GetAddressOf()); + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to create video processor input view."; + return false; + } + + D3D11_VIDEO_PROCESSOR_STREAM streams = {0}; + streams.Enable = TRUE; + streams.pInputSurface = input_view.Get(); + + hr = video_context_->VideoProcessorBlt(d3d11_processor_.Get(), + output_view_.Get(), 0, 1, &streams); + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to process video"; + return false; + } + copied_ = true; + return true; +} + +CopyingGLImageDXGI::~CopyingGLImageDXGI() {} + } // namespace gl
diff --git a/ui/gl/gl_image_dxgi.h b/ui/gl/gl_image_dxgi.h index 10d5b24..c6194610 100644 --- a/ui/gl/gl_image_dxgi.h +++ b/ui/gl/gl_image_dxgi.h
@@ -5,11 +5,11 @@ #include <d3d11.h> #include "base/win/scoped_comptr.h" -#include "third_party/khronos/EGL/egl.h" -#include "third_party/khronos/EGL/eglext.h" #include "ui/gl/gl_export.h" #include "ui/gl/gl_image.h" +typedef void* EGLStreamKHR; + namespace gl { class GL_EXPORT GLImageDXGI : public GLImage { @@ -48,7 +48,6 @@ protected: ~GLImageDXGI() override; - private: gfx::Size size_; EGLStreamKHR stream_; @@ -56,4 +55,35 @@ base::win::ScopedComPtr<ID3D11Texture2D> texture_; size_t level_ = 0; }; + +// This copies to a new texture on bind. +class GL_EXPORT CopyingGLImageDXGI : public GLImageDXGI { + public: + CopyingGLImageDXGI(const base::win::ScopedComPtr<ID3D11Device>& d3d11_device, + const gfx::Size& size, + EGLStreamKHR stream); + + bool Initialize(); + bool InitializeVideoProcessor( + const base::win::ScopedComPtr<ID3D11VideoProcessor>& video_processor, + const base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator>& + enumerator); + void UnbindFromTexture(); + + // GLImage implementation. + bool BindTexImage(unsigned target) override; + + private: + ~CopyingGLImageDXGI() override; + + bool copied_ = false; + + base::win::ScopedComPtr<ID3D11VideoDevice> video_device_; + base::win::ScopedComPtr<ID3D11VideoContext> video_context_; + base::win::ScopedComPtr<ID3D11VideoProcessor> d3d11_processor_; + base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator> enumerator_; + base::win::ScopedComPtr<ID3D11Device> d3d11_device_; + base::win::ScopedComPtr<ID3D11Texture2D> decoder_copy_texture_; + base::win::ScopedComPtr<ID3D11VideoProcessorOutputView> output_view_; +}; }
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index a4be18a4..5acea2bd 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc
@@ -19,6 +19,7 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" #include "ui/views/style/platform_style.h" +#include "ui/views/view_observer.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" @@ -50,6 +51,36 @@ size1.height() + size2.height()); } +// ViewDeletionObserver implements an observer to track the deletion of the +// view in focus. +class ViewDeletionObserver : public ViewObserver { + public: + explicit ViewDeletionObserver(View* observed_view) + : observed_view_(observed_view) { + if (observed_view_) + observed_view_->AddObserver(this); + } + + ~ViewDeletionObserver() override { + if (observed_view_) + observed_view_->RemoveObserver(this); + } + + // ViewObserver: + void OnViewIsDeleting(View* observed_view) override { + DCHECK_EQ(observed_view, observed_view_); + observed_view_ = nullptr; + observed_view_->RemoveObserver(this); + } + + View* observed_view() { return observed_view_; } + + private: + View* observed_view_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(ViewDeletionObserver); +}; + } // namespace // Simple container to bubble child view changes up the view hierarchy. @@ -326,6 +357,8 @@ base::AutoReset<bool> auto_reset(&adding_or_removing_views_, true); GridLayout* layout = new GridLayout(button_row_container_); layout->set_minimum_size(minimum_size_); + FocusManager* focus_manager = GetFocusManager(); + ViewDeletionObserver deletion_observer(focus_manager->GetFocusedView()); // Clobber any existing LayoutManager since it has weak references to child // Views which may be removed by SetupViews(). @@ -413,6 +446,14 @@ column_set->LinkColumnSizes(link[0], link[1], link[2], -1); layout->AddPaddingRow(kFixed, insets.bottom()); + + // The default focus is lost when child views are added back into the dialog. + // This restores focus if the button is still available. + View* previously_focused_view = deletion_observer.observed_view(); + if (previously_focused_view && !focus_manager->GetFocusedView() && + Contains(previously_focused_view)) { + previously_focused_view->RequestFocus(); + } } void DialogClientView::SetupViews() {
diff --git a/ui/views/window/dialog_client_view_unittest.cc b/ui/views/window/dialog_client_view_unittest.cc index bb8ec36..3d933752 100644 --- a/ui/views/window/dialog_client_view_unittest.cc +++ b/ui/views/window/dialog_client_view_unittest.cc
@@ -141,6 +141,8 @@ DialogClientView* client_view() { return client_view_; } + Widget* widget() { return widget_; } + private: // The dialog Widget. Widget* widget_ = nullptr; @@ -436,4 +438,31 @@ height() + client_view()->ok_button()->y()); } +// Ensures that the focus of the button remains after a dialog update. +TEST_F(DialogClientViewTest, FocusUpdate) { + // Test with just an ok button. + widget()->Show(); + SetDialogButtons(ui::DIALOG_BUTTON_OK); + EXPECT_FALSE(client_view()->ok_button()->HasFocus()); + client_view()->ok_button()->RequestFocus(); // Set focus. + EXPECT_TRUE(client_view()->ok_button()->HasFocus()); + client_view()->UpdateDialogButtons(); + EXPECT_TRUE(client_view()->ok_button()->HasFocus()); +} + +// Ensures that the focus of the button remains after a dialog update that +// contains multiple buttons. +TEST_F(DialogClientViewTest, FocusMultipleButtons) { + // Test with ok and cancel buttons. + widget()->Show(); + SetDialogButtons(ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK); + EXPECT_FALSE(client_view()->ok_button()->HasFocus()); + EXPECT_FALSE(client_view()->cancel_button()->HasFocus()); + client_view()->cancel_button()->RequestFocus(); // Set focus. + EXPECT_FALSE(client_view()->ok_button()->HasFocus()); + EXPECT_TRUE(client_view()->cancel_button()->HasFocus()); + client_view()->UpdateDialogButtons(); + EXPECT_TRUE(client_view()->cancel_button()->HasFocus()); +} + } // namespace views