diff --git a/DEPS b/DEPS index 245a946b..470b1e3 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '3cac5b8d736a81134f2acd3bf4af9b92c6825f2a', + 'skia_revision': '8785df15fe5a57651597d138d3c5aea0ffe3f661', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -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': '033e565d8244953afe8eab3d0c7ee1ed9863c921', + 'pdfium_revision': '129b0135adf99be8e2c3015267a4689c6d62dca1', # 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': 'ae648e44341b1565cec2f59ab4a7c337792868ff', + 'catapult_revision': '6bd7ec034804d7ece286366393fab685e91595c1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -407,7 +407,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': - Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '2622f762e497c549fb2bf1f359d450d2b2b792eb', + Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '9a66c4dd0d61dad05b3505c4be8f914f54fb7f20', # Dependency of chromite.git and skia. 'src/third_party/pyelftools':
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index de0e49d65..8a81bb0 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1140,12 +1140,6 @@ def _ParseDeps(contents): """Simple helper for parsing DEPS files.""" # Stubs for handling special syntax in the root DEPS file. - def FromImpl(*_): - pass # NOP function so "From" doesn't fail. - - def FileImpl(_): - pass # NOP function so "File" doesn't fail. - class _VarImpl: def __init__(self, local_scope): @@ -1160,8 +1154,6 @@ local_scope = {} global_scope = { - 'File': FileImpl, - 'From': FromImpl, 'Var': _VarImpl(local_scope).Lookup, } exec contents in global_scope, local_scope
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc index b51a383..f4962320 100644 --- a/android_webview/browser/hardware_renderer.cc +++ b/android_webview/browser/hardware_renderer.cc
@@ -118,18 +118,22 @@ std::unique_ptr<cc::CompositorFrame> child_compositor_frame = std::move(child_frame_->frame); + float device_scale_factor = + child_compositor_frame->metadata.device_scale_factor; gfx::Size frame_size = child_compositor_frame->render_pass_list.back()->output_rect.size(); - bool size_changed = frame_size != frame_size_; - frame_size_ = frame_size; - if (!child_id_.is_valid() || size_changed) { + if (!child_id_.is_valid() || surface_size_ != frame_size || + device_scale_factor_ != device_scale_factor) { if (child_id_.is_valid()) DestroySurface(); AllocateSurface(); + surface_size_ = frame_size; + device_scale_factor_ = device_scale_factor; } - support_->SubmitCompositorFrame(child_id_, - std::move(*child_compositor_frame)); + bool result = support_->SubmitCompositorFrame( + child_id_, std::move(*child_compositor_frame)); + DCHECK(result); } gfx::Transform transform(gfx::Transform::kSkipInitialization); @@ -153,7 +157,7 @@ gfx::Rect clip(draw_info->clip_left, draw_info->clip_top, draw_info->clip_right - draw_info->clip_left, draw_info->clip_bottom - draw_info->clip_top); - surfaces_->DrawAndSwap(viewport, clip, transform, frame_size_, + surfaces_->DrawAndSwap(viewport, clip, transform, surface_size_, cc::SurfaceId(frame_sink_id_, child_id_)); } @@ -167,7 +171,7 @@ DCHECK(child_id_.is_valid()); // Submit an empty frame to force any existing resources to be returned. - gfx::Rect rect(frame_size_); + gfx::Rect rect(surface_size_); std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); render_pass->SetNew(1, rect, rect, gfx::Transform()); cc::CompositorFrame frame; @@ -175,7 +179,9 @@ // We submit without a prior BeginFrame, so acknowledge a manual BeginFrame. frame.metadata.begin_frame_ack = cc::BeginFrameAck::CreateManualAckWithDamage(); - support_->SubmitCompositorFrame(child_id_, std::move(frame)); + frame.metadata.device_scale_factor = device_scale_factor_; + bool result = support_->SubmitCompositorFrame(child_id_, std::move(frame)); + DCHECK(result); surfaces_->RemoveChildId(cc::SurfaceId(frame_sink_id_, child_id_)); support_->EvictCurrentSurface();
diff --git a/android_webview/browser/hardware_renderer.h b/android_webview/browser/hardware_renderer.h index 511a8c5b..a99fb73 100644 --- a/android_webview/browser/hardware_renderer.h +++ b/android_webview/browser/hardware_renderer.h
@@ -73,7 +73,8 @@ EGLContext last_egl_context_; // Information about last delegated frame. - gfx::Size frame_size_; + gfx::Size surface_size_; + float device_scale_factor_ = 0; // Infromation from UI on last commit. gfx::Vector2d scroll_offset_;
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc index b8599fe..a04bf5f5 100644 --- a/android_webview/browser/surfaces_instance.cc +++ b/android_webview/browser/surfaces_instance.cc
@@ -139,14 +139,16 @@ frame.metadata.begin_frame_ack = cc::BeginFrameAck::CreateManualAckWithDamage(); frame.render_pass_list.push_back(std::move(render_pass)); + frame.metadata.device_scale_factor = 1.f; frame.metadata.referenced_surfaces = child_ids_; - if (!root_id_.is_valid() || frame_size != surface_size_) { + if (!root_id_.is_valid() || viewport != surface_size_) { root_id_ = local_surface_id_allocator_->GenerateId(); - surface_size_ = frame_size; + surface_size_ = viewport; display_->SetLocalSurfaceId(root_id_, 1.f); } - support_->SubmitCompositorFrame(root_id_, std::move(frame)); + bool result = support_->SubmitCompositorFrame(root_id_, std::move(frame)); + DCHECK(result); display_->Resize(viewport); display_->DrawAndSwap(); @@ -186,7 +188,9 @@ frame.metadata.begin_frame_ack = cc::BeginFrameAck::CreateManualAckWithDamage(); frame.metadata.referenced_surfaces = child_ids_; - support_->SubmitCompositorFrame(root_id_, std::move(frame)); + frame.metadata.device_scale_factor = 1; + bool result = support_->SubmitCompositorFrame(root_id_, std::move(frame)); + DCHECK(result); } void SurfacesInstance::DidReceiveCompositorFrameAck(
diff --git a/android_webview/browser/test/rendering_test.cc b/android_webview/browser/test/rendering_test.cc index e5efae0..d20aa18 100644 --- a/android_webview/browser/test/rendering_test.cc +++ b/android_webview/browser/test/rendering_test.cc
@@ -16,6 +16,7 @@ #include "base/message_loop/message_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "cc/output/compositor_frame.h" +#include "cc/test/compositor_frame_helpers.h" #include "content/public/browser/android/synchronous_compositor.h" #include "content/public/test/test_synchronous_compositor_android.h" @@ -117,9 +118,8 @@ } std::unique_ptr<cc::CompositorFrame> RenderingTest::ConstructEmptyFrame() { - std::unique_ptr<cc::CompositorFrame> compositor_frame( - new cc::CompositorFrame); - compositor_frame->metadata.begin_frame_ack = cc::BeginFrameAck(0, 1, 1, true); + auto compositor_frame = base::MakeUnique<cc::CompositorFrame>( + cc::test::MakeEmptyCompositorFrame()); std::unique_ptr<cc::RenderPass> root_pass(cc::RenderPass::Create()); gfx::Rect viewport(browser_view_renderer_->size()); root_pass->SetNew(1, viewport, viewport, gfx::Transform());
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index b47c55b..5596b47 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -799,16 +799,16 @@ DCHECK(lock_container); lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); - WmWindow* always_on_top_container = - GetWmContainer(kShellWindowId_AlwaysOnTopContainer); + aura::Window* always_on_top_container = + GetContainer(kShellWindowId_AlwaysOnTopContainer); DCHECK(always_on_top_container); always_on_top_controller_ = base::MakeUnique<AlwaysOnTopController>(always_on_top_container); // Create Panel layout manager - WmWindow* wm_panel_container = GetWmContainer(kShellWindowId_PanelContainer); - panel_layout_manager_ = new PanelLayoutManager(wm_panel_container); - wm_panel_container->aura_window()->SetLayoutManager(panel_layout_manager_); + aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); + panel_layout_manager_ = new PanelLayoutManager(panel_container); + panel_container->SetLayoutManager(panel_layout_manager_); wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); @@ -834,7 +834,6 @@ -kResizeOutsideBoundsSize); gfx::Insets touch_extend = mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); - aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( new AttachedPanelWindowTargeter(panel_container, mouse_extend, touch_extend, panel_layout_manager())));
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc index 7d2fcc9..b4ed4f18 100644 --- a/ash/system/power/tablet_power_button_controller.cc +++ b/ash/system/power/tablet_power_button_controller.cc
@@ -76,7 +76,6 @@ TabletPowerButtonController::TabletPowerButtonController( LockStateController* controller) : tick_clock_(new base::DefaultTickClock()), - force_off_on_button_up_(true), controller_(controller), weak_ptr_factory_(this) { chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
diff --git a/ash/system/power/tablet_power_button_controller.h b/ash/system/power/tablet_power_button_controller.h index bd7c41c..69d32cc1 100644 --- a/ash/system/power/tablet_power_button_controller.h +++ b/ash/system/power/tablet_power_button_controller.h
@@ -127,7 +127,7 @@ base::TimeTicks last_button_up_time_; // True if power button released should force off display. - bool force_off_on_button_up_; + bool force_off_on_button_up_ = true; // Started when the tablet power button is pressed and stopped when it's // released. Runs OnShutdownTimeout() to start shutdown.
diff --git a/ash/system/power/tablet_power_button_controller_unittest.cc b/ash/system/power/tablet_power_button_controller_unittest.cc index 161772c..a0bfcda 100644 --- a/ash/system/power/tablet_power_button_controller_unittest.cc +++ b/ash/system/power/tablet_power_button_controller_unittest.cc
@@ -56,11 +56,14 @@ base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAshEnableTouchView); AshTestBase::SetUp(); - - lock_state_controller_ = Shell::Get()->lock_state_controller(); + // Trigger an accelerometer update so that |tablet_controller_| can be + // initialized. + SendAccelerometerUpdate(); tablet_controller_ = Shell::Get() ->power_button_controller() ->tablet_power_button_controller_for_test(); + + lock_state_controller_ = Shell::Get()->lock_state_controller(); test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>( tablet_controller_); lock_state_test_api_ = @@ -85,6 +88,13 @@ } protected: + void SendAccelerometerUpdate() { + scoped_refptr<chromeos::AccelerometerUpdate> update( + new chromeos::AccelerometerUpdate()); + update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 1.0f, 0.0f, 0.0f); + Shell::Get()->power_button_controller()->OnAccelerometerUpdated(update); + } + void PressPowerButton() { tablet_controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); } @@ -521,6 +531,7 @@ Shell::Get() ->power_button_controller() ->ResetTabletPowerButtonControllerForTest(); + SendAccelerometerUpdate(); // Check that the local state of touchscreen enabled state is in line with // backlights forced off state. @@ -528,5 +539,24 @@ EXPECT_TRUE(shell_delegate_->IsTouchscreenEnabledInPrefs(true)); } +// Tests that tablet power button behavior is enabled on having seen +// accelerometer update, otherwise it is disabled. +TEST_F(TabletPowerButtonControllerTest, EnableOnAccelerometerUpdate) { + ASSERT_TRUE(tablet_controller_); + Shell::Get() + ->power_button_controller() + ->ResetTabletPowerButtonControllerForTest(); + tablet_controller_ = Shell::Get() + ->power_button_controller() + ->tablet_power_button_controller_for_test(); + EXPECT_FALSE(tablet_controller_); + + SendAccelerometerUpdate(); + tablet_controller_ = Shell::Get() + ->power_button_controller() + ->tablet_power_button_controller_for_test(); + EXPECT_TRUE(tablet_controller_); +} + } // namespace test } // namespace ash
diff --git a/ash/wm/always_on_top_controller.cc b/ash/wm/always_on_top_controller.cc index 7a0920f..56d94042 100644 --- a/ash/wm/always_on_top_controller.cc +++ b/ash/wm/always_on_top_controller.cc
@@ -6,71 +6,69 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/wm/workspace/workspace_layout_manager.h" -#include "ash/wm_window.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" namespace ash { -AlwaysOnTopController::AlwaysOnTopController(WmWindow* viewport) +AlwaysOnTopController::AlwaysOnTopController(aura::Window* viewport) : always_on_top_container_(viewport) { - DCHECK_NE(kShellWindowId_DefaultContainer, viewport->aura_window()->id()); - always_on_top_container_->aura_window()->SetLayoutManager( - new WorkspaceLayoutManager(viewport->aura_window())); + DCHECK_NE(kShellWindowId_DefaultContainer, viewport->id()); + always_on_top_container_->SetLayoutManager( + new WorkspaceLayoutManager(viewport)); // Container should be empty. - DCHECK(always_on_top_container_->GetChildren().empty()); - always_on_top_container_->aura_window()->AddObserver(this); + DCHECK(always_on_top_container_->children().empty()); + always_on_top_container_->AddObserver(this); } AlwaysOnTopController::~AlwaysOnTopController() { if (always_on_top_container_) - always_on_top_container_->aura_window()->RemoveObserver(this); + always_on_top_container_->RemoveObserver(this); } -WmWindow* AlwaysOnTopController::GetContainer(WmWindow* window) const { +aura::Window* AlwaysOnTopController::GetContainer(aura::Window* window) const { DCHECK(always_on_top_container_); - if (window->aura_window()->GetProperty(aura::client::kAlwaysOnTopKey)) + if (window->GetProperty(aura::client::kAlwaysOnTopKey)) return always_on_top_container_; - return always_on_top_container_->GetRootWindow()->GetChildByShellWindowId( + return always_on_top_container_->GetRootWindow()->GetChildById( kShellWindowId_DefaultContainer); } // TODO(rsadam@): Refactor so that this cast is unneeded. WorkspaceLayoutManager* AlwaysOnTopController::GetLayoutManager() const { return static_cast<WorkspaceLayoutManager*>( - always_on_top_container_->aura_window()->layout_manager()); + always_on_top_container_->layout_manager()); } void AlwaysOnTopController::SetLayoutManagerForTest( std::unique_ptr<WorkspaceLayoutManager> layout_manager) { - always_on_top_container_->aura_window()->SetLayoutManager( - layout_manager.release()); + always_on_top_container_->SetLayoutManager(layout_manager.release()); } void AlwaysOnTopController::OnWindowHierarchyChanged( const HierarchyChangeParams& params) { - if (WmWindow::Get(params.old_parent) == always_on_top_container_) + if (params.old_parent == always_on_top_container_) params.target->RemoveObserver(this); - else if (WmWindow::Get(params.new_parent) == always_on_top_container_) + else if (params.new_parent == always_on_top_container_) params.target->AddObserver(this); } void AlwaysOnTopController::OnWindowPropertyChanged(aura::Window* window, const void* key, intptr_t old) { - if (WmWindow::Get(window) != always_on_top_container_ && + if (window != always_on_top_container_ && key == aura::client::kAlwaysOnTopKey) { DCHECK(window->type() == ui::wm::WINDOW_TYPE_NORMAL || window->type() == ui::wm::WINDOW_TYPE_POPUP); - WmWindow* container = GetContainer(WmWindow::Get(window)); - if (WmWindow::Get(window->parent()) != container) - container->AddChild(WmWindow::Get(window)); + aura::Window* container = GetContainer(window); + if (window->parent() != container) + container->AddChild(window); } } void AlwaysOnTopController::OnWindowDestroying(aura::Window* window) { - if (WmWindow::Get(window) == always_on_top_container_) { - always_on_top_container_->aura_window()->RemoveObserver(this); + if (window == always_on_top_container_) { + always_on_top_container_->RemoveObserver(this); always_on_top_container_ = nullptr; } }
diff --git a/ash/wm/always_on_top_controller.h b/ash/wm/always_on_top_controller.h index 4f33eeee..44a26ea 100644 --- a/ash/wm/always_on_top_controller.h +++ b/ash/wm/always_on_top_controller.h
@@ -13,7 +13,6 @@ namespace ash { -class WmWindow; class WorkspaceLayoutManager; // AlwaysOnTopController puts window into proper containers based on its @@ -22,11 +21,11 @@ // |always_on_top_container_|. class ASH_EXPORT AlwaysOnTopController : public aura::WindowObserver { public: - explicit AlwaysOnTopController(WmWindow* viewport); + explicit AlwaysOnTopController(aura::Window* viewport); ~AlwaysOnTopController() override; // Gets container for given |window| based on its "AlwaysOnTop" property. - WmWindow* GetContainer(WmWindow* window) const; + aura::Window* GetContainer(aura::Window* window) const; WorkspaceLayoutManager* GetLayoutManager() const; @@ -41,7 +40,7 @@ intptr_t old) override; void OnWindowDestroying(aura::Window* window) override; - WmWindow* always_on_top_container_; + aura::Window* always_on_top_container_; DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController); };
diff --git a/ash/wm/container_finder.cc b/ash/wm/container_finder.cc index 3b4a99c..e5cb9aa 100644 --- a/ash/wm/container_finder.cc +++ b/ash/wm/container_finder.cc
@@ -60,10 +60,9 @@ aura::Window* GetContainerFromAlwaysOnTopController(aura::Window* root, aura::Window* window) { - WmWindow* result = RootWindowController::ForWindow(root) - ->always_on_top_controller() - ->GetContainer(WmWindow::Get(window)); - return result ? result->aura_window() : nullptr; + return RootWindowController::ForWindow(root) + ->always_on_top_controller() + ->GetContainer(window); } } // namespace
diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index 71c1ef9..51a739a2 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc
@@ -268,7 +268,7 @@ // Hide the callout widgets for panels. It is safe to call this for // root windows that don't contain any panel windows. - PanelLayoutManager::Get(WmWindow::Get(root))->SetShowCalloutWidgets(false); + PanelLayoutManager::Get(root)->SetShowCalloutWidgets(false); std::unique_ptr<WindowGrid> grid(new WindowGrid(root, windows, this)); if (grid->empty()) @@ -337,8 +337,7 @@ ResetFocusRestoreWindow(true); RemoveAllObservers(); - std::vector<WmWindow*> root_windows = ShellPort::Get()->GetAllRootWindows(); - for (WmWindow* window : root_windows) { + for (aura::Window* window : Shell::GetAllRootWindows()) { // Un-hide the callout widgets for panels. It is safe to call this for // root_windows that don't contain any panel windows. PanelLayoutManager::Get(window)->SetShowCalloutWidgets(true);
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index f82e590..ff576ec 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc
@@ -1537,25 +1537,29 @@ TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) { std::unique_ptr<aura::Window> panel1( CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); - WmWindow* wm_panel1 = WmWindow::Get(panel1.get()); std::unique_ptr<aura::Window> panel2( CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); - WmWindow* wm_panel2 = WmWindow::Get(panel2.get()); - PanelLayoutManager* panel_manager = PanelLayoutManager::Get(wm_panel1); + PanelLayoutManager* panel_manager = PanelLayoutManager::Get(panel1.get()); // By default, panel callout widgets are visible. - EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); - EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); + EXPECT_TRUE( + panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); + EXPECT_TRUE( + panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible()); // Toggling the overview should hide the callout widgets. ToggleOverview(); - EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); - EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); + EXPECT_FALSE( + panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); + EXPECT_FALSE( + panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible()); // Ending the overview should show them again. ToggleOverview(); - EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); - EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); + EXPECT_TRUE( + panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); + EXPECT_TRUE( + panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible()); } // Creates three windows and tests filtering them by title.
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc index e0b56dc..20e6daec 100644 --- a/ash/wm/panels/panel_layout_manager.cc +++ b/ash/wm/panels/panel_layout_manager.cc
@@ -33,6 +33,7 @@ #include "ui/gfx/geometry/vector2d.h" #include "ui/views/background.h" #include "ui/views/widget/widget.h" +#include "ui/wm/core/coordinate_conversion.h" #include "ui/wm/core/window_util.h" #include "ui/wm/public/activation_client.h" @@ -114,7 +115,7 @@ int max_major; int major_pos; int major_length; - WmWindow* window; + Window* window; bool slide_in; }; @@ -183,14 +184,14 @@ class PanelCalloutWidget : public views::Widget { public: - explicit PanelCalloutWidget(WmWindow* container) : background_(nullptr) { + explicit PanelCalloutWidget(Window* container) : background_(nullptr) { InitWidget(container); } // Updates the bounds based on the shelf alignment. void UpdateBounds(WmShelf* shelf) { - WmWindow* window = WmWindow::Get(this->GetNativeWindow()); - gfx::Rect callout_bounds = window->GetBounds(); + Window* window = this->GetNativeWindow(); + gfx::Rect callout_bounds = window->bounds(); if (shelf->IsHorizontalAlignment()) { callout_bounds.set_width(kArrowWidth); callout_bounds.set_height(kArrowHeight); @@ -198,12 +199,12 @@ callout_bounds.set_width(kArrowHeight); callout_bounds.set_height(kArrowWidth); } - WmWindow* parent = window->GetParent(); + Window* parent = window->parent(); // It's important this go through WmWindow and not Widget. Going through // Widget means it may move do a different screen, we don't want that. window->SetBounds(callout_bounds); // Setting the bounds should not trigger changing the parent. - DCHECK_EQ(parent, window->GetParent()); + DCHECK_EQ(parent, window->parent()); if (background_->alignment() != shelf->alignment()) { background_->set_alignment(shelf->alignment()); SchedulePaintInRect(gfx::Rect(callout_bounds.size())); @@ -211,27 +212,27 @@ } private: - void InitWidget(WmWindow* parent) { + void InitWidget(Window* parent) { views::Widget::InitParams params; params.type = views::Widget::InitParams::TYPE_POPUP; params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; params.keep_on_top = true; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; - params.bounds = parent->ConvertRectToScreen(gfx::Rect()); + ::wm::ConvertRectToScreen(parent, ¶ms.bounds); params.bounds.set_width(kArrowWidth); params.bounds.set_height(kArrowHeight); params.accept_events = false; - parent->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( - this, parent->aura_window()->id(), ¶ms); + RootWindowController::ForWindow(parent) + ->ConfigureWidgetInitParamsForContainer(this, parent->id(), ¶ms); set_focus_on_creation(false); Init(params); - WmWindow* widget_window = WmWindow::Get(this->GetNativeWindow()); + Window* widget_window = this->GetNativeWindow(); DCHECK_EQ(widget_window->GetRootWindow(), parent->GetRootWindow()); views::View* content_view = new views::View; background_ = new CalloutWidgetBackground; content_view->set_background(background_); SetContentsView(content_view); - widget_window->GetLayer()->SetOpacity(0); + widget_window->layer()->SetOpacity(0); } // Weak pointer owned by this widget's content view. @@ -246,9 +247,9 @@ //////////////////////////////////////////////////////////////////////////////// // PanelLayoutManager public implementation: -PanelLayoutManager::PanelLayoutManager(WmWindow* panel_container) +PanelLayoutManager::PanelLayoutManager(Window* panel_container) : panel_container_(panel_container), - root_window_controller_(panel_container->GetRootWindowController()), + root_window_controller_(RootWindowController::ForWindow(panel_container)), in_add_window_(false), in_layout_(false), show_callout_widgets_(true), @@ -268,13 +269,12 @@ } // static -PanelLayoutManager* PanelLayoutManager::Get(WmWindow* window) { +PanelLayoutManager* PanelLayoutManager::Get(Window* window) { if (!window) return nullptr; return static_cast<PanelLayoutManager*>( window->GetRootWindow() - ->aura_window() ->GetChildById(kShellWindowId_PanelContainer) ->layout_manager()); } @@ -294,7 +294,7 @@ Shell::Get()->RemoveShellObserver(this); } -void PanelLayoutManager::StartDragging(WmWindow* panel) { +void PanelLayoutManager::StartDragging(Window* panel) { DCHECK(!dragged_panel_); dragged_panel_ = panel; Relayout(); @@ -312,9 +312,9 @@ WillChangeVisibilityState(shelf_->GetVisibilityState()); } -void PanelLayoutManager::ToggleMinimize(WmWindow* panel) { - DCHECK(panel->GetParent() == panel_container_); - wm::WindowState* window_state = panel->GetWindowState(); +void PanelLayoutManager::ToggleMinimize(Window* panel) { + DCHECK(panel->parent() == panel_container_); + wm::WindowState* window_state = wm::GetWindowState(panel); if (window_state->IsMinimized()) window_state->Restore(); else @@ -328,8 +328,8 @@ UpdateCallouts(); } -views::Widget* PanelLayoutManager::GetCalloutWidgetForPanel(WmWindow* panel) { - DCHECK(panel->GetParent() == panel_container_); +views::Widget* PanelLayoutManager::GetCalloutWidgetForPanel(Window* panel) { + DCHECK(panel->parent() == panel_container_); PanelList::iterator found = std::find(panel_windows_.begin(), panel_windows_.end(), panel); DCHECK(found != panel_windows_.end()); @@ -363,9 +363,9 @@ return; } PanelInfo panel_info; - panel_info.window = WmWindow::Get(child); + panel_info.window = child; panel_info.callout_widget = new PanelCalloutWidget(panel_container_); - panel_info.slide_in = WmWindow::Get(child) != dragged_panel_; + panel_info.slide_in = child != dragged_panel_; panel_windows_.push_back(panel_info); child->AddObserver(this); wm::GetWindowState(child)->AddObserver(this); @@ -378,8 +378,8 @@ if (child->type() == ui::wm::WINDOW_TYPE_POPUP) return; - PanelList::iterator found = std::find( - panel_windows_.begin(), panel_windows_.end(), WmWindow::Get(child)); + PanelList::iterator found = + std::find(panel_windows_.begin(), panel_windows_.end(), child); if (found != panel_windows_.end()) { delete found->callout_widget; panel_windows_.erase(found); @@ -389,10 +389,10 @@ child->RemoveObserver(this); wm::GetWindowState(child)->RemoveObserver(this); - if (dragged_panel_ == WmWindow::Get(child)) + if (dragged_panel_ == child) dragged_panel_ = nullptr; - if (last_active_panel_ == WmWindow::Get(child)) + if (last_active_panel_ == child) last_active_panel_ = nullptr; Relayout(); @@ -408,7 +408,7 @@ void PanelLayoutManager::SetChildBounds(Window* child, const gfx::Rect& requested_bounds) { gfx::Rect bounds(requested_bounds); - const gfx::Rect& max_bounds = panel_container_->GetRootWindow()->GetBounds(); + const gfx::Rect& max_bounds = panel_container_->GetRootWindow()->bounds(); const int max_width = max_bounds.width() * kMaxWidthFactor; const int max_height = max_bounds.height() * kMaxHeightFactor; if (bounds.width() > max_width) @@ -417,14 +417,14 @@ bounds.set_height(max_height); // Reposition dragged panel in the panel order. - if (dragged_panel_ == WmWindow::Get(child)) { + if (dragged_panel_ == child) { PanelList::iterator dragged_panel_iter = std::find(panel_windows_.begin(), panel_windows_.end(), dragged_panel_); DCHECK(dragged_panel_iter != panel_windows_.end()); PanelList::iterator new_position; for (new_position = panel_windows_.begin(); new_position != panel_windows_.end(); ++new_position) { - const gfx::Rect& bounds = (*new_position).window->GetBounds(); + const gfx::Rect& bounds = (*new_position).window->bounds(); if (bounds.x() + bounds.width() / 2 <= requested_bounds.x()) break; } @@ -458,18 +458,17 @@ Relayout(); } -void PanelLayoutManager::OnVirtualKeyboardStateChanged( - bool activated, - aura::Window* root_window) { - UpdateKeyboardObserverFromStateChanged( - activated, root_window, panel_container_->GetRootWindow()->aura_window(), - &keyboard_observer_); +void PanelLayoutManager::OnVirtualKeyboardStateChanged(bool activated, + Window* root_window) { + UpdateKeyboardObserverFromStateChanged(activated, root_window, + panel_container_->GetRootWindow(), + &keyboard_observer_); } ///////////////////////////////////////////////////////////////////////////// // PanelLayoutManager, WindowObserver implementation: -void PanelLayoutManager::OnWindowPropertyChanged(aura::Window* window, +void PanelLayoutManager::OnWindowPropertyChanged(Window* window, const void* key, intptr_t old) { // Trigger a relayout to position the panels whenever the panel icon is set @@ -506,14 +505,12 @@ // PanelLayoutManager, aura::client::ActivationChangeObserver implementation: void PanelLayoutManager::OnWindowActivated(ActivationReason reason, - aura::Window* gained_active, - aura::Window* lost_active) { - WmWindow* wm_gained_active = WmWindow::Get(gained_active); + Window* gained_active, + Window* lost_active) { // Ignore if the panel that is not managed by this was activated. - if (wm_gained_active && - wm_gained_active->GetType() == ui::wm::WINDOW_TYPE_PANEL && - wm_gained_active->GetParent() == panel_container_) { - UpdateStacking(wm_gained_active); + if (gained_active && gained_active->type() == ui::wm::WINDOW_TYPE_PANEL && + gained_active->parent() == panel_container_) { + UpdateStacking(gained_active); UpdateCallouts(); } } @@ -538,7 +535,7 @@ if (restore_windows_on_shelf_visible_) { std::unique_ptr<aura::WindowTracker> restore_windows( std::move(restore_windows_on_shelf_visible_)); - for (aura::Window* window : restore_windows->windows()) + for (Window* window : restore_windows->windows()) RestorePanel(window); } return; @@ -550,13 +547,13 @@ new aura::WindowTracker); for (PanelList::iterator iter = panel_windows_.begin(); iter != panel_windows_.end();) { - WmWindow* window = iter->window; + Window* window = iter->window; // Minimizing a panel window may remove it from the panel_windows_ list. // Advance the iterator before minimizing it: http://crbug.com/393047. ++iter; if (window != dragged_panel_ && window->IsVisible()) { - minimized_windows->Add(window->aura_window()); - window->GetWindowState()->Minimize(); + minimized_windows->Add(window); + wm::GetWindowState(window)->Minimize(); } } restore_windows_on_shelf_visible_ = std::move(minimized_windows); @@ -572,7 +569,7 @@ //////////////////////////////////////////////////////////////////////////////// // PanelLayoutManager private implementation: -void PanelLayoutManager::MinimizePanel(aura::Window* panel) { +void PanelLayoutManager::MinimizePanel(Window* panel) { // Clusterfuzz can trigger panel accelerators before the shelf is created. // TODO(jamescook): Revert this after http://crbug.com/648964 is fixed. if (!shelf_) @@ -596,9 +593,9 @@ Relayout(); } -void PanelLayoutManager::RestorePanel(aura::Window* panel) { - PanelList::iterator found = std::find( - panel_windows_.begin(), panel_windows_.end(), WmWindow::Get(panel)); +void PanelLayoutManager::RestorePanel(Window* panel) { + PanelList::iterator found = + std::find(panel_windows_.begin(), panel_windows_.end(), panel); DCHECK(found != panel_windows_.end()); found->slide_in = true; Relayout(); @@ -623,24 +620,24 @@ base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); const bool horizontal = shelf_->IsHorizontalAlignment(); - gfx::Rect shelf_bounds = panel_container_->ConvertRectFromScreen( - shelf_->GetWindow()->GetBoundsInScreen()); + gfx::Rect shelf_bounds = shelf_->GetWindow()->GetBoundsInScreen(); + ::wm::ConvertRectFromScreen(panel_container_, &shelf_bounds); int panel_start_bounds = kPanelIdealSpacing; int panel_end_bounds = - horizontal ? panel_container_->GetBounds().width() - kPanelIdealSpacing - : panel_container_->GetBounds().height() - kPanelIdealSpacing; - WmWindow* active_panel = nullptr; + horizontal ? panel_container_->bounds().width() - kPanelIdealSpacing + : panel_container_->bounds().height() - kPanelIdealSpacing; + Window* active_panel = nullptr; std::vector<VisiblePanelPositionInfo> visible_panels; for (PanelList::iterator iter = panel_windows_.begin(); iter != panel_windows_.end(); ++iter) { - WmWindow* panel = iter->window; + Window* panel = iter->window; iter->callout_widget->UpdateBounds(shelf_); // Consider the dragged panel as part of the layout as long as it is // touching the shelf. if ((!panel->IsVisible() && !iter->slide_in) || (panel == dragged_panel_ && - !BoundsAdjacent(panel->GetBounds(), shelf_bounds))) { + !BoundsAdjacent(panel->bounds(), shelf_bounds))) { continue; } @@ -649,12 +646,13 @@ // the shelf state does not update before the panel is added so we exclude // the dragged panel. if (panel != dragged_panel_ && restore_windows_on_shelf_visible_) { - panel->GetWindowState()->Minimize(); - restore_windows_on_shelf_visible_->Add(panel->aura_window()); + wm::GetWindowState(panel)->Minimize(); + restore_windows_on_shelf_visible_->Add(panel); continue; } - gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); + gfx::Rect icon_bounds = + shelf_->GetScreenBoundsOfItemIconForWindow(WmWindow::Get(panel)); // If both the icon width and height are 0 then there is no icon in the // shelf. If the shelf is hidden, one of the height or width will be @@ -663,19 +661,18 @@ if (icon_bounds.width() == 0 && icon_bounds.height() == 0) continue; - if (panel->IsFocused() || - panel->Contains(WmWindow::Get(wm::GetFocusedWindow()))) { + if (panel->HasFocus() || panel->Contains(wm::GetFocusedWindow())) { DCHECK(!active_panel); active_panel = panel; } - icon_bounds = panel_container_->ConvertRectFromScreen(icon_bounds); + ::wm::ConvertRectFromScreen(panel_container_, &icon_bounds); gfx::Point icon_origin = icon_bounds.origin(); VisiblePanelPositionInfo position_info; int icon_start = horizontal ? icon_origin.x() : icon_origin.y(); int icon_end = icon_start + (horizontal ? icon_bounds.width() : icon_bounds.height()); position_info.major_length = - horizontal ? panel->GetBounds().width() : panel->GetBounds().height(); + horizontal ? panel->bounds().width() : panel->bounds().height(); position_info.min_major = std::max(panel_start_bounds + position_info.major_length / 2, icon_end - position_info.major_length / 2); @@ -729,14 +726,13 @@ visible_panels[i].major_length / 2); } - ui::Layer* layer = visible_panels[i].window->GetLayer(); + ui::Layer* layer = visible_panels[i].window->layer(); if (slide_in) { // New windows shift up from the shelf into position and fade in. layer->SetOpacity(0); gfx::Rect initial_bounds(bounds); initial_bounds.Offset(GetSlideInAnimationOffset(shelf_->alignment())); - SetChildBoundsDirect(visible_panels[i].window->aura_window(), - initial_bounds); + SetChildBoundsDirect(visible_panels[i].window, initial_bounds); // Set on shelf so that the panel animates into its target position. on_shelf = true; } @@ -748,7 +744,7 @@ ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); panel_slide_settings.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kPanelSlideDurationMilliseconds)); - SetChildBoundsDirect(visible_panels[i].window->aura_window(), bounds); + SetChildBoundsDirect(visible_panels[i].window, bounds); if (slide_in) { layer->SetOpacity(1); visible_panels[i].window->Show(); @@ -756,7 +752,7 @@ } else { // If the shelf moved don't animate, move immediately to the new // target location. - SetChildBoundsDirect(visible_panels[i].window->aura_window(), bounds); + SetChildBoundsDirect(visible_panels[i].window, bounds); } } @@ -764,7 +760,7 @@ UpdateCallouts(); } -void PanelLayoutManager::UpdateStacking(WmWindow* active_panel) { +void PanelLayoutManager::UpdateStacking(Window* active_panel) { // Clusterfuzz can trigger panel accelerators before the shelf is created. // TODO(jamescook): Revert this after http://crbug.com/648964 is fixed. if (!shelf_) @@ -785,19 +781,19 @@ // allows us to update the stacking when a panel is being dragged around by // the titlebar--even though it doesn't update the shelf icon positions, we // still want the visual effect. - std::map<int, WmWindow*> window_ordering; + std::map<int, Window*> window_ordering; const bool horizontal = shelf_->IsHorizontalAlignment(); for (PanelList::const_iterator it = panel_windows_.begin(); it != panel_windows_.end(); ++it) { - gfx::Rect bounds = it->window->GetBounds(); + const gfx::Rect& bounds = it->window->bounds(); window_ordering.insert( std::make_pair(horizontal ? bounds.x() + bounds.width() / 2 : bounds.y() + bounds.height() / 2, it->window)); } - WmWindow* previous_panel = nullptr; - for (std::map<int, WmWindow*>::const_iterator it = window_ordering.begin(); + Window* previous_panel = nullptr; + for (std::map<int, Window*>::const_iterator it = window_ordering.begin(); it != window_ordering.end() && it->second != active_panel; ++it) { if (previous_panel) panel_container_->StackChildAbove(it->second, previous_panel); @@ -805,7 +801,7 @@ } previous_panel = nullptr; - for (std::map<int, WmWindow*>::const_reverse_iterator it = + for (std::map<int, Window*>::const_reverse_iterator it = window_ordering.rbegin(); it != window_ordering.rend() && it->second != active_panel; ++it) { if (previous_panel) @@ -814,7 +810,7 @@ } panel_container_->StackChildAtTop(active_panel); - if (dragged_panel_ && dragged_panel_->GetParent() == panel_container_) + if (dragged_panel_ && dragged_panel_->parent() == panel_container_) panel_container_->StackChildAtTop(dragged_panel_); last_active_panel_ = active_panel; } @@ -828,19 +824,19 @@ const bool horizontal = shelf_->IsHorizontalAlignment(); for (PanelList::iterator iter = panel_windows_.begin(); iter != panel_windows_.end(); ++iter) { - WmWindow* panel = iter->window; + Window* panel = iter->window; views::Widget* callout_widget = iter->callout_widget; - WmWindow* callout_widget_window = - WmWindow::Get(callout_widget->GetNativeWindow()); + Window* callout_widget_window = callout_widget->GetNativeWindow(); gfx::Rect current_bounds = panel->GetBoundsInScreen(); - gfx::Rect bounds = - panel->GetParent()->ConvertRectToScreen(panel->GetTargetBounds()); - gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); - if (icon_bounds.IsEmpty() || !panel->GetLayer()->GetTargetVisibility() || + gfx::Rect bounds = panel->GetTargetBounds(); + ::wm::ConvertRectToScreen(panel->parent(), &bounds); + gfx::Rect icon_bounds = + shelf_->GetScreenBoundsOfItemIconForWindow(WmWindow::Get(panel)); + if (icon_bounds.IsEmpty() || !panel->layer()->GetTargetVisibility() || panel == dragged_panel_ || !show_callout_widgets_) { callout_widget->Hide(); - callout_widget_window->GetLayer()->SetOpacity(0); + callout_widget_window->layer()->SetOpacity(0); continue; } @@ -868,15 +864,15 @@ callout_bounds.set_x(bounds.right()); else callout_bounds.set_y(bounds.bottom()); - callout_bounds = callout_widget_window->GetParent()->ConvertRectFromScreen( - callout_bounds); + ::wm::ConvertRectFromScreen(callout_widget_window->parent(), + &callout_bounds); - SetChildBoundsDirect(callout_widget_window->aura_window(), callout_bounds); - DCHECK_EQ(panel_container_, callout_widget_window->GetParent()); - DCHECK_EQ(panel_container_, panel->GetParent()); + SetChildBoundsDirect(callout_widget_window, callout_bounds); + DCHECK_EQ(panel_container_, callout_widget_window->parent()); + DCHECK_EQ(panel_container_, panel->parent()); panel_container_->StackChildAbove(callout_widget_window, panel); - ui::Layer* layer = callout_widget_window->GetLayer(); + ui::Layer* layer = callout_widget_window->layer(); // If the panel is not over the callout position or has just become visible // then fade in the callout. if ((distance_until_over_panel > 0 || layer->GetTargetOpacity() < 1)) { @@ -911,32 +907,31 @@ void PanelLayoutManager::OnKeyboardBoundsChanging( const gfx::Rect& keyboard_bounds) { - gfx::Rect parent_bounds = panel_container_->GetBounds(); + const gfx::Rect& parent_bounds = panel_container_->bounds(); int available_space = parent_bounds.height() - keyboard_bounds.height(); for (PanelList::iterator iter = panel_windows_.begin(); iter != panel_windows_.end(); ++iter) { - WmWindow* panel = iter->window; - wm::WindowState* panel_state = panel->GetWindowState(); + Window* panel = iter->window; + wm::WindowState* panel_state = wm::GetWindowState(panel); if (keyboard_bounds.height() > 0) { // Save existing bounds, so that we can restore them when the keyboard // hides. panel_state->SaveCurrentBoundsForRestore(); - gfx::Rect panel_bounds = - panel->GetParent()->ConvertRectToScreen(panel->GetTargetBounds()); + gfx::Rect panel_bounds = panel->GetTargetBounds(); + ::wm::ConvertRectToScreen(panel->parent(), &panel_bounds); int delta = panel_bounds.height() - available_space; // Ensure panels are not pushed above the parent boundaries, shrink any // panels that violate this constraint. if (delta > 0) { SetChildBoundsDirect( - panel->aura_window(), + panel, gfx::Rect(panel_bounds.x(), panel_bounds.y() + delta, panel_bounds.width(), panel_bounds.height() - delta)); } } else if (panel_state->HasRestoreBounds()) { // Keyboard hidden, restore original bounds if they exist. - SetChildBoundsDirect(panel->aura_window(), - panel_state->GetRestoreBoundsInScreen()); + SetChildBoundsDirect(panel, panel_state->GetRestoreBoundsInScreen()); } } // This bounds change will have caused a change to the Shelf which does not
diff --git a/ash/wm/panels/panel_layout_manager.h b/ash/wm/panels/panel_layout_manager.h index 3bb204e4..e4133d4 100644 --- a/ash/wm/panels/panel_layout_manager.h +++ b/ash/wm/panels/panel_layout_manager.h
@@ -60,26 +60,26 @@ public keyboard::KeyboardControllerObserver, public WmShelfObserver { public: - explicit PanelLayoutManager(WmWindow* panel_container); + explicit PanelLayoutManager(aura::Window* panel_container); ~PanelLayoutManager() override; // Returns the PanelLayoutManager in the specified hierarchy. This searches // from the root of |window|. - static PanelLayoutManager* Get(WmWindow* window); + static PanelLayoutManager* Get(aura::Window* window); // Call Shutdown() before deleting children of panel_container. void Shutdown(); - void StartDragging(WmWindow* panel); + void StartDragging(aura::Window* panel); void FinishDragging(); - void ToggleMinimize(WmWindow* panel); + void ToggleMinimize(aura::Window* panel); // Hide / Show the panel callout widgets. void SetShowCalloutWidgets(bool show); // Returns the callout widget (arrow) for |panel|. - views::Widget* GetCalloutWidgetForPanel(WmWindow* panel); + views::Widget* GetCalloutWidgetForPanel(aura::Window* panel); WmShelf* shelf() { return shelf_; } void SetShelf(WmShelf* shelf); @@ -132,7 +132,7 @@ struct ASH_EXPORT PanelInfo { PanelInfo() : window(NULL), callout_widget(NULL), slide_in(false) {} - bool operator==(const WmWindow* other_window) const { + bool operator==(const aura::Window* other_window) const { return window == other_window; } @@ -140,7 +140,7 @@ views::Widget* CalloutWidget(); // A weak pointer to the panel window. - WmWindow* window; + aura::Window* window; // The callout widget for this panel. This pointer must be managed // manually as this structure is used in a std::list. See @@ -163,7 +163,7 @@ // Called whenever the panel stacking order needs to be updated (e.g. focus // changes or a panel is moved). - void UpdateStacking(WmWindow* active_panel); + void UpdateStacking(aura::Window* active_panel); // Update the callout arrows for all managed panels. void UpdateCallouts(); @@ -173,7 +173,7 @@ void OnKeyboardClosed() override; // Parent window associated with this layout manager. - WmWindow* panel_container_; + aura::Window* panel_container_; RootWindowController* root_window_controller_; @@ -186,7 +186,7 @@ // Ordered list of unowned pointers to panel windows. PanelList panel_windows_; // The panel being dragged. - WmWindow* dragged_panel_; + aura::Window* dragged_panel_; // The shelf we are observing for shelf icon changes. WmShelf* shelf_; @@ -197,7 +197,7 @@ // The last active panel. Used to maintain stacking order even if no panels // are currently focused. - WmWindow* last_active_panel_; + aura::Window* last_active_panel_; ScopedObserver<keyboard::KeyboardController, keyboard::KeyboardControllerObserver>
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc index 0ea8f02..9bf9b69 100644 --- a/ash/wm/panels/panel_layout_manager_unittest.cc +++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -105,12 +105,10 @@ } views::Widget* GetCalloutWidgetForPanel(aura::Window* panel) { - WmWindow* wm_panel = WmWindow::Get(panel); - PanelLayoutManager* manager = PanelLayoutManager::Get(wm_panel); + PanelLayoutManager* manager = PanelLayoutManager::Get(panel); DCHECK(manager); - PanelLayoutManager::PanelList::iterator found = - std::find(manager->panel_windows_.begin(), - manager->panel_windows_.end(), wm_panel); + PanelLayoutManager::PanelList::iterator found = std::find( + manager->panel_windows_.begin(), manager->panel_windows_.end(), panel); DCHECK(found != manager->panel_windows_.end()); DCHECK(found->callout_widget); return found->CalloutWidget();
diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc index 1425485..f578e61 100644 --- a/ash/wm/panels/panel_window_resizer.cc +++ b/ash/wm/panels/panel_window_resizer.cc
@@ -67,7 +67,7 @@ // The panel's parent already knows that the drag is in progress for this // panel. if (panel_container_ && GetTarget()->parent() != panel_container_) - GetPanelLayoutManager()->StartDragging(WmWindow::Get(GetTarget())); + GetPanelLayoutManager()->StartDragging(GetTarget()); } gfx::Point offset; gfx::Rect bounds(CalculateBoundsForDrag(location)); @@ -156,7 +156,7 @@ // Tell the panel layout manager that we are dragging this panel before // attaching it so that it does not get repositioned. if (panel_container_) - GetPanelLayoutManager()->StartDragging(WmWindow::Get(GetTarget())); + GetPanelLayoutManager()->StartDragging(GetTarget()); if (!was_attached_) { // Attach the panel while dragging, placing it in front of other panels. aura::Window* target = GetTarget(); @@ -191,10 +191,8 @@ // If we started the drag in one root window and moved into another root // but then canceled the drag we may need to inform the original layout // manager that the drag is finished. - if (initial_panel_container_ != panel_container_) { - PanelLayoutManager::Get(WmWindow::Get(initial_panel_container_)) - ->FinishDragging(); - } + if (initial_panel_container_ != panel_container_) + PanelLayoutManager::Get(initial_panel_container_)->FinishDragging(); if (panel_container_) GetPanelLayoutManager()->FinishDragging(); } @@ -207,7 +205,7 @@ } PanelLayoutManager* PanelWindowResizer::GetPanelLayoutManager() { - return PanelLayoutManager::Get(WmWindow::Get(panel_container_)); + return PanelLayoutManager::Get(panel_container_); } } // namespace ash
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc index 1ea1ec7..efbdbca2 100644 --- a/ash/wm/power_button_controller.cc +++ b/ash/wm/power_button_controller.cc
@@ -25,23 +25,13 @@ namespace ash { PowerButtonController::PowerButtonController(LockStateController* controller) - : power_button_down_(false), - lock_button_down_(false), - volume_down_pressed_(false), - volume_percent_before_screenshot_(0), - brightness_is_zero_(false), - internal_display_off_and_external_display_on_(false), - has_legacy_power_button_( + : has_legacy_power_button_( base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAuraLegacyPowerButton)), lock_state_controller_(controller) { chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( this); - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kAshEnableTouchView)) { - tablet_controller_.reset( - new TabletPowerButtonController(lock_state_controller_)); - } + chromeos::AccelerometerReader::GetInstance()->AddObserver(this); Shell::Get()->display_configurator()->AddObserver(this); Shell::Get()->PrependPreTargetHandler(this); } @@ -49,9 +39,10 @@ PowerButtonController::~PowerButtonController() { Shell::Get()->RemovePreTargetHandler(this); Shell::Get()->display_configurator()->RemoveObserver(this); - tablet_controller_.reset(); + chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver( this); + tablet_controller_.reset(); } void PowerButtonController::OnScreenBrightnessChanged(double percent) { @@ -196,9 +187,16 @@ OnPowerButtonEvent(down, timestamp); } -void PowerButtonController::ResetTabletPowerButtonControllerForTest() { +void PowerButtonController::OnAccelerometerUpdated( + scoped_refptr<const chromeos::AccelerometerUpdate> update) { + if (tablet_controller_) + return; tablet_controller_.reset( new TabletPowerButtonController(lock_state_controller_)); } +void PowerButtonController::ResetTabletPowerButtonControllerForTest() { + tablet_controller_.reset(); +} + } // namespace ash
diff --git a/ash/wm/power_button_controller.h b/ash/wm/power_button_controller.h index 5669271..dd7fce1 100644 --- a/ash/wm/power_button_controller.h +++ b/ash/wm/power_button_controller.h
@@ -10,6 +10,7 @@ #include "ash/ash_export.h" #include "base/macros.h" #include "base/time/time.h" +#include "chromeos/accelerometer/accelerometer_reader.h" #include "chromeos/dbus/power_manager_client.h" #include "ui/display/manager/chromeos/display_configurator.h" #include "ui/events/event_handler.h" @@ -25,7 +26,8 @@ class ASH_EXPORT PowerButtonController : public ui::EventHandler, public display::DisplayConfigurator::Observer, - public chromeos::PowerManagerClient::Observer { + public chromeos::PowerManagerClient::Observer, + public chromeos::AccelerometerReader::Observer { public: explicit PowerButtonController(LockStateController* controller); ~PowerButtonController() override; @@ -44,7 +46,7 @@ // ui::EventHandler: void OnKeyEvent(ui::KeyEvent* event) override; - // Overriden from display::DisplayConfigurator::Observer: + // Overridden from display::DisplayConfigurator::Observer: void OnDisplayModeChanged( const display::DisplayConfigurator::DisplayStateList& outputs) override; @@ -52,6 +54,10 @@ void PowerButtonEventReceived(bool down, const base::TimeTicks& timestamp) override; + // Overridden from chromeos::AccelerometerReader::Observer: + void OnAccelerometerUpdated( + scoped_refptr<const chromeos::AccelerometerUpdate> update) override; + // Resets |tablet_controller_| to hold a new object to simulate Chrome // starting. void ResetTabletPowerButtonControllerForTest(); @@ -62,27 +68,27 @@ private: // Are the power or lock buttons currently held? - bool power_button_down_; - bool lock_button_down_; + bool power_button_down_ = false; + bool lock_button_down_ = false; // True when the volume down button is being held down. - bool volume_down_pressed_; + bool volume_down_pressed_ = false; // Volume to be restored after a screenshot is taken by pressing the power // button while holding VKEY_VOLUME_DOWN. - int volume_percent_before_screenshot_; + int volume_percent_before_screenshot_ = 0; // Has the screen brightness been reduced to 0%? - bool brightness_is_zero_; + bool brightness_is_zero_ = false; // True if an internal display is off while an external display is on (e.g. // for Chrome OS's docked mode, where a Chromebook's lid is closed while an // external display is connected). - bool internal_display_off_and_external_display_on_; + bool internal_display_off_and_external_display_on_ = false; // Was a command-line switch set telling us that we're running on hardware // that misreports power button releases? - bool has_legacy_power_button_; + bool has_legacy_power_button_ = false; LockStateController* lock_state_controller_; // Not owned.
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc index b8e06c2..904fc14 100644 --- a/ash/wm/workspace/workspace_layout_manager.cc +++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -215,9 +215,8 @@ if (key == aura::client::kAlwaysOnTopKey) { if (window->GetProperty(aura::client::kAlwaysOnTopKey)) { aura::Window* container = - root_window_controller_->always_on_top_controller() - ->GetContainer(WmWindow::Get(window)) - ->aura_window(); + root_window_controller_->always_on_top_controller()->GetContainer( + window); if (window->parent() != container) container->AddChild(window); }
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index a5da8c85..6ecd9b7 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc
@@ -117,8 +117,7 @@ const gfx::Rect& bounds) { aura::Window* window = CreateTestWindowInShellWithDelegateAndType( delegate, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); - WmWindow* wm_window = WmWindow::Get(window); - PanelLayoutManager::Get(wm_window)->Relayout(); + PanelLayoutManager::Get(window)->Relayout(); return window; }
diff --git a/base/BUILD.gn b/base/BUILD.gn index 02c13b92..0541b09 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -1243,6 +1243,7 @@ ] sources += [ + "debug/stack_trace_fuchsia.cc", "process/process_fuchsia.cc", "sys_info_fuchsia.cc", "threading/platform_thread_fuchsia.cc",
diff --git a/base/debug/stack_trace_fuchsia.cc b/base/debug/stack_trace_fuchsia.cc new file mode 100644 index 0000000..fb8d195 --- /dev/null +++ b/base/debug/stack_trace_fuchsia.cc
@@ -0,0 +1,127 @@ +// 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/debug/stack_trace.h" + +#include <magenta/process.h> +#include <magenta/syscalls.h> +#include <magenta/syscalls/port.h> +#include <magenta/types.h> +#include <threads.h> +#include <unwind.h> + +#include <algorithm> +#include <iostream> + +#include "base/logging.h" + +namespace base { +namespace debug { + +namespace { + +struct BacktraceData { + void** trace_array; + size_t* count; + size_t max; +}; + +_Unwind_Reason_Code UnwindStore(struct _Unwind_Context* context, + void* user_data) { + BacktraceData* data = reinterpret_cast<BacktraceData*>(user_data); + uintptr_t pc = _Unwind_GetIP(context); + data->trace_array[*data->count] = reinterpret_cast<void*>(pc); + data->count += 1; + if (*data->count == data->max) + return _URC_END_OF_STACK; + return _URC_NO_REASON; +} + +constexpr uint64_t kExceptionKey = 0x424144u; // "BAD". +bool g_in_process_exception_handler_enabled; + +int SelfDumpFunc(void* arg) { + mx_handle_t exception_port = + static_cast<mx_handle_t>(reinterpret_cast<uintptr_t>(arg)); + + mx_exception_packet_t packet; + mx_status_t status = + mx_port_wait(exception_port, MX_TIME_INFINITE, &packet, sizeof(packet)); + if (status < 0) { + DLOG(ERROR) << "mx_port_wait failed: " << status; + return 1; + } + if (packet.hdr.key != kExceptionKey) { + DLOG(ERROR) << "unexpected crash key"; + return 1; + } + + LOG(ERROR) << "Process crashed."; + + // TODO(fuchsia): Log a stack. See https://crbug.com/706592. + + _exit(1); +} + +bool SetInProcessExceptionHandler() { + if (g_in_process_exception_handler_enabled) + return true; + + mx_status_t status; + mx_handle_t self_dump_port; + status = mx_port_create(0u, &self_dump_port); + if (status < 0) { + DLOG(ERROR) << "mx_port_create failed: " << status; + return false; + } + + // A thread to wait for and process internal exceptions. + thrd_t self_dump_thread; + void* self_dump_arg = + reinterpret_cast<void*>(static_cast<uintptr_t>(self_dump_port)); + int ret = thrd_create(&self_dump_thread, SelfDumpFunc, self_dump_arg); + if (ret != thrd_success) { + DLOG(ERROR) << "thrd_create failed: " << ret; + return false; + } + + status = mx_task_bind_exception_port(mx_process_self(), self_dump_port, + kExceptionKey, 0); + + if (status < 0) { + DLOG(ERROR) << "mx_task_bind_exception_port failed: " << status; + return false; + } + + g_in_process_exception_handler_enabled = true; + return true; +} + +} // namespace + +// static +bool EnableInProcessStackDumping() { + return SetInProcessExceptionHandler(); +} + +StackTrace::StackTrace(size_t count) : count_(0) { + BacktraceData data = {&trace_[0], &count_, + std::min(count, static_cast<size_t>(kMaxTraces))}; + _Unwind_Backtrace(&UnwindStore, &data); +} + +void StackTrace::Print() const { + OutputToStream(&std::cerr); +} + +void StackTrace::OutputToStream(std::ostream* os) const { + // TODO(fuchsia): Consider doing symbol resolution here. See + // https://crbug.com/706592. + for (size_t i = 0; (i < count_) && os->good(); ++i) { + (*os) << "\t" << trace_[i] << "\n"; + } +} + +} // namespace debug +} // namespace base
diff --git a/base/debug/stack_trace_unittest.cc b/base/debug/stack_trace_unittest.cc index d15adbe..de821fe 100644 --- a/base/debug/stack_trace_unittest.cc +++ b/base/debug/stack_trace_unittest.cc
@@ -153,7 +153,7 @@ } #endif // !defined(__UCLIBC__) -#if defined(OS_POSIX) && !defined(OS_ANDROID) +#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_FUCHSIA) #if !defined(OS_IOS) static char* newArray() { // Clang warns about the mismatched new[]/delete if they occur in the same @@ -253,7 +253,7 @@ EXPECT_EQ("0688", itoa_r_wrapper(0x688, 128, 16, 4)); EXPECT_EQ("00688", itoa_r_wrapper(0x688, 128, 16, 5)); } -#endif // defined(OS_POSIX) && !defined(OS_ANDROID) +#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_FUCHSIA) #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
diff --git a/base/metrics/persistent_sample_map.cc b/base/metrics/persistent_sample_map.cc index 743b644..af09f97 100644 --- a/base/metrics/persistent_sample_map.cc +++ b/base/metrics/persistent_sample_map.cc
@@ -24,6 +24,9 @@ PERSISTENT_SPARSE_ADDED_NEGATIVE_COUNT, PERSISTENT_SPARSE_ADD_WENT_NEGATIVE, PERSISTENT_SPARSE_ADD_OVERFLOW, + PERSISTENT_SPARSE_ACCUMULATE_NEGATIVE_COUNT, + PERSISTENT_SPARSE_ACCUMULATE_WENT_NEGATIVE, + PERSISTENT_SPARSE_ACCUMULATE_OVERFLOW, MAX_NEGATIVE_SAMPLE_REASONS }; @@ -118,7 +121,26 @@ } void PersistentSampleMap::Accumulate(Sample value, Count count) { +#if 0 // TODO(bcwhite) Re-enable efficient version after crbug.com/682680. *GetOrCreateSampleCountStorage(value) += count; +#else + NegativeSampleReason reason = MAX_NEGATIVE_SAMPLE_REASONS; + Count* local_count_ptr = GetOrCreateSampleCountStorage(value); + if (count < 0) { + reason = PERSISTENT_SPARSE_ACCUMULATE_NEGATIVE_COUNT; + if (*local_count_ptr < -count) + reason = PERSISTENT_SPARSE_ACCUMULATE_WENT_NEGATIVE; + *local_count_ptr += count; + } else { + *local_count_ptr += count; + if (*local_count_ptr < 0) + reason = PERSISTENT_SPARSE_ACCUMULATE_OVERFLOW; + } + if (reason != MAX_NEGATIVE_SAMPLE_REASONS) { + UMA_HISTOGRAM_ENUMERATION("UMA.NegativeSamples.Reason", reason, + MAX_NEGATIVE_SAMPLE_REASONS); + } +#endif IncreaseSumAndCount(strict_cast<int64_t>(count) * value, count); } @@ -195,48 +217,8 @@ continue; if (strict_cast<int64_t>(min) + 1 != max) return false; // SparseHistogram only supports bucket with size 1. - -#if 0 // TODO(bcwhite) Re-enable efficient version after crbug.com/682680. *GetOrCreateSampleCountStorage(min) += (op == HistogramSamples::ADD) ? count : -count; -#else - NegativeSampleReason reason = MAX_NEGATIVE_SAMPLE_REASONS; - if (op == HistogramSamples::ADD) { - // Add should generally be adding only positive values. - Count* local_count_ptr = GetOrCreateSampleCountStorage(min); - if (count < 0) { - reason = PERSISTENT_SPARSE_ADDED_NEGATIVE_COUNT; - if (*local_count_ptr < -count) { - reason = PERSISTENT_SPARSE_ADD_WENT_NEGATIVE; - *local_count_ptr = 0; - } - } else { - *local_count_ptr += count; - if (*local_count_ptr < 0) - reason = PERSISTENT_SPARSE_ADD_OVERFLOW; - } - } else { - // Subtract is used only for determining deltas when reporting which - // means that it's in the "logged" iterator. It should have an active - // sample record and thus there is no need to try to create one. - Count* local_count_ptr = GetSampleCountStorage(min); - if (local_count_ptr == nullptr) { - reason = PERSISTENT_SPARSE_HAVE_LOGGED_BUT_NOT_SAMPLE; - } else { - if (*local_count_ptr < count) { - reason = PERSISTENT_SPARSE_SAMPLE_LESS_THAN_LOGGED; - *local_count_ptr = 0; - } else { - *local_count_ptr -= count; - } - } - } - if (reason != MAX_NEGATIVE_SAMPLE_REASONS) { - NOTREACHED(); - UMA_HISTOGRAM_ENUMERATION("UMA.NegativeSamples.Reason", reason, - MAX_NEGATIVE_SAMPLE_REASONS); - } -#endif } return true; }
diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc index 0ae3a30..52800a83 100644 --- a/base/time/time_mac.cc +++ b/base/time/time_mac.cc
@@ -23,6 +23,11 @@ #include "base/numerics/safe_conversions.h" #include "build/build_config.h" +#if defined(OS_IOS) +#include <time.h> +#include "base/ios/ios_util.h" +#endif + namespace { #if defined(OS_MACOSX) && !defined(OS_IOS) @@ -52,8 +57,20 @@ } #endif // defined(OS_MACOSX) && !defined(OS_IOS) +// Returns monotonically growing number of ticks in microseconds since some +// unspecified starting point. int64_t ComputeCurrentTicks() { #if defined(OS_IOS) + // iOS 10 supports clock_gettime(CLOCK_MONOTONIC, ...), which is + // around 15 times faster than sysctl() call. Use it if possible; + // otherwise, fall back to sysctl(). + if (base::ios::IsRunningOnIOS10OrLater()) { + struct timespec tp; + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { + return (int64_t)tp.tv_sec * 1000000 + tp.tv_nsec / 1000; + } + } + // On iOS mach_absolute_time stops while the device is sleeping. Instead use // now - KERN_BOOTTIME to get a time difference that is not impacted by clock // changes. KERN_BOOTTIME will be updated by the system whenever the system
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc index 21357c7a..17c9bc39 100644 --- a/base/trace_event/malloc_dump_provider.cc +++ b/base/trace_event/malloc_dump_provider.cc
@@ -298,26 +298,22 @@ // Enclosing all the temporary data structures in a scope, so that the heap // profiler does not see unbalanced malloc/free calls from these containers. { - size_t shim_allocated_objects_size = 0; - size_t shim_allocated_objects_count = 0; TraceEventMemoryOverhead overhead; std::unordered_map<AllocationContext, AllocationMetrics> metrics_by_context; if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) { - ShardedAllocationRegister::OutputMetrics metrics = + ShardedAllocationRegister::OutputMetrics shim_metrics = allocation_register_.UpdateAndReturnsMetrics(metrics_by_context); // Aggregate data for objects allocated through the shim. - shim_allocated_objects_size += metrics.size; - shim_allocated_objects_count += metrics.count; + inner_dump->AddScalar("shim_allocated_objects_size", + MemoryAllocatorDump::kUnitsBytes, + shim_metrics.size); + inner_dump->AddScalar("shim_allocator_object_count", + MemoryAllocatorDump::kUnitsObjects, + shim_metrics.count); } allocation_register_.EstimateTraceMemoryOverhead(&overhead); - inner_dump->AddScalar("shim_allocated_objects_size", - MemoryAllocatorDump::kUnitsBytes, - shim_allocated_objects_size); - inner_dump->AddScalar("shim_allocator_object_count", - MemoryAllocatorDump::kUnitsObjects, - shim_allocated_objects_count); pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc"); } tid_dumping_heap_ = kInvalidThreadId;
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 1c50195..64e82671 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -1441,7 +1441,11 @@ # Favor size over speed. # TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl # guard above. - cflags = [ "-Os" ] + common_optimize_on_cflags + if (is_clang) { + cflags = [ "-Oz" ] + common_optimize_on_cflags + } else { + cflags = [ "-Os" ] + common_optimize_on_cflags + } } else { cflags = [ "-O2" ] + common_optimize_on_cflags } @@ -1458,7 +1462,11 @@ # Favor size over speed. # TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl # guard above. - cflags = [ "-Os" ] + common_optimize_on_cflags + if (is_clang) { + cflags = [ "-Oz" ] + common_optimize_on_cflags + } else { + cflags = [ "-Os" ] + common_optimize_on_cflags + } } else if (optimize_for_fuzzing) { cflags = [ "-O1" ] + common_optimize_on_cflags } else { @@ -1478,7 +1486,11 @@ } else if (is_android && !android_full_debug) { # On Android we kind of optimize some things that don't affect debugging # much even when optimization is disabled to get the binary size down. - cflags = [ "-Os" ] + if (is_clang) { + cflags = [ "-Oz" ] + common_optimize_on_cflags + } else { + cflags = [ "-Os" ] + common_optimize_on_cflags + } } else { cflags = [ "-O0" ] ldflags = []
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 9176b2fd..18e1856 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -713,7 +713,6 @@ "base/index_rect_unittest.cc", "base/list_container_unittest.cc", "base/math_util_unittest.cc", - "base/random_access_list_container_unittest.cc", "base/region_unittest.cc", "base/rolling_time_delta_history_unittest.cc", "base/rtree_unittest.cc",
diff --git a/cc/base/BUILD.gn b/cc/base/BUILD.gn index db70d19..8b4eef21 100644 --- a/cc/base/BUILD.gn +++ b/cc/base/BUILD.gn
@@ -33,7 +33,6 @@ "list_container_helper.h", "math_util.cc", "math_util.h", - "random_access_list_container.h", "region.cc", "region.h", "render_surface_filters.cc",
diff --git a/cc/base/list_container.h b/cc/base/list_container.h index cb386f9..93a6a67 100644 --- a/cc/base/list_container.h +++ b/cc/base/list_container.h
@@ -26,28 +26,15 @@ template <class BaseElementType> class ListContainer { public: - ListContainer(ListContainer&& other) : helper_(sizeof(BaseElementType)) { - helper_.data_.swap(other.helper_.data_); - } - - // BaseElementType is the type of raw pointers this class hands out; however, - // its derived classes might require different memory sizes. - // max_size_for_derived_class the largest memory size required for all the - // derived classes to use for allocation. - explicit ListContainer(size_t max_size_for_derived_class) - : helper_(max_size_for_derived_class) {} - - // This constructor omits input variable for max_size_for_derived_class. This - // is used when there is no derived classes from BaseElementType we need to - // worry about, and allocation size is just sizeof(BaseElementType). - ListContainer() : helper_(sizeof(BaseElementType)) {} - // This constructor reserves the requested memory up front so only single // allocation is needed. When num_of_elements_to_reserve_for is zero, use the // default size. - ListContainer(size_t max_size_for_derived_class, + ListContainer(size_t max_alignment, + size_t max_size_for_derived_class, size_t num_of_elements_to_reserve_for) - : helper_(max_size_for_derived_class, num_of_elements_to_reserve_for) {} + : helper_(max_alignment, + max_size_for_derived_class, + num_of_elements_to_reserve_for) {} ~ListContainer() { for (Iterator i = begin(); i != end(); ++i) { @@ -114,7 +101,8 @@ // Allocate(). template <typename DerivedElementType> DerivedElementType* AllocateAndConstruct() { - return new (helper_.Allocate(sizeof(DerivedElementType))) + return new (helper_.Allocate(ALIGNOF(DerivedElementType), + sizeof(DerivedElementType))) DerivedElementType; } @@ -122,7 +110,8 @@ // Allocate(). template <typename DerivedElementType> DerivedElementType* AllocateAndCopyFrom(const DerivedElementType* source) { - return new (helper_.Allocate(sizeof(DerivedElementType))) + return new (helper_.Allocate(ALIGNOF(DerivedElementType), + sizeof(DerivedElementType))) DerivedElementType(*source); } @@ -165,7 +154,8 @@ template <typename DerivedElementType> DerivedElementType* AppendByMoving(DerivedElementType* item) { size_t max_size_for_derived_class = helper_.MaxSizeForDerivedClass(); - void* new_item = helper_.Allocate(max_size_for_derived_class); + void* new_item = helper_.Allocate(ALIGNOF(DerivedElementType), + max_size_for_derived_class); memcpy(new_item, static_cast<void*>(item), max_size_for_derived_class); // Construct a new element in-place so it can be destructed safely. new (item) DerivedElementType;
diff --git a/cc/base/list_container_helper.cc b/cc/base/list_container_helper.cc index 9d8a029..84ecd9b 100644 --- a/cc/base/list_container_helper.cc +++ b/cc/base/list_container_helper.cc
@@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/memory/aligned_memory.h" namespace { const size_t kDefaultNumElementTypesToReserve = 32; @@ -29,7 +30,7 @@ // This class holds the raw memory chunk, as well as information about its // size and availability. struct InnerList { - std::unique_ptr<char[]> data; + std::unique_ptr<char[], base::AlignedFreeDeleter> data; // The number of elements in total the memory can hold. The difference // between capacity and size is the how many more elements this list can // hold. @@ -56,7 +57,7 @@ --capacity; } - void InsertBefore(char** position, size_t count) { + void InsertBefore(size_t alignment, char** position, size_t count) { DCHECK_LE(*position, LastElement() + step); DCHECK_GE(*position, Begin()); @@ -66,7 +67,8 @@ capacity = size; // Allocate the new data and update the iterator's pointer. - std::unique_ptr<char[]> new_data(new char[size * step]); + std::unique_ptr<char[], base::AlignedFreeDeleter> new_data( + static_cast<char*>(base::AlignedAlloc(size * step, alignment))); size_t position_offset = *position - Begin(); *position = new_data.get() + position_offset; @@ -75,7 +77,7 @@ // Copy the data after the inserted segment. memcpy(new_data.get() + position_offset + count * step, data.get() + position_offset, old_size * step - position_offset); - new_data.swap(data); + data = std::move(new_data); } bool IsEmpty() const { return !size; } @@ -102,20 +104,16 @@ DISALLOW_COPY_AND_ASSIGN(InnerList); }; - explicit CharAllocator(size_t element_size) - : element_size_(element_size), + CharAllocator(size_t alignment, size_t element_size, size_t element_count) + // base::AlignedAlloc does not accept alignment less than sizeof(void*). + : alignment_(std::max(sizeof(void*), alignment)), + element_size_(element_size), size_(0), last_list_index_(0), last_list_(nullptr) { - AllocateNewList(kDefaultNumElementTypesToReserve); - last_list_ = storage_[last_list_index_].get(); - } - - CharAllocator(size_t element_size, size_t element_count) - : element_size_(element_size), - size_(0), - last_list_index_(0), - last_list_(nullptr) { + // If this fails, then alignment of elements after the first could be wrong, + // and we need to pad sizes to fix that. + DCHECK_EQ(element_size % alignment, 0u); AllocateNewList(element_count > 0 ? element_count : kDefaultNumElementTypesToReserve); last_list_ = storage_[last_list_index_].get(); @@ -138,6 +136,7 @@ return last_list_->AddElement(); } + size_t alignment() const { return alignment_; } size_t element_size() const { return element_size_; } size_t list_count() const { return storage_.size(); } size_t size() const { return size_; } @@ -203,8 +202,8 @@ for (size_t i = 1; i < count; ++i) Allocate(); } else { - storage_[position->vector_index]->InsertBefore(&position->item_iterator, - count); + storage_[position->vector_index]->InsertBefore( + alignment_, &position->item_iterator, count); size_ += count; } } @@ -244,11 +243,13 @@ new_list->capacity = list_size; new_list->size = 0; new_list->step = element_size_; - new_list->data.reset(new char[list_size * element_size_]); + new_list->data.reset(static_cast<char*>( + base::AlignedAlloc(list_size * element_size_, alignment_))); storage_.push_back(std::move(new_list)); } std::vector<std::unique_ptr<InnerList>> storage_; + const size_t alignment_; const size_t element_size_; // The number of elements in the list. @@ -341,12 +342,11 @@ // ListContainerHelper //////////////////////////////////////////// -ListContainerHelper::ListContainerHelper(size_t max_size_for_derived_class) - : data_(new CharAllocator(max_size_for_derived_class)) {} - -ListContainerHelper::ListContainerHelper(size_t max_size_for_derived_class, +ListContainerHelper::ListContainerHelper(size_t alignment, + size_t max_size_for_derived_class, size_t num_of_elements_to_reserve_for) - : data_(new CharAllocator(max_size_for_derived_class, + : data_(new CharAllocator(alignment, + max_size_for_derived_class, num_of_elements_to_reserve_for)) {} ListContainerHelper::~ListContainerHelper() {} @@ -456,7 +456,9 @@ original_index); } -void* ListContainerHelper::Allocate(size_t size_of_actual_element_in_bytes) { +void* ListContainerHelper::Allocate(size_t alignment, + size_t size_of_actual_element_in_bytes) { + DCHECK_LE(alignment, data_->alignment()); DCHECK_LE(size_of_actual_element_in_bytes, data_->element_size()); return data_->Allocate(); }
diff --git a/cc/base/list_container_helper.h b/cc/base/list_container_helper.h index ce98c1e..c79cf1f 100644 --- a/cc/base/list_container_helper.h +++ b/cc/base/list_container_helper.h
@@ -22,12 +22,9 @@ template <typename T> friend class ListContainer; - template <typename T> - friend class RandomAccessListContainer; - - explicit ListContainerHelper(size_t max_size_for_derived_class); - ListContainerHelper(size_t max_size_for_derived_class, - size_t num_of_elements_to_reserve_for); + explicit ListContainerHelper(size_t alignment, + size_t max_size_for_derived_class, + size_t num_of_elements_to_reserve_for); ~ListContainerHelper(); // This class deals only with char* and void*. It does allocation and passing @@ -170,7 +167,7 @@ size_t AvailableSizeWithoutAnotherAllocationForTesting() const; // Hands out memory location for an element at the end of data structure. - void* Allocate(size_t size_of_actual_element_in_bytes); + void* Allocate(size_t alignment, size_t size_of_actual_element_in_bytes); std::unique_ptr<CharAllocator> data_;
diff --git a/cc/base/list_container_unittest.cc b/cc/base/list_container_unittest.cc index 1363025..31ef300 100644 --- a/cc/base/list_container_unittest.cc +++ b/cc/base/list_container_unittest.cc
@@ -51,17 +51,20 @@ }; const size_t kLargestDerivedElementSize = sizeof(DerivedElement3); +const size_t kLargestDerivedElementAlign = ALIGNOF(DerivedElement3); -size_t LargestDerivedElementSize() { - static_assert(sizeof(DerivedElement1) <= kLargestDerivedElementSize, - "Largest Derived Element size needs update. DerivedElement1 is " - "currently largest."); - static_assert(sizeof(DerivedElement2) <= kLargestDerivedElementSize, - "Largest Derived Element size needs update. DerivedElement2 is " - "currently largest."); - - return kLargestDerivedElementSize; -} +static_assert(sizeof(DerivedElement1) <= kLargestDerivedElementSize, + "Largest Derived Element size needs update. DerivedElement1 is " + "currently largest."); +static_assert(sizeof(DerivedElement2) <= kLargestDerivedElementSize, + "Largest Derived Element size needs update. DerivedElement2 is " + "currently largest."); +static_assert(ALIGNOF(DerivedElement1) <= kLargestDerivedElementSize, + "Largest Derived Element align needs update. DerivedElement1 is " + "currently largest."); +static_assert(ALIGNOF(DerivedElement2) <= kLargestDerivedElementSize, + "Largest Derived Element align needs update. DerivedElement2 is " + "currently largest."); // Element class having no derived classes. class NonDerivedElement { @@ -132,10 +135,13 @@ }; const size_t kCurrentLargestDerivedElementSize = - std::max(LargestDerivedElementSize(), sizeof(MockDerivedElementSubclass)); + std::max(kLargestDerivedElementSize, sizeof(MockDerivedElementSubclass)); +const size_t kCurrentLargestDerivedElementAlign = + std::max(kLargestDerivedElementAlign, ALIGNOF(MockDerivedElementSubclass)); TEST(ListContainerTest, ConstructorCalledInAllocateAndConstruct) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); size_t size = 2; SimpleDerivedElementConstructMagicNumberOne* de_1 = @@ -152,7 +158,8 @@ } TEST(ListContainerTest, DestructorCalled) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); size_t size = 1; MockDerivedElement* de_1 = list.AllocateAndConstruct<MockDerivedElement>(); @@ -163,7 +170,8 @@ } TEST(ListContainerTest, DestructorCalledOnceWhenClear) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); size_t size = 1; MockDerivedElement* de_1 = list.AllocateAndConstruct<MockDerivedElement>(); @@ -186,7 +194,8 @@ TEST(ListContainerTest, ClearDoesNotMalloc) { const size_t reserve = 10; - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize, + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, reserve); // Memory from the initial inner list that should be re-used after clear(). @@ -218,7 +227,8 @@ } TEST(ListContainerTest, ReplaceExistingElement) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); size_t size = 1; MockDerivedElement* de_1 = list.AllocateAndConstruct<MockDerivedElement>(); @@ -244,7 +254,8 @@ } TEST(ListContainerTest, DestructorCalledOnceWhenErase) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); size_t size = 1; MockDerivedElement* de_1 = list.AllocateAndConstruct<MockDerivedElement>(); @@ -266,7 +277,8 @@ } TEST(ListContainerTest, SimpleIndexAccessNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); size_t size = 3; NonDerivedElement* nde_1 = list.AllocateAndConstruct<NonDerivedElement>(); @@ -282,7 +294,8 @@ } TEST(ListContainerTest, SimpleInsertionNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); size_t size = 3; NonDerivedElement* nde_1 = list.AllocateAndConstruct<NonDerivedElement>(); @@ -295,7 +308,8 @@ } TEST(ListContainerTest, SimpleInsertionAndClearNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); EXPECT_TRUE(list.empty()); EXPECT_EQ(0u, list.size()); @@ -315,7 +329,8 @@ } TEST(ListContainerTest, SimpleInsertionClearAndInsertAgainNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); EXPECT_TRUE(list.empty()); EXPECT_EQ(0u, list.size()); @@ -347,7 +362,8 @@ // for, ListContainer can still perform like normal vector. TEST(ListContainerTest, SimpleInsertionTriggerMoreThanOneAllocationNonDerivedElement) { - ListContainer<NonDerivedElement> list(sizeof(NonDerivedElement), 2); + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 2); std::vector<NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -369,7 +385,8 @@ // Constructor sets the allocation size to 2. Every time ListContainer needs // to allocate again, it doubles allocation size. In this test, 10 elements is // needed, thus ListContainerShould allocate spaces 2, 4 and 8 elements. - ListContainer<NonDerivedElement> list(sizeof(NonDerivedElement), 2); + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 2); std::vector<NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -449,7 +466,8 @@ } TEST(ListContainerTest, SimpleIterationNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); std::vector<NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -484,7 +502,8 @@ } TEST(ListContainerTest, SimpleConstIteratorIterationNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); std::vector<const NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -526,7 +545,8 @@ } TEST(ListContainerTest, SimpleReverseInsertionNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); std::vector<NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -556,7 +576,8 @@ } TEST(ListContainerTest, SimpleDeletion) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); std::vector<SimpleDerivedElement*> sde_list; int size = 10; for (int i = 0; i < size; ++i) { @@ -578,7 +599,8 @@ TEST(ListContainerTest, DeletionAllInAllocation) { const size_t kReserve = 10; - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize, + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, kReserve); std::vector<SimpleDerivedElement*> sde_list; // Add enough elements to cause another allocation. @@ -604,7 +626,8 @@ TEST(ListContainerTest, DeletionAllInAllocationReversed) { const size_t kReserve = 10; - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize, + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, kReserve); std::vector<SimpleDerivedElement*> sde_list; // Add enough elements to cause another allocation. @@ -660,7 +683,8 @@ } TEST(ListContainerTest, DeletionWhileIterating) { - ListContainer<SimpleDerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); for (int i = 0; i < 4; ++i) list.AllocateAndConstruct<SimpleDerivedElement>()->set_value(i); @@ -684,7 +708,8 @@ } TEST(ListContainerTest, InsertBeforeBegin) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); std::vector<SimpleDerivedElement*> sde_list; const int size = 4; for (int i = 0; i < size; ++i) { @@ -713,7 +738,8 @@ } TEST(ListContainerTest, InsertBeforeEnd) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); std::vector<SimpleDerivedElement*> sde_list; const int size = 4; for (int i = 0; i < size; ++i) { @@ -742,7 +768,8 @@ } TEST(ListContainerTest, InsertBeforeEmpty) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); const int count = 3; ListContainer<DerivedElement>::Iterator iter = @@ -764,7 +791,8 @@ } TEST(ListContainerTest, InsertBeforeMany) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); std::vector<SimpleDerivedElement*> sde_list; // Create a partial list of 1,...,99. int initial_list[] = { @@ -810,7 +838,8 @@ } TEST(ListContainerTest, SimpleManipulationWithIndexSimpleDerivedElement) { - ListContainer<DerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); std::vector<SimpleDerivedElement*> de_list; int size = 10; for (int i = 0; i < size; ++i) { @@ -832,7 +861,8 @@ TEST(ListContainerTest, SimpleManipulationWithIndexMoreThanOneAllocationSimpleDerivedElement) { - ListContainer<DerivedElement> list(LargestDerivedElementSize(), 2); + ListContainer<DerivedElement> list(kLargestDerivedElementAlign, + kLargestDerivedElementSize, 2); std::vector<SimpleDerivedElement*> de_list; int size = 10; for (int i = 0; i < size; ++i) { @@ -854,7 +884,8 @@ TEST(ListContainerTest, SimpleIterationAndReverseIterationWithIndexNonDerivedElement) { - ListContainer<NonDerivedElement> list; + ListContainer<NonDerivedElement> list(ALIGNOF(NonDerivedElement), + sizeof(NonDerivedElement), 0); std::vector<NonDerivedElement*> nde_list; size_t size = 10; for (size_t i = 0; i < size; ++i) { @@ -900,7 +931,8 @@ // We keep an explicit instance count to make sure that the destructors are // indeed getting called. int counter = 0; - ListContainer<InstanceCounter> list(sizeof(InstanceCounter), 1); + ListContainer<InstanceCounter> list(ALIGNOF(InstanceCounter), + sizeof(InstanceCounter), 1); EXPECT_EQ(0, counter); EXPECT_EQ(0u, list.size()); @@ -944,7 +976,7 @@ struct SmallStruct { char dummy[16]; }; - ListContainer<SmallStruct> list(sizeof(SmallStruct), 1); + ListContainer<SmallStruct> list(ALIGNOF(SmallStruct), sizeof(SmallStruct), 1); std::vector<SmallStruct*> pointers; // Utilities which keep these two lists in sync and check that their iteration @@ -990,7 +1022,8 @@ } TEST(ListContainerTest, AppendByMovingSameList) { - ListContainer<SimpleDerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); list.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberOne>(); list.AppendByMoving(list.front()); @@ -1008,8 +1041,10 @@ } TEST(ListContainerTest, AppendByMovingDoesNotDestruct) { - ListContainer<DerivedElement> list_1(kCurrentLargestDerivedElementSize); - ListContainer<DerivedElement> list_2(kCurrentLargestDerivedElementSize); + ListContainer<DerivedElement> list_1(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); + ListContainer<DerivedElement> list_2(kCurrentLargestDerivedElementAlign, + kCurrentLargestDerivedElementSize, 0); MockDerivedElement* mde_1 = list_1.AllocateAndConstruct<MockDerivedElement>(); // Make sure destructor isn't called during AppendByMoving. @@ -1021,8 +1056,10 @@ } TEST(ListContainerTest, AppendByMovingReturnsMovedPointer) { - ListContainer<SimpleDerivedElement> list_1(kCurrentLargestDerivedElementSize); - ListContainer<SimpleDerivedElement> list_2(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list_1( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); + ListContainer<SimpleDerivedElement> list_2( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); SimpleDerivedElement* simple_element = list_1.AllocateAndConstruct<SimpleDerivedElement>(); @@ -1036,9 +1073,9 @@ TEST(ListContainerTest, AppendByMovingReplacesSourceWithNewDerivedElement) { ListContainer<SimpleDerivedElementConstructMagicNumberOne> list_1( - kCurrentLargestDerivedElementSize); + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); ListContainer<SimpleDerivedElementConstructMagicNumberTwo> list_2( - kCurrentLargestDerivedElementSize); + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); list_1.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberOne>(); EXPECT_EQ(kMagicNumberToUseForSimpleDerivedElementOne, @@ -1106,7 +1143,8 @@ "LongSimpleDerivedElement should be smaller than the maximum " "DerivedElement size."); - ListContainer<SimpleDerivedElement> list(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); list.AllocateAndConstruct<LongSimpleDerivedElementConstructMagicNumber>(); list.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberOne>(); @@ -1136,9 +1174,11 @@ } TEST(ListContainerTest, Swap) { - ListContainer<SimpleDerivedElement> list_1(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list_1( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); list_1.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberOne>(); - ListContainer<SimpleDerivedElement> list_2(kCurrentLargestDerivedElementSize); + ListContainer<SimpleDerivedElement> list_2( + kCurrentLargestDerivedElementAlign, kCurrentLargestDerivedElementSize, 0); list_2.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberTwo>(); list_2.AllocateAndConstruct<SimpleDerivedElementConstructMagicNumberThree>(); @@ -1181,24 +1221,25 @@ // memory, due to the exponential growth strategy). const size_t max_waste_factor = 8; - ListContainer<DerivedElement> list(LargestDerivedElementSize(), + ListContainer<DerivedElement> list(kLargestDerivedElementAlign, + kLargestDerivedElementSize, initial_capacity); // The capacity should grow with the list. for (int i = 0; i < iterations; i++) { size_t capacity = list.GetCapacityInBytes(); - ASSERT_GE(capacity, list.size() * LargestDerivedElementSize()); + ASSERT_GE(capacity, list.size() * kLargestDerivedElementSize); ASSERT_LE(capacity, std::max(list.size(), upper_bound_on_min_capacity) * - max_waste_factor * LargestDerivedElementSize()); + max_waste_factor * kLargestDerivedElementSize); list.AllocateAndConstruct<DerivedElement1>(); } // The capacity should shrink with the list. for (int i = 0; i < iterations; i++) { size_t capacity = list.GetCapacityInBytes(); - ASSERT_GE(capacity, list.size() * LargestDerivedElementSize()); + ASSERT_GE(capacity, list.size() * kLargestDerivedElementSize); ASSERT_LE(capacity, std::max(list.size(), upper_bound_on_min_capacity) * - max_waste_factor * LargestDerivedElementSize()); + max_waste_factor * kLargestDerivedElementSize); list.RemoveLast(); } }
diff --git a/cc/base/random_access_list_container.h b/cc/base/random_access_list_container.h deleted file mode 100644 index 34eb699..0000000 --- a/cc/base/random_access_list_container.h +++ /dev/null
@@ -1,96 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CC_BASE_RANDOM_ACCESS_LIST_CONTAINER_H_ -#define CC_BASE_RANDOM_ACCESS_LIST_CONTAINER_H_ - -#include <stddef.h> - -#include <vector> - -#include "base/logging.h" -#include "cc/base/list_container_helper.h" - -namespace cc { - -// RandomAccessListContainer is a container similar to ListContainer (see -// list_container.h), but it allows random access into its elements via -// operator[]. In order to have efficient support for random access, some -// functionality is not available for RandomAccessListContainers, such as -// insert/deletes in the middle of the list. -template <class BaseElementType> -class RandomAccessListContainer { - public: - // BaseElementType is the type of raw pointers this class hands out; however, - // its derived classes might require different memory sizes. - // max_size_for_derived_class the largest memory size required for all the - // derived classes to use for allocation. - explicit RandomAccessListContainer(size_t max_size_for_derived_class) - : helper_(max_size_for_derived_class) {} - - // This constructor reserves the requested memory up front so only a single - // allocation is needed. When num_of_elements_to_reserve_for is zero, use the - // default size. - RandomAccessListContainer(size_t max_size_for_derived_class, - size_t num_of_elements_to_reserve_for) - : helper_(max_size_for_derived_class, num_of_elements_to_reserve_for) { - items_.reserve(num_of_elements_to_reserve_for); - } - - ~RandomAccessListContainer() { - for (BaseElementType* item : items_) - item->~BaseElementType(); - } - - void clear() { - for (BaseElementType* item : items_) - item->~BaseElementType(); - helper_.clear(); - items_.clear(); - } - - bool empty() const { return helper_.empty(); } - size_t size() const { return helper_.size(); } - size_t GetCapacityInBytes() const { return helper_.GetCapacityInBytes(); } - - template <typename DerivedElementType> - DerivedElementType* AllocateAndConstruct() { - auto* value = - new (helper_.Allocate(sizeof(DerivedElementType))) DerivedElementType; - items_.push_back(value); - return value; - } - - void RemoveLast() { - items_.back()->~BaseElementType(); - items_.pop_back(); - helper_.RemoveLast(); - } - - const BaseElementType* operator[](size_t index) const { - DCHECK_GE(index, 0u); - DCHECK_LT(index, items_.size()); - return items_[index]; - } - - BaseElementType* operator[](size_t index) { - DCHECK_GE(index, 0u); - DCHECK_LT(index, items_.size()); - return items_[index]; - } - - // Note that although BaseElementType objects can change, the pointer itself - // (in the vector) cannot. So this class only supports a const iterator. - using ConstIterator = typename std::vector<BaseElementType*>::const_iterator; - ConstIterator begin() const { return items_.begin(); } - ConstIterator end() const { return items_.end(); } - - private: - ListContainerHelper helper_; - std::vector<BaseElementType*> items_; -}; - -} // namespace cc - -#endif // CC_BASE_RANDOM_ACCESS_LIST_CONTAINER_H_
diff --git a/cc/base/random_access_list_container_unittest.cc b/cc/base/random_access_list_container_unittest.cc deleted file mode 100644 index c02ca78..0000000 --- a/cc/base/random_access_list_container_unittest.cc +++ /dev/null
@@ -1,109 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "cc/base/random_access_list_container.h" - -#include <stddef.h> - -#include <algorithm> -#include <vector> - -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace cc { -namespace { - -class Base { - public: - virtual ~Base() {} - int get_value() const { return value_; } - - protected: - explicit Base(int value) : value_(value) {} - - int value_; -}; - -const int kMagicNumberOne = 1; -const int kMagicNumberTwo = 2; -const int kMagicNumberThree = 3; - -class Derived1 : public Base { - public: - Derived1() : Base(kMagicNumberOne) {} -}; - -class Derived2 : public Base { - public: - Derived2() : Base(kMagicNumberTwo) {} -}; - -class Derived3 : public Base { - public: - Derived3() : Base(kMagicNumberThree) {} -}; - -size_t LargestDerivedElementSize() { - static_assert(sizeof(Derived1) >= sizeof(Derived2), - "Derived2 is larger than Derived1"); - static_assert(sizeof(Derived1) >= sizeof(Derived3), - "Derived3 is larger than Derived1"); - return sizeof(Derived1); -} - -TEST(RandomAccessListContainerTest, RandomAccess) { - RandomAccessListContainer<Base> list(LargestDerivedElementSize(), 1); - - list.AllocateAndConstruct<Derived1>(); - list.AllocateAndConstruct<Derived2>(); - list.AllocateAndConstruct<Derived3>(); - list.AllocateAndConstruct<Derived1>(); - list.AllocateAndConstruct<Derived2>(); - list.AllocateAndConstruct<Derived3>(); - - EXPECT_EQ(kMagicNumberOne, list[0]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[1]->get_value()); - EXPECT_EQ(kMagicNumberThree, list[2]->get_value()); - EXPECT_EQ(kMagicNumberOne, list[3]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[4]->get_value()); - EXPECT_EQ(kMagicNumberThree, list[5]->get_value()); - - list.RemoveLast(); - list.RemoveLast(); - list.RemoveLast(); - - EXPECT_EQ(kMagicNumberOne, list[0]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[1]->get_value()); - EXPECT_EQ(kMagicNumberThree, list[2]->get_value()); - - list.AllocateAndConstruct<Derived3>(); - list.AllocateAndConstruct<Derived2>(); - list.AllocateAndConstruct<Derived1>(); - - EXPECT_EQ(kMagicNumberOne, list[0]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[1]->get_value()); - EXPECT_EQ(kMagicNumberThree, list[2]->get_value()); - EXPECT_EQ(kMagicNumberThree, list[3]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[4]->get_value()); - EXPECT_EQ(kMagicNumberOne, list[5]->get_value()); -} - -TEST(RandomAccessListContainerTest, Clear) { - RandomAccessListContainer<Base> list(LargestDerivedElementSize(), 1); - - list.AllocateAndConstruct<Derived1>(); - list.AllocateAndConstruct<Derived2>(); - - EXPECT_EQ(kMagicNumberOne, list[0]->get_value()); - EXPECT_EQ(kMagicNumberTwo, list[1]->get_value()); - - list.clear(); - list.AllocateAndConstruct<Derived3>(); - - EXPECT_EQ(kMagicNumberThree, list[0]->get_value()); -} - -} // namespace -} // namespace cc
diff --git a/cc/quads/largest_draw_quad.cc b/cc/quads/largest_draw_quad.cc index 68221da1..de99f54 100644 --- a/cc/quads/largest_draw_quad.cc +++ b/cc/quads/largest_draw_quad.cc
@@ -19,28 +19,53 @@ #include "cc/quads/yuv_video_draw_quad.h" namespace { + template <typename...> struct MaxSize {}; template <class T, class... Args> struct MaxSize<T, Args...> { - static const size_t value = sizeof(T) > MaxSize<Args...>::value - ? sizeof(T) - : MaxSize<Args...>::value; + static constexpr size_t value = sizeof(T) > MaxSize<Args...>::value + ? sizeof(T) + : MaxSize<Args...>::value; }; template <> struct MaxSize<> { - static const size_t value = 0; + static constexpr size_t value = 0; }; -const size_t kLargestDrawQuadSize = MaxSize<cc::DebugBorderDrawQuad, - cc::PictureDrawQuad, - cc::RenderPassDrawQuad, - cc::SolidColorDrawQuad, - cc::StreamVideoDrawQuad, - cc::SurfaceDrawQuad, - cc::TextureDrawQuad, - cc::TileDrawQuad, - cc::YUVVideoDrawQuad>::value; +constexpr size_t kLargestDrawQuadSize = MaxSize<cc::DebugBorderDrawQuad, + cc::PictureDrawQuad, + cc::RenderPassDrawQuad, + cc::SolidColorDrawQuad, + cc::StreamVideoDrawQuad, + cc::SurfaceDrawQuad, + cc::TextureDrawQuad, + cc::TileDrawQuad, + cc::YUVVideoDrawQuad>::value; + +template <typename...> +struct MaxAlign {}; +template <class T, class... Args> +struct MaxAlign<T, Args...> { + static constexpr size_t value = ALIGNOF(T) > MaxAlign<Args...>::value + ? ALIGNOF(T) + : MaxAlign<Args...>::value; +}; +template <> +struct MaxAlign<> { + static constexpr size_t value = 0; +}; + +constexpr size_t kLargestDrawQuadAlignment = + MaxAlign<cc::DebugBorderDrawQuad, + cc::PictureDrawQuad, + cc::RenderPassDrawQuad, + cc::SolidColorDrawQuad, + cc::StreamVideoDrawQuad, + cc::SurfaceDrawQuad, + cc::TextureDrawQuad, + cc::TileDrawQuad, + cc::YUVVideoDrawQuad>::value; } // namespace @@ -50,4 +75,8 @@ return kLargestDrawQuadSize; } +size_t LargestDrawQuadAlignment() { + return kLargestDrawQuadAlignment; +} + } // namespace cc
diff --git a/cc/quads/largest_draw_quad.h b/cc/quads/largest_draw_quad.h index aefbd5e..9069a332 100644 --- a/cc/quads/largest_draw_quad.h +++ b/cc/quads/largest_draw_quad.h
@@ -12,6 +12,7 @@ namespace cc { CC_EXPORT size_t LargestDrawQuadSize(); +CC_EXPORT size_t LargestDrawQuadAlignment(); } // namespace cc
diff --git a/cc/quads/render_pass.cc b/cc/quads/render_pass.cc index 3ad5fb0..de49a22 100644 --- a/cc/quads/render_pass.cc +++ b/cc/quads/render_pass.cc
@@ -37,12 +37,14 @@ namespace cc { QuadList::QuadList() - : ListContainer<DrawQuad>(LargestDrawQuadSize(), + : ListContainer<DrawQuad>(LargestDrawQuadAlignment(), + LargestDrawQuadSize(), kDefaultNumSharedQuadStatesToReserve) {} QuadList::QuadList(size_t default_size_to_reserve) - : ListContainer<DrawQuad>(LargestDrawQuadSize(), default_size_to_reserve) { -} + : ListContainer<DrawQuad>(LargestDrawQuadAlignment(), + LargestDrawQuadSize(), + default_size_to_reserve) {} std::unique_ptr<RenderPass> RenderPass::Create() { return base::WrapUnique(new RenderPass()); @@ -61,7 +63,8 @@ RenderPass::RenderPass() : quad_list(kDefaultNumQuadsToReserve), - shared_quad_state_list(sizeof(SharedQuadState), + shared_quad_state_list(ALIGNOF(SharedQuadState), + sizeof(SharedQuadState), kDefaultNumSharedQuadStatesToReserve) {} // Each layer usually produces one shared quad state, so the number of layers @@ -69,16 +72,17 @@ RenderPass::RenderPass(size_t num_layers) : has_transparent_background(true), quad_list(kDefaultNumQuadsToReserve), - shared_quad_state_list(sizeof(SharedQuadState), num_layers) { -} + shared_quad_state_list(ALIGNOF(SharedQuadState), + sizeof(SharedQuadState), + num_layers) {} RenderPass::RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size) : has_transparent_background(true), quad_list(quad_list_size), - shared_quad_state_list(sizeof(SharedQuadState), - shared_quad_state_list_size) { -} + shared_quad_state_list(ALIGNOF(SharedQuadState), + sizeof(SharedQuadState), + shared_quad_state_list_size) {} RenderPass::~RenderPass() { TRACE_EVENT_OBJECT_DELETED_WITH_ID(
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc index 896536f..0a9684d 100644 --- a/cc/surfaces/compositor_frame_sink_support.cc +++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -97,7 +97,7 @@ begin_frame_source_->DidFinishFrame(this, ack); } -void CompositorFrameSinkSupport::SubmitCompositorFrame( +bool CompositorFrameSinkSupport::SubmitCompositorFrame( const LocalSurfaceId& local_surface_id, CompositorFrame frame) { TRACE_EVENT0("cc", "CompositorFrameSinkSupport::SubmitCompositorFrame"); @@ -131,16 +131,36 @@ if (!create_new_surface) { surface = std::move(current_surface_); } else { - surface = CreateSurface(local_surface_id); + SurfaceId surface_id(frame_sink_id_, local_surface_id); + gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); + float device_scale_factor = frame.metadata.device_scale_factor; + SurfaceInfo surface_info(surface_id, device_scale_factor, frame_size); + + if (!surface_info.is_valid()) { + TRACE_EVENT_INSTANT0("cc", "Invalid SurfaceInfo", + TRACE_EVENT_SCOPE_THREAD); + if (current_surface_) + DestroyCurrentSurface(); + ReturnedResourceArray resources; + TransferableResource::ReturnResources(frame.resource_list, &resources); + ReturnResources(resources); + DidReceiveCompositorFrameAck(); + return true; + } + + surface = CreateSurface(surface_info); } - surface->QueueFrame( + bool result = surface->QueueFrame( std::move(frame), base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, weak_factory_.GetWeakPtr()), base::BindRepeating(&CompositorFrameSinkSupport::WillDrawSurface, weak_factory_.GetWeakPtr())); + if (!result) + return false; + if (current_surface_) { surface->SetPreviousFrameSurface(current_surface_.get()); DestroyCurrentSurface(); @@ -154,6 +174,8 @@ // See https://crbug.com/703079. if (begin_frame_source_) begin_frame_source_->DidFinishFrame(this, ack); + + return true; } void CompositorFrameSinkSupport::UpdateSurfaceReferences( @@ -331,11 +353,10 @@ } std::unique_ptr<Surface> CompositorFrameSinkSupport::CreateSurface( - const LocalSurfaceId& local_surface_id) { + const SurfaceInfo& surface_info) { seen_first_frame_activation_ = false; - std::unique_ptr<Surface> surface = surface_manager_->CreateSurface( - weak_factory_.GetWeakPtr(), local_surface_id); - return surface; + return surface_manager_->CreateSurface(weak_factory_.GetWeakPtr(), + surface_info); } void CompositorFrameSinkSupport::DestroyCurrentSurface() {
diff --git a/cc/surfaces/compositor_frame_sink_support.h b/cc/surfaces/compositor_frame_sink_support.h index f3440e1b..ed2c154 100644 --- a/cc/surfaces/compositor_frame_sink_support.h +++ b/cc/surfaces/compositor_frame_sink_support.h
@@ -15,7 +15,7 @@ #include "cc/scheduler/begin_frame_source.h" #include "cc/surfaces/frame_sink_manager_client.h" #include "cc/surfaces/referenced_surface_tracker.h" -#include "cc/surfaces/surface_id.h" +#include "cc/surfaces/surface_info.h" #include "cc/surfaces/surface_resource_holder.h" #include "cc/surfaces/surface_resource_holder_client.h" #include "cc/surfaces/surfaces_export.h" @@ -60,7 +60,7 @@ void EvictCurrentSurface(); void SetNeedsBeginFrame(bool needs_begin_frame); void DidNotProduceFrame(const BeginFrameAck& ack); - void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, + bool SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, CompositorFrame frame); void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request); void ClaimTemporaryReference(const SurfaceId& surface_id); @@ -105,8 +105,7 @@ void OnBeginFrameSourcePausedChanged(bool paused) override; void UpdateNeedsBeginFramesInternal(); - std::unique_ptr<Surface> CreateSurface( - const LocalSurfaceId& local_surface_id); + std::unique_ptr<Surface> CreateSurface(const SurfaceInfo& surface_info); void DestroyCurrentSurface(); CompositorFrameSinkSupportClient* const client_;
diff --git a/cc/surfaces/compositor_frame_sink_support_unittest.cc b/cc/surfaces/compositor_frame_sink_support_unittest.cc index d39b9e2..b16d8fa2 100644 --- a/cc/surfaces/compositor_frame_sink_support_unittest.cc +++ b/cc/surfaces/compositor_frame_sink_support_unittest.cc
@@ -673,9 +673,7 @@ manager_.RegisterFrameSinkId(kAnotherArbitraryFrameSinkId); // Give id2 a frame that references local_surface_id_. { - std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); CompositorFrame frame = MakeCompositorFrame(); - frame.render_pass_list.push_back(std::move(render_pass)); frame.metadata.referenced_surfaces.push_back( SurfaceId(support_->frame_sink_id(), local_surface_id_)); support2->SubmitCompositorFrame(local_surface_id2, std::move(frame)); @@ -686,9 +684,7 @@ support2->EvictCurrentSurface(); // Give local_surface_id_ a frame that references id2. { - std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); CompositorFrame frame = MakeCompositorFrame(); - frame.render_pass_list.push_back(std::move(render_pass)); frame.metadata.referenced_surfaces.push_back(id2); support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); } @@ -717,9 +713,7 @@ TEST_F(CompositorFrameSinkSupportTest, DuplicateCopyRequest) { { - std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); CompositorFrame frame = MakeCompositorFrame(); - frame.render_pass_list.push_back(std::move(render_pass)); frame.metadata.referenced_surfaces.push_back( SurfaceId(support_->frame_sink_id(), local_surface_id_)); support_->SubmitCompositorFrame(local_surface_id_, std::move(frame));
diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc index f214463c..da704c51 100644 --- a/cc/surfaces/direct_compositor_frame_sink.cc +++ b/cc/surfaces/direct_compositor_frame_sink.cc
@@ -99,15 +99,17 @@ frame.metadata.begin_frame_ack.sequence_number); gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); - if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) { - delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId(); + if (!local_surface_id_.is_valid() || frame_size != last_swap_frame_size_ || + frame.metadata.device_scale_factor != device_scale_factor_) { + local_surface_id_ = local_surface_id_allocator_.GenerateId(); last_swap_frame_size_ = frame_size; + device_scale_factor_ = frame.metadata.device_scale_factor; + display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor_); } - display_->SetLocalSurfaceId(delegated_local_surface_id_, - frame.metadata.device_scale_factor); - support_->SubmitCompositorFrame(delegated_local_surface_id_, - std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); + DCHECK(result); } void DirectCompositorFrameSink::DidNotProduceFrame(const BeginFrameAck& ack) {
diff --git a/cc/surfaces/direct_compositor_frame_sink.h b/cc/surfaces/direct_compositor_frame_sink.h index e1a4e23..24480cb 100644 --- a/cc/surfaces/direct_compositor_frame_sink.h +++ b/cc/surfaces/direct_compositor_frame_sink.h
@@ -76,11 +76,12 @@ base::ThreadChecker thread_checker_; const FrameSinkId frame_sink_id_; - LocalSurfaceId delegated_local_surface_id_; + LocalSurfaceId local_surface_id_; SurfaceManager* surface_manager_; LocalSurfaceIdAllocator local_surface_id_allocator_; Display* display_; gfx::Size last_swap_frame_size_; + float device_scale_factor_ = 1.f; bool is_lost_ = false; std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_;
diff --git a/cc/surfaces/direct_compositor_frame_sink_unittest.cc b/cc/surfaces/direct_compositor_frame_sink_unittest.cc index 2610fc2..9fefc296 100644 --- a/cc/surfaces/direct_compositor_frame_sink_unittest.cc +++ b/cc/surfaces/direct_compositor_frame_sink_unittest.cc
@@ -17,6 +17,7 @@ #include "cc/surfaces/local_surface_id_allocator.h" #include "cc/surfaces/surface_manager.h" #include "cc/test/begin_frame_args_test.h" +#include "cc/test/compositor_frame_helpers.h" #include "cc/test/fake_compositor_frame_sink_client.h" #include "cc/test/fake_output_surface.h" #include "cc/test/ordered_simple_task_runner.h" @@ -108,7 +109,7 @@ std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); render_pass->SetNew(1, display_rect_, damage_rect, gfx::Transform()); - CompositorFrame frame; + CompositorFrame frame = test::MakeEmptyCompositorFrame(); frame.metadata.begin_frame_ack = BeginFrameAck(0, 1, 1, true); frame.render_pass_list.push_back(std::move(render_pass));
diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc index a7526b00..2966addd 100644 --- a/cc/surfaces/display_unittest.cc +++ b/cc/surfaces/display_unittest.cc
@@ -207,7 +207,6 @@ EXPECT_EQ(gfx::Size(100, 100), software_output_device_->viewport_pixel_size()); EXPECT_EQ(gfx::Rect(0, 0, 100, 100), software_output_device_->damage_rect()); - { // Only damaged portion should be swapped. pass = RenderPass::Create(); @@ -261,6 +260,9 @@ pass->damage_rect = gfx::Rect(10, 10, 10, 10); pass->id = 1; + local_surface_id = id_allocator_.GenerateId(); + display_->SetLocalSurfaceId(local_surface_id, 1.f); + pass_list.push_back(std::move(pass)); scheduler_->ResetDamageForTest(); SubmitCompositorFrame(&pass_list, local_surface_id); @@ -281,6 +283,9 @@ pass->damage_rect = gfx::Rect(10, 10, 0, 0); pass->id = 1; + local_surface_id = id_allocator_.GenerateId(); + display_->SetLocalSurfaceId(local_surface_id, 1.f); + pass_list.push_back(std::move(pass)); scheduler_->ResetDamageForTest(); SubmitCompositorFrame(&pass_list, local_surface_id); @@ -348,6 +353,8 @@ // Resize should cause a swap if no frame was swapped at the previous size. { + local_surface_id = id_allocator_.GenerateId(); + display_->SetLocalSurfaceId(local_surface_id, 1.f); scheduler_->swapped = false; display_->Resize(gfx::Size(200, 200)); EXPECT_FALSE(scheduler_->swapped); @@ -379,6 +386,8 @@ } { + local_surface_id = id_allocator_.GenerateId(); + display_->SetLocalSurfaceId(local_surface_id, 1.0f); // Surface that's damaged completely should be resized and swapped. pass = RenderPass::Create(); pass->output_rect = gfx::Rect(0, 0, 99, 99); @@ -410,7 +419,8 @@ }; TEST_F(DisplayTest, Finish) { - LocalSurfaceId local_surface_id(id_allocator_.GenerateId()); + LocalSurfaceId local_surface_id1(id_allocator_.GenerateId()); + LocalSurfaceId local_surface_id2(id_allocator_.GenerateId()); RendererSettings settings; settings.partial_swap_enabled = true; @@ -425,7 +435,7 @@ StubDisplayClient client; display_->Initialize(&client, &manager_); - display_->SetLocalSurfaceId(local_surface_id, 1.f); + display_->SetLocalSurfaceId(local_surface_id1, 1.f); display_->Resize(gfx::Size(100, 100)); @@ -437,7 +447,7 @@ pass->id = 1; pass_list.push_back(std::move(pass)); - SubmitCompositorFrame(&pass_list, local_surface_id); + SubmitCompositorFrame(&pass_list, local_surface_id1); } display_->DrawAndSwap(); @@ -451,6 +461,7 @@ // Another resize without a swap doesn't need to finish. EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()).Times(0); + display_->SetLocalSurfaceId(local_surface_id2, 1.f); display_->Resize(gfx::Size(200, 200)); testing::Mock::VerifyAndClearExpectations(context_ptr); @@ -463,7 +474,7 @@ pass->id = 1; pass_list.push_back(std::move(pass)); - SubmitCompositorFrame(&pass_list, local_surface_id); + SubmitCompositorFrame(&pass_list, local_surface_id2); } display_->DrawAndSwap();
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc index 00de0c2..e7164c9a 100644 --- a/cc/surfaces/surface.cc +++ b/cc/surfaces/surface.cc
@@ -24,10 +24,10 @@ static const int kFrameIndexStart = 2; Surface::Surface( - const SurfaceId& id, + const SurfaceInfo& surface_info, base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support) - : surface_id_(id), - previous_frame_surface_id_(id), + : surface_info_(surface_info), + previous_frame_surface_id_(surface_info.id()), compositor_frame_sink_support_(std::move(compositor_frame_sink_support)), surface_manager_(compositor_frame_sink_support_->surface_manager()), frame_index_(kFrameIndexStart), @@ -55,9 +55,19 @@ closed_ = true; } -void Surface::QueueFrame(CompositorFrame frame, +bool Surface::QueueFrame(CompositorFrame frame, const base::Closure& callback, const WillDrawCallback& will_draw_callback) { + gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); + float device_scale_factor = frame.metadata.device_scale_factor; + + if (frame_size != surface_info_.size_in_pixels() || + device_scale_factor != surface_info_.device_scale_factor()) { + TRACE_EVENT_INSTANT0("cc", "Surface invariants violation", + TRACE_EVENT_SCOPE_THREAD); + return false; + } + if (closed_) { if (compositor_frame_sink_support_) { ReturnedResourceArray resources; @@ -65,7 +75,7 @@ compositor_frame_sink_support_->ReturnResources(resources); } callback.Run(); - return; + return true; } TakeLatencyInfoFromPendingFrame(&frame.metadata.latency_info); @@ -114,6 +124,8 @@ // Returns resources for the previous pending frame. UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data)); + + return true; } void Surface::RequestCopyOfOutput( @@ -307,7 +319,7 @@ if (!active_frame_data_ || active_frame_data_->will_draw_callback.is_null()) return; - active_frame_data_->will_draw_callback.Run(surface_id_.local_surface_id(), + active_frame_data_->will_draw_callback.Run(surface_id().local_surface_id(), damage_rect); }
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h index 2e09968..56e1403b 100644 --- a/cc/surfaces/surface.h +++ b/cc/surfaces/surface.h
@@ -21,7 +21,7 @@ #include "cc/output/copy_output_request.h" #include "cc/surfaces/compositor_frame_sink_support.h" #include "cc/surfaces/frame_sink_id.h" -#include "cc/surfaces/surface_id.h" +#include "cc/surfaces/surface_info.h" #include "cc/surfaces/surface_sequence.h" #include "cc/surfaces/surfaces_export.h" #include "ui/gfx/geometry/size.h" @@ -41,23 +41,24 @@ base::RepeatingCallback<void(const LocalSurfaceId&, const gfx::Rect&)>; Surface( - const SurfaceId& id, + const SurfaceInfo& surface_info, base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support); ~Surface(); - const SurfaceId& surface_id() const { return surface_id_; } + const SurfaceId& surface_id() const { return surface_info_.id(); } const SurfaceId& previous_frame_surface_id() const { return previous_frame_surface_id_; } void SetPreviousFrameSurface(Surface* surface); + // Returns false if |frame| is invalid. // |draw_callback| is called once to notify the client that the previously // submitted CompositorFrame is processed and that another frame can be // submitted. // |will_draw_callback| is called when |surface| is scheduled for a draw and // there is visible damage. - void QueueFrame(CompositorFrame frame, + bool QueueFrame(CompositorFrame frame, const base::Closure& draw_callback, const WillDrawCallback& will_draw_callback); void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request); @@ -156,7 +157,7 @@ CompositorFrame* frame, std::vector<ui::LatencyInfo>* latency_info); - const SurfaceId surface_id_; + SurfaceInfo surface_info_; SurfaceId previous_frame_surface_id_; base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support_; SurfaceManager* const surface_manager_;
diff --git a/cc/surfaces/surface_aggregator_perftest.cc b/cc/surfaces/surface_aggregator_perftest.cc index d0c2ed4f..ac7fb4b5 100644 --- a/cc/surfaces/surface_aggregator_perftest.cc +++ b/cc/surfaces/surface_aggregator_perftest.cc
@@ -10,6 +10,7 @@ #include "cc/surfaces/compositor_frame_sink_support.h" #include "cc/surfaces/surface_aggregator.h" #include "cc/surfaces/surface_manager.h" +#include "cc/test/compositor_frame_helpers.h" #include "cc/test/fake_output_surface_client.h" #include "cc/test/fake_resource_provider.h" #include "cc/test/test_context_provider.h" @@ -27,14 +28,6 @@ const base::UnguessableToken kArbitraryToken = base::UnguessableToken::Create(); -CompositorFrame MakeCompositorFrame() { - CompositorFrame frame; - frame.metadata.begin_frame_ack.source_id = BeginFrameArgs::kManualSourceId; - frame.metadata.begin_frame_ack.sequence_number = - BeginFrameArgs::kStartingFrameNumber; - return frame; -} - class SurfaceAggregatorPerfTest : public testing::Test { public: SurfaceAggregatorPerfTest() { @@ -63,8 +56,11 @@ optimize_damage)); for (int i = 0; i < num_surfaces; i++) { LocalSurfaceId local_surface_id(i + 1, kArbitraryToken); + std::unique_ptr<RenderPass> pass(RenderPass::Create()); - CompositorFrame frame = MakeCompositorFrame(); + pass->output_rect = gfx::Rect(0, 0, 1, 2); + + CompositorFrame frame = test::MakeEmptyCompositorFrame(); SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); for (int j = 0; j < num_textures; j++) { @@ -116,7 +112,7 @@ timer_.Reset(); do { std::unique_ptr<RenderPass> pass(RenderPass::Create()); - CompositorFrame frame = MakeCompositorFrame(); + CompositorFrame frame = test::MakeEmptyCompositorFrame(); SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); SurfaceDrawQuad* surface_quad = @@ -127,6 +123,8 @@ LocalSurfaceId(num_surfaces, kArbitraryToken)), SurfaceDrawQuadType::PRIMARY, nullptr); + pass->output_rect = gfx::Rect(0, 0, 100, 100); + if (full_damage) pass->damage_rect = gfx::Rect(0, 0, 100, 100); else
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc index 7ab54787..0ba3a14 100644 --- a/cc/surfaces/surface_aggregator_unittest.cc +++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -1107,8 +1107,6 @@ SurfaceId grandchild_surface_id(grandchild_support->frame_sink_id(), grandchild_local_surface_id); - grandchild_support->SubmitCompositorFrame(grandchild_local_surface_id, - test::MakeCompositorFrame()); std::unique_ptr<RenderPass> grandchild_pass = RenderPass::Create(); gfx::Rect output_rect(SurfaceSize()); gfx::Rect damage_rect(SurfaceSize()); @@ -1123,8 +1121,6 @@ LocalSurfaceId child_one_local_surface_id = allocator_.GenerateId(); SurfaceId child_one_surface_id(child_one_support->frame_sink_id(), child_one_local_surface_id); - child_one_support->SubmitCompositorFrame(child_one_local_surface_id, - test::MakeCompositorFrame()); std::unique_ptr<RenderPass> child_one_pass = RenderPass::Create(); child_one_pass->SetNew(pass_id, output_rect, damage_rect, @@ -1145,8 +1141,6 @@ LocalSurfaceId child_two_local_surface_id = allocator_.GenerateId(); SurfaceId child_two_surface_id(child_two_support->frame_sink_id(), child_two_local_surface_id); - child_two_support->SubmitCompositorFrame(child_two_local_surface_id, - test::MakeCompositorFrame()); std::unique_ptr<RenderPass> child_two_pass = RenderPass::Create(); child_two_pass->SetNew(pass_id, output_rect, damage_rect, @@ -1959,7 +1953,7 @@ SurfaceId surface_id) { CompositorFrame frame = test::MakeEmptyCompositorFrame(); std::unique_ptr<RenderPass> pass = RenderPass::Create(); - pass->id = 1; + pass->SetNew(1, gfx::Rect(0, 0, 20, 20), gfx::Rect(), gfx::Transform()); SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); sqs->opacity = 1.f; if (child_id.is_valid()) { @@ -2041,16 +2035,13 @@ LocalSurfaceId local_surface_id(7u, base::UnguessableToken::Create()); SurfaceId surface_id(support->frame_sink_id(), local_surface_id); - CompositorFrame frame = test::MakeEmptyCompositorFrame(); - std::unique_ptr<RenderPass> pass = RenderPass::Create(); - pass->id = 1; + CompositorFrame frame = test::MakeCompositorFrame(); TransferableResource resource; resource.id = 11; // ResourceProvider is software but resource is not, so it should be // ignored. resource.is_software = false; frame.resource_list.push_back(resource); - frame.render_pass_list.push_back(std::move(pass)); support->SubmitCompositorFrame(local_surface_id, std::move(frame)); CompositorFrame returned_frame = aggregator_->Aggregate(surface_id); @@ -2202,7 +2193,7 @@ { std::unique_ptr<RenderPass> pass = RenderPass::Create(); - pass->id = 1; + pass->SetNew(1, gfx::Rect(0, 0, 20, 20), gfx::Rect(), gfx::Transform()); SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); sqs->opacity = 1.f; SurfaceDrawQuad* surface_quad =
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc index 0eb2b21..9875d04 100644 --- a/cc/surfaces/surface_manager.cc +++ b/cc/surfaces/surface_manager.cc
@@ -76,19 +76,19 @@ std::unique_ptr<Surface> SurfaceManager::CreateSurface( base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, - const LocalSurfaceId& local_surface_id) { + const SurfaceInfo& surface_info) { DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(local_surface_id.is_valid() && compositor_frame_sink_support); - - SurfaceId surface_id(compositor_frame_sink_support->frame_sink_id(), - local_surface_id); + DCHECK(surface_info.is_valid()); + DCHECK(compositor_frame_sink_support); + DCHECK_EQ(surface_info.id().frame_sink_id(), + compositor_frame_sink_support->frame_sink_id()); // If no surface with this SurfaceId exists, simply create the surface and // return. - auto surface_iter = surface_map_.find(surface_id); + auto surface_iter = surface_map_.find(surface_info.id()); if (surface_iter == surface_map_.end()) { auto surface = - base::MakeUnique<Surface>(surface_id, compositor_frame_sink_support); + base::MakeUnique<Surface>(surface_info, compositor_frame_sink_support); surface_map_[surface->surface_id()] = surface.get(); return surface; } @@ -103,8 +103,8 @@ // the queue and reuse it. auto it = std::find_if(surfaces_to_destroy_.begin(), surfaces_to_destroy_.end(), - [&surface_id](const std::unique_ptr<Surface>& surface) { - return surface->surface_id() == surface_id; + [&surface_info](const std::unique_ptr<Surface>& surface) { + return surface->surface_id() == surface_info.id(); }); DCHECK(it != surfaces_to_destroy_.end()); std::unique_ptr<Surface> surface = std::move(*it);
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h index 293f4c8..d8fedaf 100644 --- a/cc/surfaces/surface_manager.h +++ b/cc/surfaces/surface_manager.h
@@ -69,7 +69,7 @@ std::unique_ptr<Surface> CreateSurface( base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, - const LocalSurfaceId& local_surface_id); + const SurfaceInfo& surface_info); // Destroy the Surface once a set of sequence numbers has been satisfied. void DestroySurface(std::unique_ptr<Surface> surface);
diff --git a/cc/surfaces/surface_unittest.cc b/cc/surfaces/surface_unittest.cc index c63c0b03..beeebfc 100644 --- a/cc/surfaces/surface_unittest.cc +++ b/cc/surfaces/surface_unittest.cc
@@ -66,7 +66,6 @@ LocalSurfaceId local_surface_id(6, base::UnguessableToken::Create()); SurfaceId surface_id(kArbitraryFrameSinkId, local_surface_id); CompositorFrame frame = test::MakeCompositorFrame(); - frame.render_pass_list.push_back(RenderPass::Create()); support->SubmitCompositorFrame(local_surface_id, std::move(frame)); Surface* surface = manager.GetSurfaceForId(surface_id); ASSERT_TRUE(!!surface); @@ -79,13 +78,15 @@ int max_frame = 3, start_id = 200; for (int i = 0; i < max_frame; ++i) { - CompositorFrame frame = test::MakeCompositorFrame(); + CompositorFrame frame = test::MakeEmptyCompositorFrame(); frame.render_pass_list.push_back(RenderPass::Create()); frame.render_pass_list.back()->id = i * 3 + start_id; frame.render_pass_list.push_back(RenderPass::Create()); frame.render_pass_list.back()->id = i * 3 + start_id + 1; frame.render_pass_list.push_back(RenderPass::Create()); - frame.render_pass_list.back()->id = i * 3 + start_id + 2; + frame.render_pass_list.back()->SetNew(i * 3 + start_id + 2, + gfx::Rect(0, 0, 20, 20), gfx::Rect(), + gfx::Transform()); support->SubmitCompositorFrame(local_surface_id, std::move(frame)); }
diff --git a/cc/test/compositor_frame_helpers.cc b/cc/test/compositor_frame_helpers.cc index 33e0ed63..73451ab 100644 --- a/cc/test/compositor_frame_helpers.cc +++ b/cc/test/compositor_frame_helpers.cc
@@ -22,6 +22,7 @@ frame.metadata.begin_frame_ack.source_id = BeginFrameArgs::kManualSourceId; frame.metadata.begin_frame_ack.sequence_number = BeginFrameArgs::kStartingFrameNumber; + frame.metadata.begin_frame_ack.has_damage = true; frame.metadata.device_scale_factor = 1; return frame; }
diff --git a/cc/test/test_compositor_frame_sink.cc b/cc/test/test_compositor_frame_sink.cc index 32d4a816..440b5d5 100644 --- a/cc/test/test_compositor_frame_sink.cc +++ b/cc/test/test_compositor_frame_sink.cc
@@ -132,17 +132,20 @@ frame.metadata.begin_frame_ack.sequence_number); test_client_->DisplayReceivedCompositorFrame(frame); - if (!delegated_local_surface_id_.is_valid()) { - delegated_local_surface_id_ = local_surface_id_allocator_->GenerateId(); - } - display_->SetLocalSurfaceId(delegated_local_surface_id_, - frame.metadata.device_scale_factor); - gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); - display_->Resize(frame_size); + float device_scale_factor = frame.metadata.device_scale_factor; + if (!local_surface_id_.is_valid() || frame_size != display_size_ || + device_scale_factor != device_scale_factor_) { + local_surface_id_ = local_surface_id_allocator_->GenerateId(); + display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor); + display_->Resize(frame_size); + display_size_ = frame_size; + device_scale_factor_ = device_scale_factor; + } - support_->SubmitCompositorFrame(delegated_local_surface_id_, - std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); + DCHECK(result); for (std::unique_ptr<CopyOutputRequest>& copy_request : copy_requests_) { support_->RequestCopyOfSurface(std::move(copy_request));
diff --git a/cc/test/test_compositor_frame_sink.h b/cc/test/test_compositor_frame_sink.h index b26ee11..0440111 100644 --- a/cc/test/test_compositor_frame_sink.h +++ b/cc/test/test_compositor_frame_sink.h
@@ -112,7 +112,9 @@ // CompositorFrameSink is owned/destroyed on the compositor thread. std::unique_ptr<SurfaceManager> surface_manager_; std::unique_ptr<LocalSurfaceIdAllocator> local_surface_id_allocator_; - LocalSurfaceId delegated_local_surface_id_; + LocalSurfaceId local_surface_id_; + gfx::Size display_size_; + float device_scale_factor_ = 0; // Uses surface_manager_. std::unique_ptr<CompositorFrameSinkSupport> support_;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java index b89df8ff..30ab1b09a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.omnibox.geo; import android.Manifest; -import android.Manifest.permission; import android.annotation.TargetApi; import android.content.Context; import android.content.pm.PackageManager; @@ -43,7 +42,7 @@ /** * Util methods for platform networking APIs. */ -public class PlatformNetworksManager { +class PlatformNetworksManager { @VisibleForTesting static TimeProvider sTimeProvider = new TimeProvider(); @@ -258,7 +257,7 @@ * not connected. This should only be true when performing a background non-synchronous * call, since including not connected networks can degrade latency. */ - public static VisibleNetworks computeVisibleNetworks( + static VisibleNetworks computeVisibleNetworks( Context context, boolean includeAllVisibleNotConnectedNetworks) { WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService( Context.WIFI_SERVICE); @@ -312,18 +311,18 @@ * Wrapper around static time providers that allows us to mock the implementation in * tests. */ - public static class TimeProvider { + static class TimeProvider { /** * Get current time in milliseconds. */ - public long getCurrentTime() { + long getCurrentTime() { return System.currentTimeMillis(); } /** * Get elapsed real time in milliseconds. */ - public long getElapsedRealtime() { + long getElapsedRealtime() { return SystemClock.elapsedRealtime(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworks.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworks.java index 517d3f8e1..c6a94c4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworks.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworks.java
@@ -18,7 +18,7 @@ /** * Visible networks. Stores the data of connected and visible networks. */ -public class VisibleNetworks { +class VisibleNetworks { private static final String TAG = "VisibleNetworks"; @Nullable @@ -39,7 +39,7 @@ mAllVisibleCells = allVisibleCells; } - public static VisibleNetworks create(@Nullable VisibleWifi connectedWifi, + static VisibleNetworks create(@Nullable VisibleWifi connectedWifi, @Nullable VisibleCell connectedCell, @Nullable Set<VisibleWifi> allVisibleWifis, @Nullable Set<VisibleCell> allVisibleCells) { return new VisibleNetworks(connectedWifi, connectedCell, allVisibleWifis, allVisibleCells); @@ -49,7 +49,7 @@ * Returns the connected {@link VisibleWifi} or null if the connected wifi is unknown. */ @Nullable - public VisibleWifi connectedWifi() { + VisibleWifi connectedWifi() { return mConnectedWifi; } @@ -57,7 +57,7 @@ * Returns the connected {@link VisibleCell} or null if the connected cell is unknown. */ @Nullable - public VisibleCell connectedCell() { + VisibleCell connectedCell() { return mConnectedCell; } @@ -66,7 +66,7 @@ * networks), or null if the set is unknown. */ @Nullable - public Set<VisibleWifi> allVisibleWifis() { + Set<VisibleWifi> allVisibleWifis() { return mAllVisibleWifis; } @@ -75,14 +75,14 @@ * networks), or null if the set is unknown. */ @Nullable - public Set<VisibleCell> allVisibleCells() { + Set<VisibleCell> allVisibleCells() { return mAllVisibleCells; } /** * Returns whether this object is empty, meaning there is no visible networks at all. */ - public final boolean isEmpty() { + final boolean isEmpty() { Set<VisibleWifi> allVisibleWifis = allVisibleWifis(); Set<VisibleCell> allVisibleCells = allVisibleCells(); return connectedWifi() == null && connectedCell() == null @@ -124,8 +124,8 @@ /** * Specification of a visible wifi. */ - public static class VisibleWifi { - public static final VisibleWifi NO_WIFI_INFO = VisibleWifi.create(null, null, null, null); + static class VisibleWifi { + static final VisibleWifi NO_WIFI_INFO = VisibleWifi.create(null, null, null, null); @Nullable private final String mSsid; @@ -144,7 +144,7 @@ mTimestampMs = timestampMs; } - public static VisibleWifi create(@Nullable String ssid, @Nullable String bssid, + static VisibleWifi create(@Nullable String ssid, @Nullable String bssid, @Nullable Integer level, @Nullable Long timestampMs) { return new VisibleWifi(ssid, bssid, level, timestampMs); } @@ -153,7 +153,7 @@ * Returns the SSID of the visible Wifi, or null if unknown. */ @Nullable - public String ssid() { + String ssid() { return mSsid; } @@ -161,7 +161,7 @@ * Returns the BSSID of the visible Wifi, or null if unknown. */ @Nullable - public String bssid() { + String bssid() { return mBssid; } @@ -169,7 +169,7 @@ * Returns the signal level in dBm (RSSI), {@code null} if unknown. */ @Nullable - public Integer level() { + Integer level() { return mLevel; } @@ -177,7 +177,7 @@ * Returns the timestamp in Ms, {@code null} if unknown. */ @Nullable - public Long timestampMs() { + Long timestampMs() { return mTimestampMs; } @@ -206,7 +206,7 @@ * Encodes a VisibleWifi into its corresponding PartnerLocationDescriptor.VisibleNetwork * proto. */ - public PartnerLocationDescriptor.VisibleNetwork toProto(boolean connected) { + PartnerLocationDescriptor.VisibleNetwork toProto(boolean connected) { PartnerLocationDescriptor.VisibleNetwork visibleNetwork = new PartnerLocationDescriptor.VisibleNetwork(); @@ -227,10 +227,10 @@ /** * Specification of a visible cell. */ - public static class VisibleCell { - public static final VisibleCell UNKNOWN_VISIBLE_CELL = + static class VisibleCell { + static final VisibleCell UNKNOWN_VISIBLE_CELL = VisibleCell.builder(VisibleCell.UNKNOWN_RADIO_TYPE).build(); - public static final VisibleCell UNKNOWN_MISSING_LOCATION_PERMISSION_VISIBLE_CELL = + static final VisibleCell UNKNOWN_MISSING_LOCATION_PERMISSION_VISIBLE_CELL = VisibleCell.builder(VisibleCell.UNKNOWN_MISSING_LOCATION_PERMISSION_RADIO_TYPE) .build(); @@ -240,15 +240,15 @@ @Retention(RetentionPolicy.SOURCE) @IntDef({UNKNOWN_RADIO_TYPE, UNKNOWN_MISSING_LOCATION_PERMISSION_RADIO_TYPE, CDMA_RADIO_TYPE, GSM_RADIO_TYPE, LTE_RADIO_TYPE, WCDMA_RADIO_TYPE}) - public @interface RadioType {} - public static final int UNKNOWN_RADIO_TYPE = 0; - public static final int UNKNOWN_MISSING_LOCATION_PERMISSION_RADIO_TYPE = 1; - public static final int CDMA_RADIO_TYPE = 2; - public static final int GSM_RADIO_TYPE = 3; - public static final int LTE_RADIO_TYPE = 4; - public static final int WCDMA_RADIO_TYPE = 5; + @interface RadioType {} + static final int UNKNOWN_RADIO_TYPE = 0; + static final int UNKNOWN_MISSING_LOCATION_PERMISSION_RADIO_TYPE = 1; + static final int CDMA_RADIO_TYPE = 2; + static final int GSM_RADIO_TYPE = 3; + static final int LTE_RADIO_TYPE = 4; + static final int WCDMA_RADIO_TYPE = 5; - public static Builder builder(@RadioType int radioType) { + static Builder builder(@RadioType int radioType) { return new VisibleCell.Builder().setRadioType(radioType); } @@ -287,7 +287,7 @@ * Returns the radio type of the visible cell. */ @RadioType - public int radioType() { + int radioType() { return mRadioType; } @@ -295,7 +295,7 @@ * Returns the gsm cell id, {@code null} if unknown. */ @Nullable - public Integer cellId() { + Integer cellId() { return mCellId; } @@ -303,7 +303,7 @@ * Returns the gsm location area code, {@code null} if unknown. */ @Nullable - public Integer locationAreaCode() { + Integer locationAreaCode() { return mLocationAreaCode; } @@ -311,7 +311,7 @@ * Returns the mobile country code, {@code null} if unknown or GSM. */ @Nullable - public Integer mobileCountryCode() { + Integer mobileCountryCode() { return mMobileCountryCode; } @@ -319,7 +319,7 @@ * Returns the mobile network code, {@code null} if unknown or GSM. */ @Nullable - public Integer mobileNetworkCode() { + Integer mobileNetworkCode() { return mMobileNetworkCode; } @@ -328,7 +328,7 @@ * if unknown or GSM. */ @Nullable - public Integer primaryScramblingCode() { + Integer primaryScramblingCode() { return mPrimaryScramblingCode; } @@ -336,7 +336,7 @@ * Returns the physical cell id, {@code null} if unknown or not LTE. */ @Nullable - public Integer physicalCellId() { + Integer physicalCellId() { return mPhysicalCellId; } @@ -344,7 +344,7 @@ * Returns the tracking area code, {@code null} if unknown or not LTE. */ @Nullable - public Integer trackingAreaCode() { + Integer trackingAreaCode() { return mTrackingAreaCode; } @@ -352,7 +352,7 @@ * Returns the timestamp in Ms, {@code null} if unknown. */ @Nullable - public Long timestampMs() { + Long timestampMs() { return mTimestampMs; } @@ -393,7 +393,7 @@ * Encodes a VisibleCell into its corresponding PartnerLocationDescriptor.VisibleNetwork * proto. */ - public PartnerLocationDescriptor.VisibleNetwork toProto(boolean connected) { + PartnerLocationDescriptor.VisibleNetwork toProto(boolean connected) { PartnerLocationDescriptor.VisibleNetwork visibleNetwork = new PartnerLocationDescriptor.VisibleNetwork(); @@ -437,7 +437,7 @@ /** * A {@link VisibleCell} builder. */ - public static class Builder { + static class Builder { @RadioType private int mRadioType; @Nullable @@ -457,52 +457,52 @@ @Nullable private Long mTimestampMs; - public Builder setRadioType(@RadioType int radioType) { + Builder setRadioType(@RadioType int radioType) { mRadioType = radioType; return this; } - public Builder setCellId(@Nullable Integer cellId) { + Builder setCellId(@Nullable Integer cellId) { mCellId = cellId; return this; } - public Builder setLocationAreaCode(@Nullable Integer locationAreaCode) { + Builder setLocationAreaCode(@Nullable Integer locationAreaCode) { mLocationAreaCode = locationAreaCode; return this; } - public Builder setMobileCountryCode(@Nullable Integer mobileCountryCode) { + Builder setMobileCountryCode(@Nullable Integer mobileCountryCode) { mMobileCountryCode = mobileCountryCode; return this; } - public Builder setMobileNetworkCode(@Nullable Integer mobileNetworkCode) { + Builder setMobileNetworkCode(@Nullable Integer mobileNetworkCode) { mMobileNetworkCode = mobileNetworkCode; return this; } - public Builder setPrimaryScramblingCode(@Nullable Integer primaryScramblingCode) { + Builder setPrimaryScramblingCode(@Nullable Integer primaryScramblingCode) { mPrimaryScramblingCode = primaryScramblingCode; return this; } - public Builder setPhysicalCellId(@Nullable Integer physicalCellId) { + Builder setPhysicalCellId(@Nullable Integer physicalCellId) { mPhysicalCellId = physicalCellId; return this; } - public Builder setTrackingAreaCode(@Nullable Integer trackingAreaCode) { + Builder setTrackingAreaCode(@Nullable Integer trackingAreaCode) { mTrackingAreaCode = trackingAreaCode; return this; } - public Builder setTimestamp(@Nullable Long timestampMs) { + Builder setTimestamp(@Nullable Long timestampMs) { mTimestampMs = timestampMs; return this; } - public VisibleCell build() { + VisibleCell build() { return new VisibleCell(this); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTracker.java index a55a91a7..5176797e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTracker.java
@@ -18,7 +18,7 @@ /** * VisibleNetworksTracker keeps track of the visible networks. */ -public class VisibleNetworksTracker { +class VisibleNetworksTracker { private static final String TAG = "VNTracker"; @VisibleForTesting @@ -40,7 +40,7 @@ * refresh. Might return null if visible networks cannot be computed. */ @Nullable - public static VisibleNetworks getLastKnownVisibleNetworks(final Context context) { + static VisibleNetworks getLastKnownVisibleNetworks(final Context context) { if (sUseVisibleNetworksForTesting) return sVisibleNetworksForTesting; if (isValidCachedVisibleNetworks()) return getCachedVisibleNetworks(); @@ -65,7 +65,7 @@ * needed. */ @SuppressFBWarnings("LI_LAZY_INIT_UPDATE_STATIC") - public static void refreshVisibleNetworks(final Context context) { + static void refreshVisibleNetworks(final Context context) { ThreadUtils.assertOnUiThread(); if (isValidCachedVisibleNetworks() || sOngoingRefresh != null) { return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java index 4dfe4c6..82f96c3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -723,16 +723,18 @@ @CalledByNative private boolean exitWebVRPresent() { if (!mInVr) return false; - if (!isVrShellEnabled(mVrSupportLevel) || !activitySupportsVrBrowsing(mActivity)) { - if (mVrDaydreamApi.exitFromVr(EXIT_VR_RESULT, new Intent())) { + if (!isVrShellEnabled(mVrSupportLevel) || !mVrDaydreamApi.isDaydreamCurrentViewer() + || !activitySupportsVrBrowsing(mActivity)) { + if (mVrDaydreamApi.isDaydreamCurrentViewer() + && mVrDaydreamApi.exitFromVr(EXIT_VR_RESULT, new Intent())) { mShowingDaydreamDoff = true; return false; } - mVrShell.setWebVrModeEnabled(false); shutdownVr( true /* disableVrMode */, false /* canReenter */, true /* stayingInChrome */); } else { mVrBrowserUsed = true; + mVrShell.setWebVrModeEnabled(false); } return true; }
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 83bead5..8a489de 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
@@ -12,6 +12,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.graphics.Color; +import android.graphics.Rect; import android.graphics.Region; import android.support.annotation.IntDef; import android.support.annotation.Nullable; @@ -134,6 +135,9 @@ /** The height of the shadow that sits above the toolbar. */ private final int mToolbarShadowHeight; + /** The height of the bottom navigation bar that appears when the bottom sheet is expanded. */ + private final float mBottomNavHeight; + /** The {@link BottomSheetMetrics} used to record user actions and histograms. */ private final BottomSheetMetrics mMetrics; @@ -401,6 +405,8 @@ mToolbarShadowHeight = getResources().getDimensionPixelOffset(R.dimen.toolbar_shadow_height); + mBottomNavHeight = getResources().getDimensionPixelSize(R.dimen.bottom_nav_height); + mVelocityTracker = VelocityTracker.obtain(); mGestureDetector = new GestureDetector(context, new BottomSheetSwipeDetector()); @@ -499,6 +505,14 @@ } /** + * Defocus the omnibox. + */ + public void defocusOmnibox() { + if (mDefaultToolbarView == null) return; + mDefaultToolbarView.getLocationBar().setUrlBarFocus(false); + } + + /** * @param tabModelSelector A TabModelSelector for getting the current tab and activity. */ public void setTabModelSelector(TabModelSelector tabModelSelector) { @@ -565,18 +579,45 @@ // Listen to height changes on the root. root.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { + /** The height of the screen minus the keyboard height. */ + private float mHeightMinusKeyboard; + @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { + // 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()); + + boolean keyboardHeightChanged = heightMinusKeyboard != mHeightMinusKeyboard; + // Make sure the size of the layout actually changed. - if (bottom - top == oldBottom - oldTop && right - left == oldRight - oldLeft) { + if (!keyboardHeightChanged && bottom - top == oldBottom - oldTop + && right - left == oldRight - oldLeft) { return; } mContainerWidth = right - left; mContainerHeight = bottom - top; + mHeightMinusKeyboard = heightMinusKeyboard; + int keyboardHeight = (int) (mContainerHeight - mHeightMinusKeyboard); updateSheetDimensions(); + for (BottomSheetObserver o : mObservers) { + o.onSheetLayout((int) mContainerHeight, (int) mHeightMinusKeyboard); + } + + // If the keyboard height changed, recompute the padding for the content area. This + // shrinks the content size while retaining the default background color where the + // keyboard is appearing. + if (keyboardHeightChanged && isSheetOpen()) { + mBottomSheetContentContainer.setPadding( + 0, 0, 0, (int) mBottomNavHeight + keyboardHeight); + } + // If we are in the middle of a touch event stream (i.e. scrolling while keyboard is // up) don't set the sheet state. Instead allow the gesture detector to position the // sheet and make sure the keyboard hides. @@ -964,6 +1005,8 @@ * @param offset The offset that the sheet should be. */ private void setSheetOffsetFromBottom(float offset) { + if (MathUtils.areFloatsEqual(offset, getSheetOffsetFromBottom())) return; + if (MathUtils.areFloatsEqual(getSheetOffsetFromBottom(), getMinOffset()) && offset > getMinOffset()) { onSheetOpened();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java index e1b64f1..e189168 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
@@ -76,9 +76,18 @@ private final BottomSheetObserver mBottomSheetObserver = new EmptyBottomSheetObserver() { @Override public void onSheetOffsetChanged(float heightFraction) { - float offsetY = (mBottomSheet.getMinOffset() - mBottomSheet.getSheetOffsetFromBottom()) - + mDistanceBelowToolbarPx; - setTranslationY((int) Math.max(offsetY, 0f)); + // If the omnibox is not focused, allow the navigation bar to set its Y translation. + if (!mOmniboxHasFocus) { + float offsetY = + (mBottomSheet.getMinOffset() - mBottomSheet.getSheetOffsetFromBottom()) + + mDistanceBelowToolbarPx; + setTranslationY(Math.max(offsetY, 0f)); + + if (mBottomSheet.getTargetSheetState() != BottomSheet.SHEET_STATE_PEEK + && mSelectedItemId == PLACEHOLDER_ID) { + showBottomSheetContent(R.id.action_home); + } + } setVisibility(MathUtils.areFloatsEqual(heightFraction, 0f) ? View.GONE : View.VISIBLE); mSnackbarManager.dismissAllSnackbars(); @@ -124,6 +133,11 @@ mBottomSheet.setSheetState(BottomSheet.SHEET_STATE_FULL, true); } } + + @Override + public void onSheetLayout(int windowHeight, int containerHeight) { + setTranslationY(containerHeight - windowHeight); + } }; private BottomSheet mBottomSheet; @@ -135,6 +149,7 @@ private ChromeActivity mActivity; private boolean mShouldOpenSheetOnNextContentChange; private PlaceholderSheetContent mPlaceholderContent; + private boolean mOmniboxHasFocus; public BottomSheetContentController(Context context, AttributeSet atts) { super(context, atts); @@ -218,11 +233,15 @@ * @param hasFocus Whether or not the omnibox has focus. */ public void onOmniboxFocusChange(boolean hasFocus) { + mOmniboxHasFocus = hasFocus; + // If the omnibox is being focused, show the placeholder. if (hasFocus && mBottomSheet.getSheetState() != BottomSheet.SHEET_STATE_HALF && mBottomSheet.getSheetState() != BottomSheet.SHEET_STATE_FULL) { mBottomSheet.showContent(mPlaceholderContent); mBottomSheet.endTransitionAnimations(); + if (mSelectedItemId > 0) getMenu().findItem(mSelectedItemId).setChecked(false); + mSelectedItemId = PLACEHOLDER_ID; } if (!hasFocus && mBottomSheet.getCurrentSheetContent() == mPlaceholderContent) { @@ -234,6 +253,8 @@ public boolean onNavigationItemSelected(MenuItem item) { if (mSelectedItemId == item.getItemId()) return false; + mBottomSheet.defocusOmnibox(); + mSnackbarManager.dismissAllSnackbars(); showBottomSheetContent(item.getItemId()); return true; @@ -290,7 +311,7 @@ // There are some bugs related to programatically selecting menu items that are fixed in // newer support library versions. // TODO(twellington): remove this after the support library is rolled. - if (mSelectedItemId != 0) getMenu().findItem(mSelectedItemId).setChecked(false); + if (mSelectedItemId > 0) getMenu().findItem(mSelectedItemId).setChecked(false); mSelectedItemId = navItemId; getMenu().findItem(mSelectedItemId).setChecked(true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetObserver.java index 84ca3d8..8f67e6fa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetObserver.java
@@ -45,6 +45,14 @@ void onSheetOffsetChanged(float heightFraction); /** + * A notification that the dimensions of the sheet has changed. The container height will be + * different from the window height when the keyboard is showing. + * @param windowHeight The height of the window in px. + * @param containerHeight The height of the bottom sheet's container in px. + */ + void onSheetLayout(int windowHeight, int containerHeight); + + /** * An event for when the sheet is transitioning from the peeking state to the half expanded * state. Once the sheet is outside the peek-half range, this event will no longer be * called. This event is guaranteed to be called at least once with 0.0f in the peeking state
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/EmptyBottomSheetObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/EmptyBottomSheetObserver.java index 9ed98ea..cbcc3473 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/EmptyBottomSheetObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/EmptyBottomSheetObserver.java
@@ -26,6 +26,9 @@ public void onSheetOffsetChanged(float heightFraction) {} @Override + public void onSheetLayout(int windowHeight, int containerHeight) {} + + @Override public void onTransitionPeekToHalf(float transitionFraction) {} @Override
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java index 499c630..d15846f 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.omnibox; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.inOrder; @@ -14,6 +13,7 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.inputmethod.BaseInputConnection; +import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import org.junit.Before; @@ -87,8 +87,8 @@ // AutocompleteEditText#onAutocompleteTextStateChanged(boolean, boolean)}, which is caused // by View constructor's call to setText(). mInOrder = inOrder(mEmbedder); - mDummyTargetInputConnection = new BaseInputConnection(mAutocomplete, true); - mInputConnection = mAutocomplete.createInputConnection(mDummyTargetInputConnection); + mAutocomplete.onCreateInputConnection(new EditorInfo()); + mInputConnection = mAutocomplete.getInputConnection(); assertNotNull(mInputConnection); mInOrder.verifyNoMoreInteractions(); if (DEBUG) Log.i(TAG, "setUp finished."); @@ -113,11 +113,12 @@ // The controller kicks in. mAutocomplete.setAutocompleteText("hello", " world"); assertTexts("hello", " world"); - assertFalse(mInputConnection.beginBatchEdit()); + assertTrue(mInputConnection.beginBatchEdit()); assertTrue(mInputConnection.commitText(" ", 1)); - mInOrder.verify(mEmbedder).onAutocompleteTextStateChanged(false, false); assertTexts("hello ", "world"); - assertFalse(mInputConnection.endBatchEdit()); + mInOrder.verifyNoMoreInteractions(); + assertTrue(mInputConnection.endBatchEdit()); + mInOrder.verify(mEmbedder).onAutocompleteTextStateChanged(false, true); mAutocomplete.setAutocompleteText("hello ", "world"); assertTexts("hello ", "world"); mInOrder.verifyNoMoreInteractions();
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 9b830e77..a22acbed 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -255,6 +255,12 @@ data_reduction_proxy::switches:: kDataReductionProxyLoFiValueSlowConnectionsOnly}}; +const FeatureEntry::Choice kDataReductionProxyServerExperiment[] = { + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, + {flag_descriptions::kDataReductionProxyServerAlternative, + data_reduction_proxy::switches::kDataReductionProxyExperiment, + data_reduction_proxy::switches::kDataReductionProxyServerAlternative}}; + const FeatureEntry::Choice kShowSavedCopyChoices[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, {flag_descriptions::kEnableShowSavedCopyPrimary, @@ -1924,6 +1930,10 @@ flag_descriptions::kEnableDataReductionProxyLitePageDescription, kOsAll, SINGLE_VALUE_TYPE( data_reduction_proxy::switches::kEnableDataReductionProxyLitePage)}, + {"enable-data-reduction-proxy-server-experiment", + flag_descriptions::kEnableDataReductionProxyServerExperimentName, + flag_descriptions::kEnableDataReductionProxyServerExperimentDescription, + kOsAll, MULTI_VALUE_TYPE(kDataReductionProxyServerExperiment)}, #if defined(OS_ANDROID) {"enable-data-reduction-proxy-savings-promo", flag_descriptions::kEnableDataReductionProxySavingsPromoName,
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc index f8e8ed1..bdecff8 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -700,17 +700,23 @@ // and US dvorak keyboard layouts. if (g_browser_process && g_browser_process->local_state()) { const std::string locale = g_browser_process->GetApplicationLocale(); - // If the preferred keyboard for the login screen has been saved, use it. - PrefService* prefs = g_browser_process->local_state(); - std::string initial_input_method_id = - prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout); std::vector<std::string> input_methods_to_be_enabled; - if (initial_input_method_id.empty()) { - // If kPreferredKeyboardLayout is not specified, use the hardware layout. - input_methods_to_be_enabled = - manager_->util_.GetHardwareLoginInputMethodIds(); + if (!GetAllowedInputMethods().empty()) { + // Prefer policy-set input methods. + input_methods_to_be_enabled = GetAllowedInputMethods(); } else { - input_methods_to_be_enabled.push_back(initial_input_method_id); + // If the preferred keyboard for the login screen has been saved, use it. + PrefService* prefs = g_browser_process->local_state(); + std::string initial_input_method_id = + prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout); + if (initial_input_method_id.empty()) { + // If kPreferredKeyboardLayout is not specified, use the hardware + // layout. + input_methods_to_be_enabled = + manager_->util_.GetHardwareLoginInputMethodIds(); + } else { + input_methods_to_be_enabled.push_back(initial_input_method_id); + } } EnableLoginLayouts(locale, input_methods_to_be_enabled); manager_->LoadNecessaryComponentExtensions(this);
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc index 524a3492..a74dc0d 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -1547,5 +1547,18 @@ ImeIdFromEngineId(kNaclMozcUsId))); } +TEST_F(InputMethodManagerImplTest, SetLoginDefaultWithAllowedKeyboardLayouts) { + InitComponentExtension(); + + std::vector<std::string> allowed = {"xkb:us::eng", "xkb:de::ger", + "xkb:fr::fra"}; + EXPECT_TRUE(manager_->GetActiveIMEState()->SetAllowedInputMethods(allowed)); + manager_->GetActiveIMEState()->SetInputMethodLoginDefault(); + EXPECT_THAT(manager_->GetActiveIMEState()->GetActiveInputMethodIds(), + testing::ElementsAre(ImeIdFromEngineId("xkb:us::eng"), + ImeIdFromEngineId("xkb:de::ger"), + ImeIdFromEngineId("xkb:fr::fra"))); +} + } // namespace input_method } // namespace chromeos
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 94d08480..f88968b8 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1179,6 +1179,16 @@ "shown instead of image placeholders when Lo-Fi is on. Data Saver and " "Lo-Fi must be enabled for lite pages to be shown."; +const char kDataReductionProxyServerAlternative[] = + "Use alternative server configuration"; + +const char kEnableDataReductionProxyServerExperimentName[] = + "Use an alternative Data Saver back end configuration."; + +const char kEnableDataReductionProxyServerExperimentDescription[] = + "Enable a different approach to saving data by configuring the back end " + "server"; + const char kDataReductionProxyCarrierTestName[] = "Enable a carrier-specific Data Reduction Proxy for testing.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 0e1d9d75..170039d 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -189,6 +189,10 @@ extern const char kEnableDataReductionProxyLitePageName[]; extern const char kEnableDataReductionProxyLitePageDescription[]; +extern const char kDataReductionProxyServerAlternative[]; +extern const char kEnableDataReductionProxyServerExperimentName[]; +extern const char kEnableDataReductionProxyServerExperimentDescription[]; + extern const char kEnableDataReductionProxySavingsPromoName[]; extern const char kEnableDataReductionProxySavingsPromoDescription[];
diff --git a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.cc b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.cc index 2d92682..28f3436 100644 --- a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.cc +++ b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h" +#include <utility> + #include "base/bind.h" #include "base/callback.h" #include "base/memory/ptr_util.h" @@ -40,7 +42,7 @@ } void LeakDetectorRemoteController::GetParams( - const mojom::LeakDetector::GetParamsCallback& callback) { + mojom::LeakDetector::GetParamsCallback callback) { // If no controller exists, send an empty param protobuf. The remote caller // should not initialize anything if the params are empty. MemoryLeakReportProto_Params params; @@ -56,7 +58,7 @@ leak_detector::protobuf_to_mojo_converter::ParamsToMojo(params, mojo_params.get()); - callback.Run(std::move(mojo_params)); + std::move(callback).Run(std::move(mojo_params)); } void LeakDetectorRemoteController::SendLeakReports(
diff --git a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h index 6a4d568..e3f8255c 100644 --- a/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h +++ b/chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
@@ -48,8 +48,7 @@ mojom::LeakDetectorRequest request); // mojom::LeakDetector: - void GetParams( - const mojom::LeakDetector::GetParamsCallback& callback) override; + void GetParams(mojom::LeakDetector::GetParamsCallback callback) override; void SendLeakReports(std::vector<mojom::MemoryLeakReportPtr>) override; // Sets a global pointer to a LocalController implementation. The global
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 177bea75..b7eae5b 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc
@@ -12,6 +12,7 @@ #include <vector> #include "ash/accelerators/accelerator_controller_delegate_aura.h" +#include "base/base_switches.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" @@ -132,6 +133,7 @@ #include "components/update_client/url_request_post_interceptor.h" #include "components/user_prefs/user_prefs.h" #include "components/variations/service/variations_service.h" +#include "components/variations/variations_switches.h" #include "components/version_info/version_info.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" @@ -4506,6 +4508,20 @@ class NetworkTimePolicyTest : public PolicyTest { public: + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitchASCII( + switches::kEnableFeatures, + std::string(network_time::kNetworkTimeServiceQuerying.name) + + "<SSLNetworkTimeBrowserTestFieldTrial"); + command_line->AppendSwitchASCII( + switches::kForceFieldTrials, + "SSLNetworkTimeBrowserTestFieldTrial/Enabled/"); + command_line->AppendSwitchASCII( + variations::switches::kForceFieldTrialParams, + "SSLNetworkTimeBrowserTestFieldTrial.Enabled:FetchBehavior/" + "on-demand-only"); + } + // A request handler that returns a dummy response and counts the number of // times it is called. std::unique_ptr<net::test_server::HttpResponse> CountingRequestHandler(
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js index ca84baef..4804bd6 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js
@@ -126,7 +126,7 @@ callback = properties['endCallback']; } callAsync_(message, callback); - }; + } /** * Gets an object given a dotted namespace object path.
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js index ff4cba6..917ea4e 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js
@@ -73,7 +73,7 @@ // The keys are the same length. Sort lexicographically. return a[0].localeCompare(b[0]); } - }; + } sortingArray.sort(compareKeyStr); return sortingArray;
diff --git a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js index c8d4fd6..15e43ec6 100644 --- a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js +++ b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
@@ -2488,7 +2488,7 @@ return (n.tagName == 'SPAN' && n.className.split(' ').some(function(x) { return x.toLowerCase() == cl;})); - }; + } if (isSpanWithClass(node, 'math')) { var ancestors = cvox.DomUtil.getAncestors(node); return ancestors.some(function(x) {return isSpanWithClass(x, 'mathjax');});
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js index 1208b8d..2ff4fa3 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js +++ b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js
@@ -195,7 +195,7 @@ this.doRetry_.bind(this)); function doneCallback() { chrome.send('oauthEnrollClose', ['done']); - }; + } $('oauth-enroll-attribute-prompt-error-card').addEventListener( 'buttonclick', doneCallback);
diff --git a/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.js b/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.js index f1b0b4d..2430478 100644 --- a/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.js +++ b/chrome/browser/resources/chromeos/login/screen_supervised_user_creation.js
@@ -403,7 +403,7 @@ function scrollToAdjustTop() { self.scrollTop = top; return true; - }; + } // Function to adjust the bottoms of viewport and row. function scrollToAdjustBottom() { var cs = getComputedStyle(self); @@ -415,7 +415,7 @@ return true; } return false; - }; + } // Check if the entire of given indexed row can be shown in the viewport. if (itemHeight <= clientHeight) {
diff --git a/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js b/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js index 24043ae1..3e1f820 100644 --- a/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js +++ b/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js
@@ -32,7 +32,7 @@ let enabled = switchAccess.switchAccessPrefs.getBooleanPref('enableAutoScan'); if (enabled) this.start_(); -}; +} AutoScanManager.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/automation_manager.js b/chrome/browser/resources/chromeos/switch_access/automation_manager.js index 6c1d39f..38e54479 100644 --- a/chrome/browser/resources/chromeos/switch_access/automation_manager.js +++ b/chrome/browser/resources/chromeos/switch_access/automation_manager.js
@@ -48,7 +48,7 @@ this.treeWalker_ = this.createTreeWalker_(desktop); this.init_(); -}; +} /** * Highlight colors for the focus ring to distinguish between different types
diff --git a/chrome/browser/resources/chromeos/switch_access/automation_predicate.js b/chrome/browser/resources/chromeos/switch_access/automation_predicate.js index d706c3e..756839f 100644 --- a/chrome/browser/resources/chromeos/switch_access/automation_predicate.js +++ b/chrome/browser/resources/chromeos/switch_access/automation_predicate.js
@@ -8,7 +8,7 @@ * * @constructor */ -function AutomationPredicate() {}; +function AutomationPredicate() {} /** * Returns true if |node| is a subtreeLeaf, meaning that |node| is either
diff --git a/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js b/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js index 8d9b151..901690f 100644 --- a/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js +++ b/chrome/browser/resources/chromeos/switch_access/keyboard_handler.js
@@ -19,7 +19,7 @@ this.switchAccess_ = switchAccess; this.init_(); -}; +} KeyboardHandler.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/options.js b/chrome/browser/resources/chromeos/switch_access/options.js index 94fefc7..0f935e8e 100644 --- a/chrome/browser/resources/chromeos/switch_access/options.js +++ b/chrome/browser/resources/chromeos/switch_access/options.js
@@ -31,7 +31,7 @@ document.addEventListener('change', this.handleInputChange_.bind(this)); background.document.addEventListener( 'prefsUpdate', this.handlePrefsUpdate_.bind(this)); -}; +} SwitchAccessOptions.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/prefs.js b/chrome/browser/resources/chromeos/switch_access/prefs.js index 6c2a327b..15ae9dd 100644 --- a/chrome/browser/resources/chromeos/switch_access/prefs.js +++ b/chrome/browser/resources/chromeos/switch_access/prefs.js
@@ -17,7 +17,7 @@ this.loadPrefs_(); chrome.storage.onChanged.addListener(this.handleStorageChange_.bind(this)); -}; +} SwitchAccessPrefs.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/switch_access.js b/chrome/browser/resources/chromeos/switch_access/switch_access.js index 58f19f7..eccde6e5 100644 --- a/chrome/browser/resources/chromeos/switch_access/switch_access.js +++ b/chrome/browser/resources/chromeos/switch_access/switch_access.js
@@ -41,7 +41,7 @@ this.automationManager_ = null; this.init_(); -}; +} SwitchAccess.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/switch_access_interface.js b/chrome/browser/resources/chromeos/switch_access/switch_access_interface.js index 6401ab8..8de1a9d 100644 --- a/chrome/browser/resources/chromeos/switch_access/switch_access_interface.js +++ b/chrome/browser/resources/chromeos/switch_access/switch_access_interface.js
@@ -12,7 +12,7 @@ * @type {SwitchAccessPrefs} */ this.switchAccessPrefs = null; -}; +} SwitchAccessInterface.prototype = { moveToNode: function(doNext) {},
diff --git a/chrome/browser/resources/chromeos/switch_access/test_support.js b/chrome/browser/resources/chromeos/switch_access/test_support.js index 8e76f1ba..8b0b3996 100644 --- a/chrome/browser/resources/chromeos/switch_access/test_support.js +++ b/chrome/browser/resources/chromeos/switch_access/test_support.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -function TestSupport() {}; +function TestSupport() {} TestSupport.prototype = { /**
diff --git a/chrome/browser/resources/chromeos/switch_access/tree_walker.js b/chrome/browser/resources/chromeos/switch_access/tree_walker.js index 5c763b8..0de3f23 100644 --- a/chrome/browser/resources/chromeos/switch_access/tree_walker.js +++ b/chrome/browser/resources/chromeos/switch_access/tree_walker.js
@@ -41,7 +41,7 @@ * @private {!AutomationTreeWalker.Unary} */ this.visitPred_ = restrictions.visit; -}; +} /** * @typedef {{leaf: AutomationTreeWalker.Unary,
diff --git a/chrome/browser/resources/options/geolocation_options.js b/chrome/browser/resources/options/geolocation_options.js index b15ee399..30071df3 100644 --- a/chrome/browser/resources/options/geolocation_options.js +++ b/chrome/browser/resources/options/geolocation_options.js
@@ -15,7 +15,7 @@ Page.call(this, 'geolocationOptions', loadTimeData.getString('geolocationOptionsPageTabTitle'), 'geolocationCheckbox'); - }; + } cr.addSingletonGetter(GeolocationOptions);
diff --git a/chrome/browser/resources/options/language_list.js b/chrome/browser/resources/options/language_list.js index 24467e0a..7fc79e56 100644 --- a/chrome/browser/resources/options/language_list.js +++ b/chrome/browser/resources/options/language_list.js
@@ -22,7 +22,7 @@ el.language_ = languageInfo; el.decorate(); return el; - }; + } LanguageListItem.prototype = { __proto__: DeletableItem.prototype,
diff --git a/chrome/browser/resources/options/startup_overlay.js b/chrome/browser/resources/options/startup_overlay.js index ec3d5b9f..8d761fe5 100644 --- a/chrome/browser/resources/options/startup_overlay.js +++ b/chrome/browser/resources/options/startup_overlay.js
@@ -18,7 +18,7 @@ 'startup-overlay', assertInstanceof($('startup-overlay-confirm'), HTMLButtonElement), assertInstanceof($('startup-overlay-cancel'), HTMLButtonElement)); - }; + } cr.addSingletonGetter(StartupOverlay);
diff --git a/chrome/browser/resources/options/supervised_user_create_confirm.js b/chrome/browser/resources/options/supervised_user_create_confirm.js index 3d0cb6f..cd3274b 100644 --- a/chrome/browser/resources/options/supervised_user_create_confirm.js +++ b/chrome/browser/resources/options/supervised_user_create_confirm.js
@@ -17,7 +17,7 @@ Page.call(this, 'supervisedUserCreateConfirm', '', // The title will be based on the new profile name. 'supervised-user-created'); - }; + } cr.addSingletonGetter(SupervisedUserCreateConfirmOverlay);
diff --git a/chrome/browser/resources/options/supervised_user_import.js b/chrome/browser/resources/options/supervised_user_import.js index d3591c7..ea97b42 100644 --- a/chrome/browser/resources/options/supervised_user_import.js +++ b/chrome/browser/resources/options/supervised_user_import.js
@@ -17,7 +17,7 @@ function SupervisedUserImportOverlay() { var title = loadTimeData.getString('supervisedUserImportTitle'); Page.call(this, 'supervisedUserImport', title, 'supervised-user-import'); - }; + } cr.addSingletonGetter(SupervisedUserImportOverlay);
diff --git a/chrome/browser/resources/options/supervised_user_learn_more.js b/chrome/browser/resources/options/supervised_user_learn_more.js index 6b589f3b..da7975e 100644 --- a/chrome/browser/resources/options/supervised_user_learn_more.js +++ b/chrome/browser/resources/options/supervised_user_learn_more.js
@@ -15,7 +15,7 @@ Page.call(this, 'supervisedUserLearnMore', loadTimeData.getString('supervisedUserLearnMoreTitle'), 'supervised-user-learn-more'); - }; + } cr.addSingletonGetter(SupervisedUserLearnMoreOverlay);
diff --git a/chrome/browser/resources/options/supervised_user_list_data.js b/chrome/browser/resources/options/supervised_user_list_data.js index 67ac67e..78967ca 100644 --- a/chrome/browser/resources/options/supervised_user_list_data.js +++ b/chrome/browser/resources/options/supervised_user_list_data.js
@@ -14,7 +14,7 @@ */ function SupervisedUserListData() { this.observers_ = []; - }; + } cr.addSingletonGetter(SupervisedUserListData);
diff --git a/chrome/browser/resources/settings/prefs/prefs.js b/chrome/browser/resources/settings/prefs/prefs.js index 15df5f2..7e96f79 100644 --- a/chrome/browser/resources/settings/prefs/prefs.js +++ b/chrome/browser/resources/settings/prefs/prefs.js
@@ -88,7 +88,7 @@ return val; return Array.isArray(val) ? deepCopyArray(/** @type {!Array} */(val)) : deepCopyObject(val); - }; + } /** * @param {!Array} arr
diff --git a/chrome/browser/resources/settings/site_settings/cookie_tree_node.js b/chrome/browser/resources/settings/site_settings/cookie_tree_node.js index 0b64778a..030099b 100644 --- a/chrome/browser/resources/settings/site_settings/cookie_tree_node.js +++ b/chrome/browser/resources/settings/site_settings/cookie_tree_node.js
@@ -74,7 +74,7 @@ * @private {!Array<!settings.CookieTreeNode>} */ this.children_ = []; - }; + } CookieTreeNode.prototype = { /**
diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc index ea03e3f..92c0123 100644 --- a/chrome/browser/themes/theme_properties.cc +++ b/chrome/browser/themes/theme_properties.cc
@@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "build/build_config.h" #include "chrome/browser/themes/browser_theme_pack.h" +#include "chrome/common/chrome_features.h" #include "chrome/grit/theme_resources.h" #include "ui/base/material_design/material_design_controller.h" #include "ui/gfx/color_palette.h" @@ -67,7 +68,11 @@ constexpr SkColor kDefaultColorNTPText = SK_ColorBLACK; const SkColor kDefaultColorNTPLink = SkColorSetRGB(0x06, 0x37, 0x74); #endif // OS_WIN -const SkColor kDefaultColorNTPBackgroundOtr = SkColorSetRGB(0x30, 0x30, 0x30); + +// Then new MD Incognito NTP uses a slightly different shade of black. +// TODO(msramek): Remove the old entry when the new NTP fully launches. +const SkColor kDefaultColorNTPBackgroundOtr = SkColorSetRGB(0x32, 0x32, 0x32); +const SkColor kDefaultColorNTPBackgroundOtrMD = SkColorSetRGB(0x30, 0x30, 0x30); const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; @@ -236,7 +241,11 @@ return otr ? kDefaultColorBackgroundTabTextIncognito : kDefaultColorBackgroundTabText; case COLOR_NTP_BACKGROUND: - return otr ? kDefaultColorNTPBackgroundOtr : kDefaultColorNTPBackground; + if (!otr) + return kDefaultColorNTPBackground; + return base::FeatureList::IsEnabled(features::kMaterialDesignIncognitoNTP) + ? kDefaultColorNTPBackgroundOtrMD + : kDefaultColorNTPBackgroundOtr; case COLOR_NTP_TEXT: return kDefaultColorNTPText; case COLOR_NTP_LINK:
diff --git a/chrome/browser/ui/cocoa/infobars/after_translate_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/after_translate_infobar_controller.mm index ff2f503..80e35df6 100644 --- a/chrome/browser/ui/cocoa/infobars/after_translate_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/after_translate_infobar_controller.mm
@@ -9,7 +9,6 @@ #include "components/translate/core/common/translate_constants.h" using InfoBarUtilities::MoveControl; -using InfoBarUtilities::VerifyControlOrderAndSpacing; @implementation AfterTranslateInfobarController
diff --git a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm index c6bafeb..b078c685 100644 --- a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm
@@ -12,7 +12,6 @@ #include "ui/base/l10n/l10n_util.h" using InfoBarUtilities::MoveControl; -using InfoBarUtilities::VerifyControlOrderAndSpacing; namespace {
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm index 14e753a4..965f5f18 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm
@@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" +#include "base/mac/foundation_util.h" #include "chrome/browser/infobars/infobar_service.h" #import "chrome/browser/ui/cocoa/animatable_view.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" @@ -14,6 +15,7 @@ #import "chrome/browser/ui/cocoa/infobars/infobar_container_cocoa.h" #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" #import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" +#include "chrome/browser/ui/cocoa/l10n_util.h" #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" @@ -85,6 +87,8 @@ [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()]; [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + cocoa_l10n_util::FlipAllSubviewsIfNecessary( + base::mac::ObjCCast<NSView>(infoBarView_)); } - (void)dealloc {
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_utilities.h b/chrome/browser/ui/cocoa/infobars/infobar_utilities.h index 2d6c820..716e036 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_utilities.h +++ b/chrome/browser/ui/cocoa/infobars/infobar_utilities.h
@@ -18,10 +18,6 @@ // Vertically center |toMove| in its container. void VerticallyCenterView(NSView *toMove); -// Check that the control |before| is ordered visually before the |after| -// control. Also, check that there is space between them. -bool VerifyControlOrderAndSpacing(id before, id after); - // Creates a label control in the style we need for the infobar's labels // within |bounds|. NSTextField* CreateLabel(NSRect bounds);
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm b/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm index fbc47579..8b81fc8 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm
@@ -50,14 +50,6 @@ [toMove setFrame:toMoveFrame]; } -// Check that the control |before| is ordered visually before the |after| -// control. Also, check that there is space between them. -bool VerifyControlOrderAndSpacing(id before, id after) { - NSRect beforeFrame = [before frame]; - NSRect afterFrame = [after frame]; - return NSMinX(afterFrame) >= NSMaxX(beforeFrame); -} - // Vertically center |toMove| in its container. void VerticallyCenterView(NSView* toMove) { NSRect superViewFrame = [[toMove superview] frame];
diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm index 764de82..41a9432 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm
@@ -21,6 +21,7 @@ #import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" #include "chrome/browser/ui/cocoa/infobars/translate_message_infobar_controller.h" +#include "chrome/browser/ui/cocoa/l10n_util.h" #include "components/strings/grit/components_strings.h" #include "components/translate/core/browser/translate_infobar_delegate.h" #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h" @@ -28,10 +29,23 @@ using InfoBarUtilities::MoveControl; using InfoBarUtilities::VerticallyCenterView; -using InfoBarUtilities::VerifyControlOrderAndSpacing; using InfoBarUtilities::CreateLabel; using InfoBarUtilities::AddMenuItem; +namespace { + +// Check that the control |before| is ordered visually before the |after| +// control. Also, check that there is space between them. Is RTL-aware. +bool VerifyControlOrderAndSpacing(id before, id after) { + NSRect beforeFrame = [before frame]; + NSRect afterFrame = [after frame]; + if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) + std::swap(beforeFrame, afterFrame); + return NSMinX(afterFrame) >= NSMaxX(beforeFrame); +} + +} // namespace + std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const { std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); @@ -388,8 +402,11 @@ [self rebuildOptionsMenu:NO]; [[optionsPopUp_ cell] setArrowPosition:NSPopUpArrowAtBottom]; [optionsPopUp_ sizeToFit]; - - MoveControl(closeButton_, optionsPopUp_, spaceBetweenControls_, false); + // Typically, infobars are mirrored after |addAdditionalControls| in RTL. + // Since the options menu is being moved after that code runs, an RTL + // check is necessary here as well. + MoveControl(closeButton_, optionsPopUp_, spaceBetweenControls_, + cocoa_l10n_util::ShouldDoExperimentalRTLLayout()); if (!VerifyControlOrderAndSpacing(lastView, optionsPopUp_)) { [self rebuildOptionsMenu:YES]; NSRect oldFrame = [optionsPopUp_ frame];
diff --git a/chrome/browser/ui/cocoa/l10n_util.h b/chrome/browser/ui/cocoa/l10n_util.h index cf36a22..a06a571 100644 --- a/chrome/browser/ui/cocoa/l10n_util.h +++ b/chrome/browser/ui/cocoa/l10n_util.h
@@ -61,6 +61,12 @@ // across the x axis. NSImage* FlippedImage(NSImage* image); +// In RTL, mirrors all subviews of |view|. Additionally, +// reverses horizontal margin autoresizing masks. +// This method is *not* recursive. +// In LTR, this is a no-op. +void FlipAllSubviewsIfNecessary(NSView* view); + } // namespace cocoa_l10n_util #endif // CHROME_BROWSER_UI_COCOA_L10N_UTIL_H_
diff --git a/chrome/browser/ui/cocoa/l10n_util.mm b/chrome/browser/ui/cocoa/l10n_util.mm index 857770e..03d772ee 100644 --- a/chrome/browser/ui/cocoa/l10n_util.mm +++ b/chrome/browser/ui/cocoa/l10n_util.mm
@@ -141,4 +141,26 @@ return flipped_image; } +void FlipAllSubviewsIfNecessary(NSView* view) { + if (!ShouldDoExperimentalRTLLayout()) + return; + CGFloat width = NSWidth([view frame]); + for (NSView* subview in [view subviews]) { + NSRect subviewFrame = [subview frame]; + subviewFrame.origin.x = + width - NSWidth(subviewFrame) - NSMinX(subviewFrame); + [subview setFrame:subviewFrame]; + if (subview.autoresizingMask & (NSViewMinXMargin | NSViewMaxXMargin)) { + // No-op. Skip reversing autoresizing mask if both horizontal margins + // are flexible. + } else if (subview.autoresizingMask & NSViewMinXMargin) { + subview.autoresizingMask &= ~NSViewMinXMargin; + subview.autoresizingMask |= NSViewMaxXMargin; + } else if (subview.autoresizingMask & NSViewMaxXMargin) { + subview.autoresizingMask &= ~NSViewMaxXMargin; + subview.autoresizingMask |= NSViewMinXMargin; + } + } +} + } // namespace cocoa_l10n_util
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index db3dead..34466be 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -77,10 +77,6 @@ namespace { -// Vertical space between the bottom edge of the location_bar and the first run -// bubble arrow point. -const static int kFirstRunBubbleYOffset = 1; - const int kDefaultIconSize = 16; // The minimum width the URL should have for the verbose state to be shown. @@ -656,9 +652,13 @@ if (!field_ || ![field_ window]) return; - // Point the bubble's arrow at the middle of the bottom of the page info icon. - const NSPoint kOffset = - NSMakePoint(info_bubble::kBubbleArrowXOffset, kFirstRunBubbleYOffset); + // Point the bubble's arrow at the middle of the page info icon. The x offset + // isn't the exact center, but this behavior matches other platforms and it + // looks better in practice since the arrow ends up between the handle and + // lens of the magnifying glass. + const NSPoint kOffset = NSMakePoint( + info_bubble::kBubbleArrowXOffset, + NSHeight([field_ frame]) / 2.0 - info_bubble::kBubbleArrowHeight); [FirstRunBubbleController showForView:field_ offset:kOffset browser:browser_
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc index eb6bf75..8af66f6 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -222,7 +222,10 @@ on_edited_(std::move(on_edited)), on_added_(std::move(on_added)), credit_card_to_edit_(credit_card), - add_billing_address_button_tag_(next_ui_tag) {} + add_billing_address_button_tag_(next_ui_tag) { + if (spec) + supported_card_networks_ = spec->supported_card_networks_set(); +} CreditCardEditorViewController::~CreditCardEditorViewController() {} @@ -499,11 +502,8 @@ // The supported card networks for non-cc-number types are not passed to avoid // the data copy in the delegate. return base::MakeUnique< - CreditCardEditorViewController::CreditCardValidationDelegate>( - field, this, - field.type == autofill::CREDIT_CARD_NUMBER - ? spec()->supported_card_networks() - : std::vector<std::string>()); + CreditCardEditorViewController::CreditCardValidationDelegate>(field, + this); } std::unique_ptr<ui::ComboboxModel> @@ -565,6 +565,31 @@ combobox->SetEnabled(combobox->GetRowCount() > 1); } +bool CreditCardEditorViewController::IsValidCreditCardNumber( + const base::string16& card_number, + base::string16* error_message) { + if (!autofill::IsValidCreditCardNumberForBasicCardNetworks( + card_number, supported_card_networks_, error_message)) { + return false; + } + // Now check if another credit card has already been created with this number. + // TODO(crbug.com/725604): the UI should offer to load / update the existing + // credit card info. + autofill::CreditCard* existing_card = + state()->GetPersonalDataManager()->GetCreditCardByNumber( + base::UTF16ToASCII(card_number)); + // If a card exists, it could be the one currently edited. + if (!existing_card || (credit_card_to_edit_ && credit_card_to_edit_->guid() == + existing_card->guid())) { + return true; + } + if (error_message) { + *error_message = l10n_util::GetStringUTF16( + IDS_PAYMENTS_VALIDATION_ALREADY_USED_CREDIT_CARD_NUMBER); + } + return false; +} + base::string16 CreditCardEditorViewController::GetSheetTitle() { if (!credit_card_to_edit_) return l10n_util::GetStringUTF16(IDS_PAYMENTS_ADD_CARD); @@ -611,14 +636,9 @@ } CreditCardEditorViewController::CreditCardValidationDelegate:: - CreditCardValidationDelegate( - const EditorField& field, - CreditCardEditorViewController* controller, - const std::vector<std::string>& supported_card_networks) - : field_(field), - controller_(controller), - supported_card_networks_(supported_card_networks.begin(), - supported_card_networks.end()) {} + CreditCardValidationDelegate(const EditorField& field, + CreditCardEditorViewController* controller) + : field_(field), controller_(controller) {} CreditCardEditorViewController::CreditCardValidationDelegate:: ~CreditCardValidationDelegate() {} @@ -678,12 +698,14 @@ ValidateValue(const base::string16& value, base::string16* error_message) { if (!value.empty()) { base::string16 local_error_message; - bool is_valid = - field_.type == autofill::CREDIT_CARD_NUMBER - ? autofill::IsValidCreditCardNumberForBasicCardNetworks( - value, supported_card_networks_, &local_error_message) - : autofill::IsValidForType(value, field_.type, - &local_error_message); + bool is_valid = false; + if (field_.type == autofill::CREDIT_CARD_NUMBER) { + is_valid = + controller_->IsValidCreditCardNumber(value, &local_error_message); + } else { + is_valid = + autofill::IsValidForType(value, field_.type, &local_error_message); + } if (error_message) *error_message = local_error_message; return is_valid;
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h index 1b08203..3ca4168 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
@@ -67,6 +67,10 @@ // higher opacity. If empty string, selects none of them (all full opacity). void SelectBasicCardNetworkIcon(const std::string& basic_card_network); + // Exposed for validation delegate. + bool IsValidCreditCardNumber(const base::string16& card_number, + base::string16* error_message); + protected: // PaymentRequestSheetController: void FillContentView(views::View* content_view) override; @@ -77,12 +81,9 @@ class CreditCardValidationDelegate : public ValidationDelegate { public: // Used to validate |field| type. A reference to the |controller| should - // outlive this delegate, and a list of |supported_card_networks| can be - // passed in to validate |field| (the data will be copied to the delegate). - CreditCardValidationDelegate( - const EditorField& field, - CreditCardEditorViewController* controller, - const std::vector<std::string>& supported_card_networks); + // outlive this delegate. + CreditCardValidationDelegate(const EditorField& field, + CreditCardEditorViewController* controller); ~CreditCardValidationDelegate() override; // ValidationDelegate: @@ -105,8 +106,6 @@ EditorField field_; // Outlives this class. CreditCardEditorViewController* controller_; - // The list of supported basic card networks. - std::set<std::string> supported_card_networks_; DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); }; @@ -135,6 +134,9 @@ // The value to use for the add billing address button tag. int add_billing_address_button_tag_; + // The list of supported basic card networks. + std::set<std::string> supported_card_networks_; + DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); };
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc index 1cf5af42..be25d9a 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc
@@ -642,6 +642,32 @@ request->state()->selected_instrument()); } +IN_PROC_BROWSER_TEST_F(PaymentRequestCreditCardEditorTest, + RefuseExistingCardNumber) { + autofill::CreditCard card = autofill::test::GetCreditCard(); + AddCreditCard(card); + + InvokePaymentRequestUI(); + OpenPaymentMethodScreen(); + OpenCreditCardEditorScreen(); + + SetEditorTextfieldValue(card.number(), autofill::CREDIT_CARD_NUMBER); + ValidatingTextfield* textfield = static_cast<ValidatingTextfield*>( + dialog_view()->GetViewByID(EditorViewController::GetInputFieldViewId( + autofill::CREDIT_CARD_NUMBER))); + ASSERT_TRUE(textfield); + EXPECT_TRUE(textfield->invalid()); + EXPECT_EQ(l10n_util::GetStringUTF16( + IDS_PAYMENTS_VALIDATION_ALREADY_USED_CREDIT_CARD_NUMBER), + GetErrorLabelForType(autofill::CREDIT_CARD_NUMBER)); + + // Now fix it. + ASSERT_NE(base::ASCIIToUTF16("4111111111111129"), card.number()); + SetEditorTextfieldValue(base::ASCIIToUTF16("4111111111111129"), + autofill::CREDIT_CARD_NUMBER); + EXPECT_FALSE(textfield->invalid()); +} + IN_PROC_BROWSER_TEST_F(PaymentRequestCreditCardEditorTest, EnteringEmptyData) { InvokePaymentRequestUI();
diff --git a/chrome/browser/ui/views/payments/payment_request_row_view.cc b/chrome/browser/ui/views/payments/payment_request_row_view.cc index 82b6a5b..bc138a1 100644 --- a/chrome/browser/ui/views/payments/payment_request_row_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_row_view.cc
@@ -38,7 +38,7 @@ } void PaymentRequestRowView::HideBottomSeparator() { - SetBorder(views::NullBorder()); + SetBorder(views::CreateEmptyBorder(insets_)); } void PaymentRequestRowView::SetIsHighlighted(bool highlighted) {
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc index d707c3b..650e5c9 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -168,9 +168,11 @@ void BrowserActionsContainer::RemoveViewForAction( ToolbarActionViewController* action) { + std::unique_ptr<ToolbarActionView> view; for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); iter != toolbar_action_views_.end(); ++iter) { if ((*iter)->view_controller() == action) { + std::swap(view, *iter); toolbar_action_views_.erase(iter); break; }
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index 761fd55..444478c 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -499,7 +499,8 @@ SkColor color_background = tp.HasCustomImage(IDR_THEME_NTP_BACKGROUND) ? GetThemeColor(tp, ThemeProperties::COLOR_NTP_BACKGROUND) - : SkColorSetRGB(0x32, 0x32, 0x32); + : ThemeProperties::GetDefaultColor( + ThemeProperties::COLOR_NTP_BACKGROUND, true /* incognito */); // Generate the replacements. ui::TemplateReplacements substitutions;
diff --git a/chromecast/tools/build/generate_test_lists.py b/chromecast/tools/build/generate_test_lists.py index a727628..a92d952f 100755 --- a/chromecast/tools/build/generate_test_lists.py +++ b/chromecast/tools/build/generate_test_lists.py
@@ -71,7 +71,7 @@ test_filters = GetTestFilters(test_files_dir, test_names, include_filters) test_commands = [ "{} {} {}".format(test_name, - additional_runtime_options, + additional_runtime_options or "", test_filters.get(test_name, "")) for test_name in test_names ] @@ -162,7 +162,7 @@ list_output_file = options.list_output_file deps_output_file = options.deps_output_file test_files_dir = options.test_files_dir - additional_runtime_options = options.additional_runtime_options or "" + additional_runtime_options = options.additional_runtime_options if len(inputs) < 1: parser.error("No command given.\n")
diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc index 8f672874..e25de68 100644 --- a/chromeos/dbus/dbus_thread_manager.cc +++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -41,6 +41,7 @@ #include "chromeos/dbus/sms_client.h" #include "chromeos/dbus/system_clock_client.h" #include "chromeos/dbus/update_engine_client.h" +#include "chromeos/dbus/upstart_client.h" #include "dbus/bus.h" #include "dbus/dbus_statistics.h" @@ -416,4 +417,10 @@ std::move(client); } +void DBusThreadManagerSetter::SetUpstartClient( + std::unique_ptr<UpstartClient> client) { + DBusThreadManager::Get()->clients_browser_->upstart_client_ = + std::move(client); +} + } // namespace chromeos
diff --git a/chromeos/dbus/dbus_thread_manager.h b/chromeos/dbus/dbus_thread_manager.h index 49671319..c7f793d 100644 --- a/chromeos/dbus/dbus_thread_manager.h +++ b/chromeos/dbus/dbus_thread_manager.h
@@ -200,6 +200,7 @@ void SetPowerManagerClient(std::unique_ptr<PowerManagerClient> client); void SetSessionManagerClient(std::unique_ptr<SessionManagerClient> client); void SetUpdateEngineClient(std::unique_ptr<UpdateEngineClient> client); + void SetUpstartClient(std::unique_ptr<UpstartClient> client); private: friend class DBusThreadManager;
diff --git a/chromeos/dbus/proto/media_perception.proto b/chromeos/dbus/proto/media_perception.proto index c7b78704..c14ef236 100644 --- a/chromeos/dbus/proto/media_perception.proto +++ b/chromeos/dbus/proto/media_perception.proto
@@ -31,11 +31,10 @@ message State { enum Status { STATUS_UNSPECIFIED = 0; // Unused required default value for Proto enums. - TIMEOUT = 1; // Unable to reach media analysis process. - UNINITIALIZED = 2; // Media analytics working on loading configuration. - STARTED = 3; // Analysis process running but not recieving frames. - RUNNING = 4; // Analysis process running and injesting frames. - SUSPENDED = 5; // Media analytics process waiting to be started. + UNINITIALIZED = 1; // Media analytics working on loading configuration. + STARTED = 2; // Analysis process running but not recieving frames. + RUNNING = 3; // Analysis process running and injesting frames. + SUSPENDED = 4; // Media analytics process waiting to be started. } // Note: RUNNING and SUSPENDED are the only two states which should be sent to
diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc index f9ecf5af..58c1795 100644 --- a/components/autofill/core/browser/autofill_experiments.cc +++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -35,8 +35,8 @@ "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kAutofillUpstreamRequestCvcIfMissing{ "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kAutofillUpstreamUseAutofillProfileComparatorForName{ - "AutofillUpstreamUseAutofillProfileComparatorForName", +const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ + "AutofillUpstreamUseAutofillProfileComparator", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ "AutofillUpstreamUseNotRecentlyUsedAutofillProfile",
diff --git a/components/autofill/core/browser/autofill_experiments.h b/components/autofill/core/browser/autofill_experiments.h index 6a646c8f..955b370 100644 --- a/components/autofill/core/browser/autofill_experiments.h +++ b/components/autofill/core/browser/autofill_experiments.h
@@ -30,7 +30,7 @@ extern const base::Feature kAutofillCreditCardPopupLayout; extern const base::Feature kAutofillCreditCardLastUsedDateDisplay; extern const base::Feature kAutofillUpstreamRequestCvcIfMissing; -extern const base::Feature kAutofillUpstreamUseAutofillProfileComparatorForName; +extern const base::Feature kAutofillUpstreamUseAutofillProfileComparator; extern const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile; extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; extern const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[];
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index f39e14a..bf1b3bb 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -1381,6 +1381,12 @@ *rappor_metric_name = "Autofill.CardUploadNotOfferedNoAddress"; } + std::unique_ptr<AutofillProfileComparator> comparator; + if (!candidate_profiles.empty() && + (base::FeatureList::IsEnabled( + kAutofillUpstreamUseAutofillProfileComparator))) + comparator = base::MakeUnique<AutofillProfileComparator>(app_locale_); + // If any of the names on the card or the addresses don't match the // candidate set is invalid. This matches the rules for name matching applied // server-side by Google Payments and ensures that we don't send upload @@ -1393,20 +1399,19 @@ } else { bool found_conflicting_names = false; if (base::FeatureList::IsEnabled( - kAutofillUpstreamUseAutofillProfileComparatorForName)) { + kAutofillUpstreamUseAutofillProfileComparator)) { upload_request->active_experiments.push_back( - kAutofillUpstreamUseAutofillProfileComparatorForName.name); - AutofillProfileComparator comparator(app_locale_); - verified_name = comparator.NormalizeForComparison(card_name); + kAutofillUpstreamUseAutofillProfileComparator.name); + verified_name = comparator->NormalizeForComparison(card_name); for (const AutofillProfile& profile : candidate_profiles) { - const base::string16 address_name = comparator.NormalizeForComparison( + const base::string16 address_name = comparator->NormalizeForComparison( profile.GetInfo(AutofillType(NAME_FULL), app_locale_)); if (address_name.empty()) continue; if (verified_name.empty() || - comparator.IsNameVariantOf(address_name, verified_name)) { + comparator->IsNameVariantOf(address_name, verified_name)) { verified_name = address_name; - } else if (!comparator.IsNameVariantOf(verified_name, address_name)) { + } else if (!comparator->IsNameVariantOf(verified_name, address_name)) { found_conflicting_names = true; break; } @@ -1445,14 +1450,34 @@ // If any of the candidate addresses have a non-empty zip that doesn't match // any other non-empty zip, then the candidate set is invalid. + const bool use_autofill_profile_comparator_for_zip = + base::FeatureList::IsEnabled( + kAutofillUpstreamUseAutofillProfileComparator); base::string16 verified_zip; + base::string16 normalized_verified_zip; + const AutofillType kZipCode(ADDRESS_HOME_ZIP); for (const AutofillProfile& profile : candidate_profiles) { - // TODO(jdonnelly): Use GetInfo instead of GetRawInfo once zip codes are - // canonicalized. See http://crbug.com/587465. - const base::string16 zip = profile.GetRawInfo(ADDRESS_HOME_ZIP); + const base::string16 zip = use_autofill_profile_comparator_for_zip + ? profile.GetInfo(kZipCode, app_locale_) + : profile.GetRawInfo(ADDRESS_HOME_ZIP); + const base::string16 normalized_zip = + use_autofill_profile_comparator_for_zip + ? comparator->NormalizeForComparison( + zip, AutofillProfileComparator::DISCARD_WHITESPACE) + : base::string16(); if (!zip.empty()) { if (verified_zip.empty()) { verified_zip = zip; + normalized_verified_zip = normalized_zip; + } else if (use_autofill_profile_comparator_for_zip) { + if (normalized_zip.find(normalized_verified_zip) == + base::string16::npos && + normalized_verified_zip.find(normalized_zip) == + base::string16::npos) { + upload_decision_metrics |= + AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_ZIPS; + break; + } } else { // To compare two zips, we check to see if either is a prefix of the // other. This allows us to consider a 5-digit zip and a zip+4 to be a
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index 778a395..f94bd81 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -1075,9 +1075,9 @@ kAutofillUpstreamRequestCvcIfMissing); } - void DisableAutofillUpstreamUseAutofillProfileComparatorForName() { + void DisableAutofillUpstreamUseAutofillProfileComparator() { scoped_feature_list_.InitAndDisableFeature( - kAutofillUpstreamUseAutofillProfileComparatorForName); + kAutofillUpstreamUseAutofillProfileComparator); } void ExpectUniqueFillableFormParsedUkm() { @@ -4658,9 +4658,9 @@ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0); FormSubmitted(credit_card_form); EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); - EXPECT_THAT(autofill_manager_->GetActiveExperiments(), - UnorderedElementsAre( - kAutofillUpstreamUseAutofillProfileComparatorForName.name)); + EXPECT_THAT( + autofill_manager_->GetActiveExperiments(), + UnorderedElementsAre(kAutofillUpstreamUseAutofillProfileComparator.name)); // Server did not send a server_id, expect copy of card is not stored. EXPECT_TRUE(autofill_manager_->GetCreditCards().empty()); @@ -4710,9 +4710,9 @@ FormSubmitted(credit_card_form); EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); // Submitted form included CVC, so user did not need to enter CVC. - EXPECT_THAT(autofill_manager_->GetActiveExperiments(), - UnorderedElementsAre( - kAutofillUpstreamUseAutofillProfileComparatorForName.name)); + EXPECT_THAT( + autofill_manager_->GetActiveExperiments(), + UnorderedElementsAre(kAutofillUpstreamUseAutofillProfileComparator.name)); } TEST_F(AutofillManagerTest, UploadCreditCardAndSaveCopy) { @@ -5241,10 +5241,10 @@ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0); FormSubmitted(credit_card_form); EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); - EXPECT_THAT(autofill_manager_->GetActiveExperiments(), - UnorderedElementsAre( - kAutofillUpstreamUseAutofillProfileComparatorForName.name, - kAutofillUpstreamRequestCvcIfMissing.name)); + EXPECT_THAT( + autofill_manager_->GetActiveExperiments(), + UnorderedElementsAre(kAutofillUpstreamUseAutofillProfileComparator.name, + kAutofillUpstreamRequestCvcIfMissing.name)); // Verify that the correct histogram entries were logged. ExpectCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED); @@ -5464,7 +5464,7 @@ EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); EXPECT_THAT(autofill_manager_->GetActiveExperiments(), UnorderedElementsAre( - kAutofillUpstreamUseAutofillProfileComparatorForName.name, + kAutofillUpstreamUseAutofillProfileComparator.name, kAutofillUpstreamUseNotRecentlyUsedAutofillProfile.name)); // Verify that the correct histogram entry (and only that) was logged. @@ -5620,6 +5620,90 @@ AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_ZIPS); } +TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesDiscardWhitespace) { + personal_data_.ClearAutofillProfiles(); + autofill_manager_->set_credit_card_upload_enabled(true); + + // Create, fill and submit two address forms with different zip codes. + FormData address_form1, address_form2; + test::CreateTestAddressFormData(&address_form1); + test::CreateTestAddressFormData(&address_form2); + + FormsSeen({address_form1, address_form2}); + + ManuallyFillAddressForm("Flo", "Master", "H3B2Y5", "CA", &address_form1); + FormSubmitted(address_form1); + + ManuallyFillAddressForm("Flo", "Master", "h3b 2y5", "CA", &address_form2); + FormSubmitted(address_form2); + + // Set up our credit card form data. + FormData credit_card_form; + CreateTestCreditCardFormData(&credit_card_form, true, false); + FormsSeen({credit_card_form}); + + // Edit the data, but don't include a name, and submit. + credit_card_form.fields[0].value = ASCIIToUTF16("Flo Master"); + credit_card_form.fields[1].value = ASCIIToUTF16("4111111111111111"); + credit_card_form.fields[2].value = ASCIIToUTF16("11"); + credit_card_form.fields[3].value = ASCIIToUTF16("2017"); + credit_card_form.fields[4].value = ASCIIToUTF16("123"); + + base::HistogramTester histogram_tester; + + // Zips match because we discard whitespace before comparison. + EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0); + FormSubmitted(credit_card_form); + EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); + + // Verify that the correct histogram entry (and only that) was logged. + ExpectUniqueCardUploadDecision(histogram_tester, + AutofillMetrics::UPLOAD_OFFERED); +} + +TEST_F(AutofillManagerTest, + UploadCreditCard_ZipCodesDiscardWhitespace_DisableComparator) { + DisableAutofillUpstreamUseAutofillProfileComparator(); + personal_data_.ClearAutofillProfiles(); + autofill_manager_->set_credit_card_upload_enabled(true); + + // Create, fill and submit two address forms with different zip codes. + FormData address_form1, address_form2; + test::CreateTestAddressFormData(&address_form1); + test::CreateTestAddressFormData(&address_form2); + + FormsSeen({address_form1, address_form2}); + + ManuallyFillAddressForm("Flo", "Master", "H3B2Y5", "CA", &address_form1); + FormSubmitted(address_form1); + + ManuallyFillAddressForm("Flo", "Master", "h3b 2y5", "CA", &address_form2); + FormSubmitted(address_form2); + + // Set up our credit card form data. + FormData credit_card_form; + CreateTestCreditCardFormData(&credit_card_form, true, false); + FormsSeen({credit_card_form}); + + // Edit the data, but don't include a name, and submit. + credit_card_form.fields[0].value = ASCIIToUTF16("Flo Master"); + credit_card_form.fields[1].value = ASCIIToUTF16("4111111111111111"); + credit_card_form.fields[2].value = ASCIIToUTF16("11"); + credit_card_form.fields[3].value = ASCIIToUTF16("2017"); + credit_card_form.fields[4].value = ASCIIToUTF16("123"); + + base::HistogramTester histogram_tester; + + // Neither a local save nor an upload should happen in this case. + EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0); + FormSubmitted(credit_card_form); + EXPECT_FALSE(autofill_manager_->credit_card_was_uploaded()); + + // Verify that the correct histogram entry (and only that) was logged. + ExpectUniqueCardUploadDecision( + histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_ZIPS); +} + TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesHavePrefixMatch) { personal_data_.ClearAutofillProfiles(); autofill_manager_->set_credit_card_upload_enabled(true); @@ -5758,7 +5842,7 @@ TEST_F(AutofillManagerTest, UploadCreditCard_CCFormHasMiddleInitial_DisableComparator) { - DisableAutofillUpstreamUseAutofillProfileComparatorForName(); + DisableAutofillUpstreamUseAutofillProfileComparator(); personal_data_.ClearAutofillProfiles(); autofill_manager_->set_credit_card_upload_enabled(true); @@ -5846,7 +5930,7 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoMiddleInitialInCCForm_DisableComparator) { - DisableAutofillUpstreamUseAutofillProfileComparatorForName(); + DisableAutofillUpstreamUseAutofillProfileComparator(); personal_data_.ClearAutofillProfiles(); autofill_manager_->set_credit_card_upload_enabled(true); @@ -5925,7 +6009,7 @@ TEST_F(AutofillManagerTest, UploadCreditCard_CCFormHasMiddleName_DisableComparator) { - DisableAutofillUpstreamUseAutofillProfileComparatorForName(); + DisableAutofillUpstreamUseAutofillProfileComparator(); personal_data_.ClearAutofillProfiles(); autofill_manager_->set_credit_card_upload_enabled(true); @@ -6154,9 +6238,9 @@ FormSubmitted(credit_card_form); EXPECT_TRUE(autofill_manager_->credit_card_was_uploaded()); // Recently used profile was available, so did not need to use old profile. - EXPECT_THAT(autofill_manager_->GetActiveExperiments(), - UnorderedElementsAre( - kAutofillUpstreamUseAutofillProfileComparatorForName.name)); + EXPECT_THAT( + autofill_manager_->GetActiveExperiments(), + UnorderedElementsAre(kAutofillUpstreamUseAutofillProfileComparator.name)); // Verify that the correct histogram entry (and only that) was logged. ExpectUniqueCardUploadDecision(histogram_tester, @@ -6165,7 +6249,7 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NamesHaveToMatch_DisableComparator) { - DisableAutofillUpstreamUseAutofillProfileComparatorForName(); + DisableAutofillUpstreamUseAutofillProfileComparator(); personal_data_.ClearAutofillProfiles(); autofill_manager_->set_credit_card_upload_enabled(true);
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index 05fdec3..8039bc4 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -762,6 +762,18 @@ return iter != credit_cards.end() ? *iter : nullptr; } +CreditCard* PersonalDataManager::GetCreditCardByNumber( + const std::string& number) { + CreditCard numbered_card; + numbered_card.SetNumber(base::ASCIIToUTF16(number)); + for (CreditCard* credit_card : GetCreditCards()) { + DCHECK(credit_card); + if (credit_card->HasSameNumberAs(numbered_card)) + return credit_card; + } + return nullptr; +} + void PersonalDataManager::GetNonEmptyTypes( ServerFieldTypeSet* non_empty_types) { for (AutofillProfile* profile : GetProfiles())
diff --git a/components/autofill/core/browser/personal_data_manager.h b/components/autofill/core/browser/personal_data_manager.h index c2ca03c..ac29f28 100644 --- a/components/autofill/core/browser/personal_data_manager.h +++ b/components/autofill/core/browser/personal_data_manager.h
@@ -184,6 +184,10 @@ // no credit card with the specified |guid|. virtual CreditCard* GetCreditCardByGUID(const std::string& guid); + // Returns the credit card with the specified |number|, or nullptr if there is + // no credit card with the specified |number|. + virtual CreditCard* GetCreditCardByNumber(const std::string& number); + // Gets the field types availabe in the stored address and credit card data. void GetNonEmptyTypes(ServerFieldTypeSet* non_empty_types);
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc index dc203b9..ac94524 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
@@ -180,22 +180,6 @@ headers->RemoveHeader(chrome_proxy_accept_transform_header()); } -void ContentLoFiDecider::MaybeSetIgnorePreviewsBlacklistDirective( - net::HttpRequestHeaders* headers) const { - if (!headers || !params::AreLitePagesEnabledViaFlags() || - !IsLitePagePreviewRequested(*headers)) { - return; - } - std::string chrome_proxy_header_value; - headers->GetHeader(chrome_proxy_header(), &chrome_proxy_header_value); - headers->RemoveHeader(chrome_proxy_header()); - if (!chrome_proxy_header_value.empty()) - chrome_proxy_header_value += ", "; - chrome_proxy_header_value += - chrome_proxy_lite_page_ignore_blacklist_directive(); - headers->SetHeader(chrome_proxy_header(), chrome_proxy_header_value); -} - bool ContentLoFiDecider::ShouldRecordLoFiUMA( const net::URLRequest& request) const { const content::ResourceRequestInfo* request_info =
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider.h b/components/data_reduction_proxy/content/browser/content_lofi_decider.h index b94a336..327278e 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_decider.h +++ b/components/data_reduction_proxy/content/browser/content_lofi_decider.h
@@ -38,8 +38,6 @@ const net::HttpRequestHeaders& headers) const override; void RemoveAcceptTransformHeader( net::HttpRequestHeaders* headers) const override; - void MaybeSetIgnorePreviewsBlacklistDirective( - net::HttpRequestHeaders* headers) const override; bool ShouldRecordLoFiUMA(const net::URLRequest& request) const override; bool IsClientLoFiImageRequest(const net::URLRequest& request) const override; bool IsClientLoFiAutoReloadRequest(
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc index 9405f8dc..d033a521 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
@@ -203,18 +203,6 @@ header_value.find(compressed_video_directive()) != std::string::npos); } - static void VerifyLitePageIgnoreBlacklistHeader( - bool expected_blacklist_directive_added, - const net::HttpRequestHeaders& headers) { - EXPECT_TRUE(headers.HasHeader(chrome_proxy_header())); - std::string header_value; - headers.GetHeader(chrome_proxy_header(), &header_value); - EXPECT_EQ(expected_blacklist_directive_added, - header_value.find( - chrome_proxy_lite_page_ignore_blacklist_directive()) != - std::string::npos); - } - protected: base::MessageLoopForIO message_loop_; net::TestURLRequestContext context_; @@ -258,8 +246,6 @@ NotifyBeforeSendHeaders(&headers, request.get(), true); VerifyLoFiHeader(false, false, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); - // The Lo-Fi flag is "always-on", Lo-Fi is being used, and it's a main frame // request. Lo-Fi or lite page header should be added. command_line->AppendSwitchASCII( @@ -273,8 +259,6 @@ headers); VerifyLitePageHeader(tests[i].is_using_lite_page && tests[i].is_main_frame, false, headers); - VerifyLitePageIgnoreBlacklistHeader( - tests[i].is_using_lite_page && tests[i].is_main_frame, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); // |lofi_requested| should be set to false when Lo-Fi is enabled using // flags. @@ -289,7 +273,6 @@ VerifyLoFiHeader(!tests[i].is_using_lite_page, !tests[i].is_using_lofi, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); // The Lo-Fi flag is "cellular-only" and Lo-Fi is being used. Lo-Fi header // should be added. @@ -301,7 +284,6 @@ VerifyLoFiHeader(!tests[i].is_using_lite_page, !tests[i].is_using_lofi, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); data = DataReductionProxyData::GetData(*request); // |lofi_requested| should be set to false when Lo-Fi is enabled using // flags. @@ -317,7 +299,6 @@ VerifyLoFiHeader(!tests[i].is_using_lite_page, !tests[i].is_using_lofi, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); data = DataReductionProxyData::GetData(*request); // |lofi_requested| should be set to false when Lo-Fi is enabled using // flags. @@ -393,7 +374,6 @@ VerifyLoFiHeader(is_lofi_resource_type, !tests[i].is_using_lofi, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); EXPECT_EQ(tests[i].is_using_lofi, data->lofi_requested()) << i; } @@ -417,7 +397,6 @@ NotifyBeforeSendHeaders(&headers, request.get(), true); VerifyLoFiHeader(false, false, headers); VerifyLitePageHeader(false, false, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); EXPECT_EQ(tests[i].is_using_lofi, data->lofi_requested()) << i; } @@ -445,7 +424,6 @@ VerifyLoFiHeader(false, false, headers); VerifyLitePageHeader(tests[i].is_main_frame, !tests[i].is_using_lite_page, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); EXPECT_EQ(tests[i].is_using_lite_page, data->lofi_requested()) << i; } @@ -489,7 +467,6 @@ VerifyLitePageHeader(tests[i].is_main_frame, tests[i].is_main_frame && !tests[i].is_using_lite_page, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); EXPECT_EQ(tests[i].is_using_lofi || tests[i].is_using_lite_page, data->lofi_requested()) @@ -529,7 +506,6 @@ VerifyLitePageHeader(tests[i].is_main_frame, tests[i].is_main_frame && !tests[i].is_using_lite_page, headers); - VerifyLitePageIgnoreBlacklistHeader(false, headers); DataReductionProxyData* data = DataReductionProxyData::GetData(*request); EXPECT_EQ(tests[i].is_using_lofi || tests[i].is_using_lite_page, data->lofi_requested()) @@ -749,40 +725,6 @@ EXPECT_FALSE(headers.HasHeader(chrome_proxy_accept_transform_header())); } -TEST_F(ContentLoFiDeciderTest, MaybeIgnoreBlacklist) { - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - command_line->InitFromArgv(command_line->argv()); - std::unique_ptr<data_reduction_proxy::ContentLoFiDecider> lofi_decider( - new data_reduction_proxy::ContentLoFiDecider()); - net::HttpRequestHeaders headers; - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(&headers); - EXPECT_FALSE(headers.HasHeader(chrome_proxy_header())); - - headers.SetHeader(chrome_proxy_header(), "Foo"); - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(&headers); - std::string header_value; - headers.GetHeader(chrome_proxy_header(), &header_value); - EXPECT_EQ("Foo", header_value); - - headers.RemoveHeader(chrome_proxy_header()); - command_line->AppendSwitch(switches::kEnableDataReductionProxyLitePage); - headers.SetHeader(chrome_proxy_accept_transform_header(), "empty-image"); - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(&headers); - EXPECT_FALSE(headers.HasHeader(chrome_proxy_header())); - - headers.SetHeader(chrome_proxy_accept_transform_header(), "lite-page"); - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(&headers); - EXPECT_TRUE(headers.HasHeader(chrome_proxy_header())); - headers.GetHeader(chrome_proxy_header(), &header_value); - EXPECT_EQ("exp=ignore_preview_blacklist", header_value); - - headers.SetHeader(chrome_proxy_header(), "Foo"); - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(&headers); - EXPECT_TRUE(headers.HasHeader(chrome_proxy_header())); - headers.GetHeader(chrome_proxy_header(), &header_value); - EXPECT_EQ("Foo, exp=ignore_preview_blacklist", header_value); -} - TEST_F(ContentLoFiDeciderTest, NoTransformDoesNotAddHeader) { base::FieldTrialList field_trial_list(nullptr); base::FieldTrialList::CreateFieldTrial(params::GetLoFiFieldTrialName(),
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc index ab74535..d444fbf 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -11,6 +11,7 @@ #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/time/time.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h" @@ -172,8 +173,17 @@ void VerifyHttpRequestHeaders(bool via_chrome_proxy, const net::HttpRequestHeaders& headers) { if (via_chrome_proxy) { - DCHECK(headers.HasHeader(chrome_proxy_header())); DCHECK(headers.HasHeader(chrome_proxy_ect_header())); + std::string chrome_proxy_header_value; + DCHECK( + headers.GetHeader(chrome_proxy_header(), &chrome_proxy_header_value)); + // Check that only 1 "exp" directive is sent. + DCHECK_GT(3u, base::SplitStringUsingSubstr(chrome_proxy_header_value, + "exp=", base::TRIM_WHITESPACE, + base::SPLIT_WANT_ALL) + .size()); + // Silence unused variable warning in release builds. + (void)chrome_proxy_header_value; } else { DCHECK(!headers.HasHeader(chrome_proxy_header())); DCHECK(!headers.HasHeader(chrome_proxy_accept_transform_header())); @@ -374,8 +384,6 @@ data_reduction_proxy_request_options_->AddRequestHeader(headers, page_id); - if (lofi_decider) - lofi_decider->MaybeSetIgnorePreviewsBlacklistDirective(headers); VerifyHttpRequestHeaders(true, *headers); }
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc index 5d7b2ba..0ce423d 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -194,9 +194,6 @@ headers->RemoveHeader(chrome_proxy_accept_transform_header()); } - void MaybeSetIgnorePreviewsBlacklistDirective( - net::HttpRequestHeaders* headers) const override {} - bool ShouldRecordLoFiUMA(const net::URLRequest& request) const override { return should_request_lofi_resource_; }
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc index 470a675..ebf24e16 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
@@ -17,6 +17,7 @@ #include "base/time/time.h" #include "build/build_config.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h" +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h" @@ -100,12 +101,13 @@ } void DataReductionProxyRequestOptions::UpdateExperiments() { - // TODO(bengr): Simplify this so there's only one way to set experiment via - // flags. See crbug.com/656195. + experiments_.clear(); std::string experiments = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( data_reduction_proxy::switches::kDataReductionProxyExperiment); + // The command line override takes precedence over field trial "exp" + // directives. if (!experiments.empty()) { base::StringTokenizer experiment_tokenizer(experiments, ", "); experiment_tokenizer.set_quote_chars("\""); @@ -113,7 +115,11 @@ if (!experiment_tokenizer.token().empty()) experiments_.push_back(experiment_tokenizer.token()); } + } else if (params::AreLitePagesEnabledViaFlags()) { + experiments_.push_back(chrome_proxy_lite_page_ignore_blacklist()); } else { + // If no other "exp" directive is forced by flags, add the field trial + // value. AddServerExperimentFromFieldTrial(); }
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc index 73a2390..82d2d83f 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
@@ -331,6 +331,56 @@ } } +TEST_F(DataReductionProxyRequestOptionsTest, TestExperimentPrecedence) { + // Tests that combinations of configurations that trigger "exp=" directive in + // the Chrome-Proxy header have the right precendence, and only append a value + // for the highest priority value. + + // Field trial has the lowest priority. + std::map<std::string, std::string> server_experiment; + server_experiment["exp"] = "foo"; + ASSERT_TRUE(variations::AssociateVariationParams( + params::GetServerExperimentsFieldTrialName(), "enabled", + server_experiment)); + + base::FieldTrialList field_trial_list(nullptr); + base::FieldTrialList::CreateFieldTrial( + params::GetServerExperimentsFieldTrialName(), "enabled"); + std::vector<std::string> expected_experiments; + expected_experiments.push_back("foo"); + std::string expected_header; + SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), + kClientStr, kExpectedBuild, kExpectedPatch, kPageId, + expected_experiments, &expected_header); + CreateRequestOptions(kVersion); + VerifyExpectedHeader(expected_header, kPageIdValue); + + // "ignore_preview_blacklist" has the next lowest priority. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDataReductionProxyLoFi, + switches::kDataReductionProxyLoFiValueAlwaysOn); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableDataReductionProxyLitePage); + expected_experiments.clear(); + expected_experiments.push_back(chrome_proxy_lite_page_ignore_blacklist()); + SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), + kClientStr, kExpectedBuild, kExpectedPatch, kPageId, + expected_experiments, &expected_header); + CreateRequestOptions(kVersion); + VerifyExpectedHeader(expected_header, kPageIdValue); + + // Setting the experiment explicitly has the highest priority. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + data_reduction_proxy::switches::kDataReductionProxyExperiment, "bar"); + expected_experiments.clear(); + expected_experiments.push_back("bar"); + SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), + kClientStr, kExpectedBuild, kExpectedPatch, kPageId, + expected_experiments, &expected_header); + CreateRequestOptions(kVersion); + VerifyExpectedHeader(expected_header, kPageIdValue); +} + TEST_F(DataReductionProxyRequestOptionsTest, GetSessionKeyFromRequestHeaders) { const struct { std::string chrome_proxy_header_key;
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc index d8a0219..3a8d596 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.cc
@@ -46,8 +46,7 @@ // The legacy Chrome-Proxy response header directive for LoFi images. const char kLegacyChromeProxyLoFiResponseDirective[] = "q=low"; -const char kChromeProxyLitePageIngoreBlacklistDirective[] = - "exp=ignore_preview_blacklist"; +const char kChromeProxyLitePageIngoreBlacklist[] = "ignore_preview_blacklist"; const char kIfHeavyQualifier[] = "if-heavy"; @@ -155,8 +154,8 @@ return kIdentityDirective; } -const char* chrome_proxy_lite_page_ignore_blacklist_directive() { - return kChromeProxyLitePageIngoreBlacklistDirective; +const char* chrome_proxy_lite_page_ignore_blacklist() { + return kChromeProxyLitePageIngoreBlacklist; } const char* if_heavy_qualifier() {
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h index 360914e..7892766 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h
@@ -98,9 +98,9 @@ // preview requests and responses. const char* chrome_proxy_lite_page_directive(); -// Gets the Chrome-Proxy directive used by data reduction proxy lite page -// preview experiment to ignore the blacklist. -const char* chrome_proxy_lite_page_ignore_blacklist_directive(); +// Gets the Chrome-Proxy "exp" directive value used by data reduction proxy lite +// page preview experiment to ignore the blacklist. +const char* chrome_proxy_lite_page_ignore_blacklist(); // Requests a transformation only if the server determines that the page is // otherwise heavy (i.e., the associated page load ordinarily requires the
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc index 82dc96a2..4877fac 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc
@@ -18,6 +18,10 @@ // Proxy field trials. const char kDataReductionProxyExperiment[] = "data-reduction-proxy-experiment"; +// The Chrome-Proxy "exp" directive value used by data reduction proxy to +// receive an alternative back end implementation. +const char kDataReductionProxyServerAlternative[] = "alternative"; + // The origin of the data reduction proxy fallback. const char kDataReductionProxyFallback[] = "spdy-proxy-auth-fallback";
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h index cbc063d..0773ba8 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h
@@ -11,6 +11,7 @@ // All switches in alphabetical order. The switches should be documented // alongside the definition of their values in the .cc file. +extern const char kDataReductionPingbackURL[]; extern const char kDataReductionProxy[]; extern const char kDataReductionProxyConfigURL[]; extern const char kDataReductionProxyExperiment[]; @@ -22,9 +23,9 @@ extern const char kDataReductionProxyLoFiValueCellularOnly[]; extern const char kDataReductionProxyLoFiValueDisabled[]; extern const char kDataReductionProxyLoFiValueSlowConnectionsOnly[]; -extern const char kDataReductionPingbackURL[]; extern const char kDataReductionProxySecureProxyCheckURL[]; extern const char kDataReductionProxyServerExperimentsDisabled[]; +extern const char kDataReductionProxyServerAlternative[]; extern const char kDataReductionProxyWarmupURL[]; extern const char kEnableDataReductionProxy[]; extern const char kEnableDataReductionProxyBypassWarning[];
diff --git a/components/data_reduction_proxy/core/common/lofi_decider.h b/components/data_reduction_proxy/core/common/lofi_decider.h index 867ecf50..61ce466 100644 --- a/components/data_reduction_proxy/core/common/lofi_decider.h +++ b/components/data_reduction_proxy/core/common/lofi_decider.h
@@ -54,11 +54,6 @@ virtual void RemoveAcceptTransformHeader( net::HttpRequestHeaders* headers) const = 0; - // Adds a directive to tell the server to ignore blacklists when a Lite Page - // preview is being requested due to command line flags being set. - virtual void MaybeSetIgnorePreviewsBlacklistDirective( - net::HttpRequestHeaders* headers) const = 0; - // Returns true if the Lo-Fi specific UMA should be recorded. It is set to // true if Lo-Fi is enabled for |request|, Chrome session is in Lo-Fi // Enabled or Control field trial, and the network quality was slow.
diff --git a/components/metrics/leak_detector/BUILD.gn b/components/metrics/leak_detector/BUILD.gn index 3cd771b..0e135201 100644 --- a/components/metrics/leak_detector/BUILD.gn +++ b/components/metrics/leak_detector/BUILD.gn
@@ -40,9 +40,6 @@ sources = [ "leak_detector.mojom", ] - - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false } source_set("unit_tests") {
diff --git a/components/payments_strings.grdp b/components/payments_strings.grdp index 23cb150..974c7a7 100644 --- a/components/payments_strings.grdp +++ b/components/payments_strings.grdp
@@ -161,6 +161,9 @@ <message name="IDS_PAYMENTS_VALIDATION_UNSUPPORTED_CREDIT_CARD_TYPE" desc="Message displayed to user when the credit card type (e.g visa, mastercard) is not supported for this transaction."> This type of card isn’t supported </message> + <message name="IDS_PAYMENTS_VALIDATION_ALREADY_USED_CREDIT_CARD_NUMBER" desc="Message displayed to user when the credit card number they have entered corresponds to an existing credit card number in their user profile."> + This card number is already used + </message> <message name="IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE" desc="The text that informs the user that '*' character indicates an input field that is required. The '*' character should not be changed." formatter_data="android_java"> * Field is required </message>
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 973c1b3..12180ff 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -187,7 +187,7 @@ } message PolicyFetchRequest { - reserved 5, 10; + reserved 5; // This is the policy type, which maps to D3 policy type internally. // By convention, we use "/" as separator to create policy namespace. @@ -280,6 +280,8 @@ // This message is included in serialized form in PolicyFetchResponse below. It // may also be signed, with the signature being created for the serialized form. message PolicyData { + reserved 10; + // See PolicyFetchRequest.policy_type. optional string policy_type = 1;
diff --git a/components/viz/frame_sinks/gpu_compositor_frame_sink.cc b/components/viz/frame_sinks/gpu_compositor_frame_sink.cc index dd020e3..a2b6007 100644 --- a/components/viz/frame_sinks/gpu_compositor_frame_sink.cc +++ b/components/viz/frame_sinks/gpu_compositor_frame_sink.cc
@@ -47,7 +47,10 @@ void GpuCompositorFrameSink::SubmitCompositorFrame( const cc::LocalSurfaceId& local_surface_id, cc::CompositorFrame frame) { - support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { + compositor_frame_sink_binding_.Close(); + OnClientConnectionLost(); + } } void GpuCompositorFrameSink::DidNotProduceFrame(
diff --git a/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc b/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc index 850b6c7b..393f53f 100644 --- a/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc +++ b/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc
@@ -86,7 +86,10 @@ void GpuRootCompositorFrameSink::SubmitCompositorFrame( const cc::LocalSurfaceId& local_surface_id, cc::CompositorFrame frame) { - support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { + compositor_frame_sink_binding_.Close(); + OnClientConnectionLost(); + } } void GpuRootCompositorFrameSink::DidNotProduceFrame(
diff --git a/content/browser/frame_host/navigation_handle_impl_browsertest.cc b/content/browser/frame_host/navigation_handle_impl_browsertest.cc index f4c4da0..69bd99de 100644 --- a/content/browser/frame_host/navigation_handle_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_handle_impl_browsertest.cc
@@ -8,6 +8,7 @@ #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" +#include "content/public/common/bindings_policy.h" #include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/content_switches.h" #include "content/public/common/request_context_type.h" @@ -1231,4 +1232,40 @@ } } +// Tests the case where a browser-initiated navigation to a normal webpage is +// blocked (net::ERR_BLOCKED_BY_CLIENT) while departing from a privileged WebUI +// page (chrome://gpu). It is a security risk for the error page to commit in +// the privileged process. +IN_PROC_BROWSER_TEST_F(PlzNavigateNavigationHandleImplBrowserTest, + BlockedRequestAfterWebUI) { + GURL web_ui_url("chrome://gpu"); + WebContents* web_contents = shell()->web_contents(); + + // Navigate to the initial page. + EXPECT_FALSE(web_contents->GetMainFrame()->GetEnabledBindings() & + BINDINGS_POLICY_WEB_UI); + EXPECT_TRUE(NavigateToURL(shell(), web_ui_url)); + EXPECT_TRUE(web_contents->GetMainFrame()->GetEnabledBindings() & + BINDINGS_POLICY_WEB_UI); + scoped_refptr<SiteInstance> web_ui_process = web_contents->GetSiteInstance(); + + // Start a new, non-webUI navigation that will be blocked by a + // NavigationThrottle. + GURL blocked_url("http://blocked-by-throttle.example.cc"); + TestNavigationThrottleInstaller installer( + web_contents, NavigationThrottle::BLOCK_REQUEST, + NavigationThrottle::PROCEED, NavigationThrottle::PROCEED); + NavigationHandleObserver commit_observer(web_contents, blocked_url); + EXPECT_FALSE(NavigateToURL(shell(), blocked_url)); + NavigationEntry* last_committed = + web_contents->GetController().GetLastCommittedEntry(); + EXPECT_TRUE(last_committed); + EXPECT_EQ(blocked_url, last_committed->GetVirtualURL()); + EXPECT_EQ(PAGE_TYPE_ERROR, last_committed->GetPageType()); + EXPECT_NE(web_ui_process.get(), web_contents->GetSiteInstance()); + EXPECT_TRUE(commit_observer.has_committed()); + EXPECT_TRUE(commit_observer.is_error()); + EXPECT_FALSE(commit_observer.is_renderer_initiated()); +} + } // namespace content
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc index 6ecee9eb..5e9dca92 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.cc +++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -368,7 +368,9 @@ current_surface_size_ = frame.render_pass_list.back()->output_rect.size(); current_surface_scale_factor_ = frame.metadata.device_scale_factor; - support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + DCHECK(result); has_frame_ = true; if (local_surface_id_ != local_surface_id || HasEmbedderChanged()) {
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 4617b46..b7827ed 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -54,6 +54,7 @@ BrowserThread::IO, FROM_HERE, base::Bind(&NavigationURLLoaderImplCore::Start, core_, resource_context, storage_partition->GetURLRequestContext(), + base::Unretained(storage_partition->GetFileSystemContext()), service_worker_handle_core, appcache_handle_core, base::Passed(&request_info), base::Passed(&navigation_ui_data)));
diff --git a/content/browser/loader/navigation_url_loader_impl_core.cc b/content/browser/loader/navigation_url_loader_impl_core.cc index e2fb9ad..ba4b415d 100644 --- a/content/browser/loader/navigation_url_loader_impl_core.cc +++ b/content/browser/loader/navigation_url_loader_impl_core.cc
@@ -22,6 +22,7 @@ #include "net/base/net_errors.h" #include "net/url_request/redirect_info.h" #include "net/url_request/url_request_context_getter.h" +#include "storage/browser/fileapi/file_system_context.h" namespace content { @@ -38,6 +39,7 @@ void NavigationURLLoaderImplCore::Start( ResourceContext* resource_context, net::URLRequestContextGetter* url_request_context_getter, + storage::FileSystemContext* upload_file_system_context, ServiceWorkerNavigationHandleCore* service_worker_handle_core, AppCacheNavigationHandleCore* appcache_handle_core, std::unique_ptr<NavigationRequestInfo> request_info, @@ -53,8 +55,9 @@ if (ResourceDispatcherHostImpl::Get()) { ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( resource_context, url_request_context_getter->GetURLRequestContext(), - *request_info, std::move(navigation_ui_data), this, - service_worker_handle_core, appcache_handle_core); + upload_file_system_context, *request_info, + std::move(navigation_ui_data), this, service_worker_handle_core, + appcache_handle_core); } }
diff --git a/content/browser/loader/navigation_url_loader_impl_core.h b/content/browser/loader/navigation_url_loader_impl_core.h index caa0f537..b4044b23 100644 --- a/content/browser/loader/navigation_url_loader_impl_core.h +++ b/content/browser/loader/navigation_url_loader_impl_core.h
@@ -17,6 +17,10 @@ struct RedirectInfo; } +namespace storage { +class FileSystemContext; +} + namespace content { class AppCacheNavigationHandleCore; @@ -45,6 +49,7 @@ // Starts the request. void Start(ResourceContext* resource_context, net::URLRequestContextGetter* url_request_context_getter, + storage::FileSystemContext* upload_file_system_context, ServiceWorkerNavigationHandleCore* service_worker_handle_core, AppCacheNavigationHandleCore* appcache_handle_core, std::unique_ptr<NavigationRequestInfo> request_info,
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index f38d39b..e9178424 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1971,6 +1971,7 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest( ResourceContext* resource_context, net::URLRequestContext* request_context, + storage::FileSystemContext* upload_file_system_context, const NavigationRequestInfo& info, std::unique_ptr<NavigationUIData> navigation_ui_data, NavigationURLLoaderImplCore* loader, @@ -2052,12 +2053,8 @@ ResourceRequestBodyImpl* body = info.common_params.post_data.get(); if (body) { AttachRequestBodyBlobDataHandles(body, resource_context); - // TODO(davidben): The FileSystemContext is null here. In the case where - // another renderer requested this navigation, this should be the same - // FileSystemContext passed into ShouldServiceRequest. new_request->set_upload(UploadDataStreamBuilder::Build( - body, blob_context, - nullptr, // file_system_context + body, blob_context, upload_file_system_context, BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get())); }
diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h index f57a3ac..826cc37 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.h +++ b/content/browser/loader/resource_dispatcher_host_impl.h
@@ -54,6 +54,7 @@ } namespace storage { +class FileSystemContext; class ShareableFileReference; } @@ -259,6 +260,7 @@ void BeginNavigationRequest( ResourceContext* resource_context, net::URLRequestContext* request_context, + storage::FileSystemContext* upload_file_system_context, const NavigationRequestInfo& info, std::unique_ptr<NavigationUIData> navigation_ui_data, NavigationURLLoaderImplCore* loader,
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index db6020d..6369e83 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -456,7 +456,9 @@ skipped_latency_info_list_.end()); skipped_latency_info_list_.clear(); - support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + DCHECK(result); if (local_surface_id != local_surface_id_ || !has_frame_) { // manager must outlive compositors using it.
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 39740fea..6800c34 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -27,6 +27,7 @@ #include "cc/output/compositor_frame.h" #include "cc/output/compositor_frame_metadata.h" #include "cc/output/copy_output_request.h" +#include "cc/surfaces/local_surface_id_allocator.h" #include "cc/surfaces/surface.h" #include "cc/surfaces/surface_manager.h" #include "cc/test/begin_frame_args_test.h" @@ -130,10 +131,6 @@ 1, base::UnguessableToken::Deserialize(2, 3)); -cc::LocalSurfaceId CreateLocalSurfaceId() { - return cc::LocalSurfaceId(1, base::UnguessableToken::Create()); -} - class TestOverscrollDelegate : public OverscrollControllerDelegate { public: explicit TestOverscrollDelegate(RenderWidgetHostView* view) @@ -837,6 +834,8 @@ IPC::TestSink* sink_; base::test::ScopedFeatureList feature_list_; + cc::LocalSurfaceIdAllocator local_surface_id_allocator_; + private: DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraTest); }; @@ -2344,7 +2343,7 @@ // Submit another frame. The resources for the previous frame belong to the // old RendererCompositorFrameSink and should not be returned. - view_->SubmitCompositorFrame(CreateLocalSurfaceId(), + view_->SubmitCompositorFrame(local_surface_id_allocator_.GenerateId(), MakeDelegatedFrame(1.f, view_size, view_rect)); EXPECT_EQ(0u, sink_->message_count()); @@ -2490,6 +2489,8 @@ gfx::Size large_size(100, 100); gfx::Size small_size(40, 45); gfx::Size medium_size(40, 95); + cc::LocalSurfaceId small_id = local_surface_id_allocator_.GenerateId(); + cc::LocalSurfaceId medium_id = local_surface_id_allocator_.GenerateId(); // Prevent the DelegatedFrameHost from skipping frames. // XXX @@ -2504,7 +2505,7 @@ cc::CompositorFrame frame = MakeDelegatedFrame(1.f, small_size, gfx::Rect(small_size)); frame.metadata.root_background_color = SK_ColorRED; - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(small_id, std::move(frame)); ui::Layer* parent_layer = view_->GetNativeView()->layer(); @@ -2525,7 +2526,7 @@ EXPECT_EQ(SK_ColorBLACK, parent_layer->children()[0]->background_color()); frame = MakeDelegatedFrame(1.f, medium_size, gfx::Rect(medium_size)); - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(medium_id, std::move(frame)); EXPECT_EQ(0u, parent_layer->children().size()); view_->SetSize(large_size); @@ -2541,6 +2542,9 @@ gfx::Size size1(100, 100); gfx::Size size2(200, 200); gfx::Size size3(300, 300); + cc::LocalSurfaceId id1 = local_surface_id_allocator_.GenerateId(); + cc::LocalSurfaceId id2 = local_surface_id_allocator_.GenerateId(); + cc::LocalSurfaceId id3 = local_surface_id_allocator_.GenerateId(); aura::Window* root_window = parent_view_->GetNativeView()->GetRootWindow(); view_->InitAsChild(nullptr); @@ -2549,8 +2553,7 @@ view_->Show(); view_->SetSize(size1); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, size1, gfx::Rect(size1))); + id1, MakeDelegatedFrame(1.f, size1, gfx::Rect(size1))); ui::DrawWaiterForTest::WaitForCommit( root_window->GetHost()->compositor()); ViewHostMsg_UpdateRect_Params update_params; @@ -2589,8 +2592,7 @@ // message. view_->renderer_compositor_frame_sink_->Reset(); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, size3, gfx::Rect(size3))); + id3, MakeDelegatedFrame(1.f, size3, gfx::Rect(size3))); view_->renderer_compositor_frame_sink_->Flush(); // Expect the frame ack; EXPECT_TRUE(view_->renderer_compositor_frame_sink_->did_receive_ack()); @@ -2600,8 +2602,7 @@ // produce a Resize message after the commit. view_->renderer_compositor_frame_sink_->Reset(); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); + id2, MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); view_->renderer_compositor_frame_sink_->Flush(); cc::SurfaceId surface_id = view_->surface_id(); if (!surface_id.is_valid()) { @@ -2658,6 +2659,7 @@ TEST_F(RenderWidgetHostViewAuraTest, SkippedDelegatedFrames) { gfx::Rect view_rect(100, 100); gfx::Size frame_size = view_rect.size(); + cc::LocalSurfaceId local_surface_id = kArbitraryLocalSurfaceId; view_->InitAsChild(nullptr); aura::client::ParentWindowWithContext( @@ -2671,7 +2673,7 @@ // A full frame of damage. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, + view_->SubmitCompositorFrame(local_surface_id, MakeDelegatedFrame(1.f, frame_size, view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2681,8 +2683,7 @@ EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, partial_view_rect)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, frame_size, partial_view_rect)); + local_surface_id, MakeDelegatedFrame(1.f, frame_size, partial_view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2699,7 +2700,7 @@ gfx::Rect dropped_damage_rect_1(10, 20, 30, 40); EXPECT_CALL(observer, OnDelegatedFrameDamage(_, _)).Times(0); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, dropped_damage_rect_1)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2707,7 +2708,7 @@ gfx::Rect dropped_damage_rect_2(40, 50, 10, 20); EXPECT_CALL(observer, OnDelegatedFrameDamage(_, _)).Times(0); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, dropped_damage_rect_2)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2717,13 +2718,13 @@ // Unlock the compositor. This frame should damage everything. frame_size = view_rect.size(); + local_surface_id = local_surface_id_allocator_.GenerateId(); gfx::Rect new_damage_rect(5, 6, 10, 10); EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, frame_size, new_damage_rect)); + local_surface_id, MakeDelegatedFrame(1.f, frame_size, new_damage_rect)); // The swap unlocks the compositor. EXPECT_TRUE(view_->resize_locked()); EXPECT_FALSE(view_->compositor_locked()); @@ -2737,8 +2738,7 @@ EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, partial_view_rect)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, frame_size, partial_view_rect)); + local_surface_id, MakeDelegatedFrame(1.f, frame_size, partial_view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); EXPECT_FALSE(view_->resize_locked()); @@ -2753,15 +2753,16 @@ // We're never expecting empty frames, resize to something non-empty. view_rect = gfx::Rect(100, 100); + frame_size = view_rect.size(); + local_surface_id = local_surface_id_allocator_.GenerateId(); view_->SetSize(view_rect.size()); EXPECT_TRUE(view_->resize_locked()); EXPECT_TRUE(view_->compositor_locked()); // This frame should not be dropped. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); - view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, view_rect.size(), view_rect)); + view_->SubmitCompositorFrame(local_surface_id, + MakeDelegatedFrame(1.f, frame_size, view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); EXPECT_TRUE(view_->resize_locked()); EXPECT_FALSE(view_->compositor_locked()); @@ -2776,6 +2777,7 @@ TEST_F(RenderWidgetHostViewAuraTest, ResizeAfterReceivingFrame) { gfx::Rect view_rect(100, 100); gfx::Size frame_size = view_rect.size(); + cc::LocalSurfaceId local_surface_id = kArbitraryLocalSurfaceId; view_->InitAsChild(nullptr); aura::client::ParentWindowWithContext( @@ -2789,7 +2791,7 @@ // A frame of initial size. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size))); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2797,7 +2799,7 @@ // A frame of initial size arrives, but we don't commit in the UI yet. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, _)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size))); testing::Mock::VerifyAndClearExpectations(&observer); @@ -2812,7 +2814,7 @@ EXPECT_CALL(observer, OnDelegatedFrameDamage(_, _)).Times(0); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size))); testing::Mock::VerifyAndClearExpectations(&observer); @@ -2827,15 +2829,16 @@ EXPECT_CALL(observer, OnDelegatedFrameDamage(_, _)).Times(0); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size))); testing::Mock::VerifyAndClearExpectations(&observer); // A frame arrives of the new size, which will be accepted. frame_size = view_rect.size(); + local_surface_id = local_surface_id_allocator_.GenerateId(); EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, _)); view_->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, + local_surface_id, MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size))); // Receiving the frame unlocks the compositor so it can commit. EXPECT_TRUE(view_->resize_locked()); @@ -2926,7 +2929,7 @@ // Submit a frame from the new RendererCompositorFrameSink. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); - view_->SubmitCompositorFrame(CreateLocalSurfaceId(), + view_->SubmitCompositorFrame(local_surface_id_allocator_.GenerateId(), MakeDelegatedFrame(1.f, frame_size, view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2936,7 +2939,7 @@ // Submit a frame from the new RendererCompositorFrameSink. view_->SubmitCompositorFrame( - CreateLocalSurfaceId(), + local_surface_id_allocator_.GenerateId(), MakeDelegatedFrame(1.f, gfx::Size(), gfx::Rect())); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -2946,7 +2949,7 @@ // Swap another frame, with a different surface id. EXPECT_CALL(observer, OnDelegatedFrameDamage(view_->window_, view_rect)); - view_->SubmitCompositorFrame(CreateLocalSurfaceId(), + view_->SubmitCompositorFrame(local_surface_id_allocator_.GenerateId(), MakeDelegatedFrame(1.f, frame_size, view_rect)); testing::Mock::VerifyAndClearExpectations(&observer); view_->RunOnCompositingDidCommit(); @@ -3085,14 +3088,14 @@ views[1]->Hide(); EXPECT_TRUE(views[1]->HasFrameData()); gfx::Size size2(200, 200); + cc::LocalSurfaceId id2 = local_surface_id_allocator_.GenerateId(); views[1]->SetSize(size2); EXPECT_FALSE(views[1]->HasFrameData()); // Show it, it should block until we give it a frame. views[1]->Show(); EXPECT_TRUE(views[1]->released_front_lock_active()); views[1]->SubmitCompositorFrame( - kArbitraryLocalSurfaceId, - MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); + id2, MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); EXPECT_FALSE(views[1]->released_front_lock_active()); for (size_t i = 0; i < renderer_count - 1; ++i) @@ -3167,7 +3170,7 @@ for (size_t i = 0; i < renderer_count; ++i) { views[i]->Show(); views[i]->SubmitCompositorFrame( - i ? CreateLocalSurfaceId() : kArbitraryLocalSurfaceId, + i ? local_surface_id_allocator_.GenerateId() : kArbitraryLocalSurfaceId, MakeDelegatedFrame(1.f, frame_size, view_rect)); EXPECT_TRUE(views[i]->HasFrameData()); } @@ -3313,6 +3316,7 @@ TEST_F(RenderWidgetHostViewAuraTest, ForwardsBeginFrameAcks) { gfx::Rect view_rect(100, 100); gfx::Size frame_size = view_rect.size(); + cc::LocalSurfaceId local_surface_id = kArbitraryLocalSurfaceId; view_->InitAsChild(nullptr); aura::client::ParentWindowWithContext( @@ -3346,7 +3350,7 @@ cc::BeginFrameAck ack(source_id, 5, 4, true); cc::CompositorFrame frame = MakeDelegatedFrame(1.f, frame_size, view_rect); frame.metadata.begin_frame_ack = ack; - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(local_surface_id, std::move(frame)); view_->RunOnCompositingDidCommit(); EXPECT_EQ(ack, source.LastAckForObserver(observer_tracker.last_observer_)); } @@ -3379,7 +3383,7 @@ cc::CompositorFrame frame = MakeDelegatedFrame(1.f, frame_size, dropped_damage_rect); frame.metadata.begin_frame_ack = ack; - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(local_surface_id, std::move(frame)); view_->RunOnCompositingDidCommit(); ack.latest_confirmed_sequence_number = 4; ack.has_damage = false; @@ -3402,7 +3406,7 @@ cc::CompositorFrame frame = MakeDelegatedFrame(1.f, frame_size, dropped_damage_rect); frame.metadata.begin_frame_ack = ack; - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(local_surface_id, std::move(frame)); view_->RunOnCompositingDidCommit(); ack.latest_confirmed_sequence_number = cc::BeginFrameArgs::kInvalidFrameNumber; @@ -3426,6 +3430,7 @@ // Unlock the compositor again with a new CompositorFrame of correct size. frame_size = view_rect.size(); + local_surface_id = local_surface_id_allocator_.GenerateId(); { cc::BeginFrameArgs args = cc::CreateBeginFrameArgsForTesting( @@ -3436,7 +3441,7 @@ cc::BeginFrameAck ack(source_id, 12, 12, true); cc::CompositorFrame frame = MakeDelegatedFrame(1.f, frame_size, view_rect); frame.metadata.begin_frame_ack = ack; - view_->SubmitCompositorFrame(kArbitraryLocalSurfaceId, std::move(frame)); + view_->SubmitCompositorFrame(local_surface_id, std::move(frame)); view_->RunOnCompositingDidCommit(); EXPECT_EQ(ack, source.LastAckForObserver(observer_tracker.last_observer_)); }
diff --git a/content/public/android/java/res/menu/select_action_menu.xml b/content/public/android/java/res/menu/select_action_menu.xml index e0878264..00605c9 100644 --- a/content/public/android/java/res/menu/select_action_menu.xml +++ b/content/public/android/java/res/menu/select_action_menu.xml
@@ -8,10 +8,12 @@ <!--suppress AlwaysShowAction --> <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- The orderInCategory starts with 2 to give a room for - assist menu item. Remove the ordering when Android - can reorder the assist menu item itself. - --> + <!-- Remove the ordering when Android can reorder the assist menu item + itself. --> + <group + android:id="@+id/select_action_menu_assist_items" + android:orderInCategory="1"> + </group> <group android:id="@+id/select_action_menu_default_items"> <item
diff --git a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java index 25bf79f..23bd15a 100644 --- a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java +++ b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
@@ -448,6 +448,7 @@ @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { menu.removeGroup(R.id.select_action_menu_default_items); + menu.removeGroup(R.id.select_action_menu_assist_items); menu.removeGroup(R.id.select_action_menu_text_processing_menus); createActionMenu(mode, menu); return true; @@ -585,7 +586,7 @@ // Android O SDK and remove |mAssistMenuItemId|. if (mClassificationResult != null && mClassificationResult.hasNamedAction()) { - descriptor.addItem(R.id.select_action_menu_default_items, mAssistMenuItemId, 1, + descriptor.addItem(R.id.select_action_menu_assist_items, mAssistMenuItemId, 1, mClassificationResult.label, mClassificationResult.icon); } }
diff --git a/content/renderer/android/synchronous_compositor_frame_sink.cc b/content/renderer/android/synchronous_compositor_frame_sink.cc index 254ff01..51e5c73 100644 --- a/content/renderer/android/synchronous_compositor_frame_sink.cc +++ b/content/renderer/android/synchronous_compositor_frame_sink.cc
@@ -243,14 +243,6 @@ // the |frame| for the software path below. submit_frame.metadata = frame.metadata.Clone(); - if (!root_local_surface_id_.is_valid()) { - root_local_surface_id_ = local_surface_id_allocator_->GenerateId(); - child_local_surface_id_ = local_surface_id_allocator_->GenerateId(); - } - - display_->SetLocalSurfaceId(root_local_surface_id_, - frame.metadata.device_scale_factor); - // The layer compositor should be giving a frame that covers the // |sw_viewport_for_current_draw_| but at 0,0. gfx::Size child_size = sw_viewport_for_current_draw_.size(); @@ -262,6 +254,23 @@ sw_viewport_for_current_draw_.bottom()); display_->Resize(display_size); + if (!root_local_surface_id_.is_valid() || display_size_ != display_size || + device_scale_factor_ != frame.metadata.device_scale_factor) { + root_local_surface_id_ = local_surface_id_allocator_->GenerateId(); + display_size_ = display_size; + device_scale_factor_ = frame.metadata.device_scale_factor; + } + + if (!child_local_surface_id_.is_valid() || child_size_ != child_size || + device_scale_factor_ != frame.metadata.device_scale_factor) { + child_local_surface_id_ = local_surface_id_allocator_->GenerateId(); + child_size_ = child_size; + device_scale_factor_ = frame.metadata.device_scale_factor; + } + + display_->SetLocalSurfaceId(root_local_surface_id_, + frame.metadata.device_scale_factor); + // The offset for the child frame relative to the origin of the canvas being // drawn into. gfx::Transform child_transform; @@ -275,6 +284,8 @@ // hardware frames in SurfacesInstance?) cc::CompositorFrame embed_frame; embed_frame.metadata.begin_frame_ack = frame.metadata.begin_frame_ack; + embed_frame.metadata.device_scale_factor = + frame.metadata.device_scale_factor; embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); // The embedding RenderPass covers the entire Display's area. @@ -297,10 +308,12 @@ cc::SurfaceId(kChildFrameSinkId, child_local_surface_id_), cc::SurfaceDrawQuadType::PRIMARY, nullptr); - child_support_->SubmitCompositorFrame(child_local_surface_id_, - std::move(frame)); - root_support_->SubmitCompositorFrame(root_local_surface_id_, - std::move(embed_frame)); + bool result = child_support_->SubmitCompositorFrame(child_local_surface_id_, + std::move(frame)); + DCHECK(result); + result = root_support_->SubmitCompositorFrame(root_local_surface_id_, + std::move(embed_frame)); + DCHECK(result); display_->DrawAndSwap(); } else { // For hardware draws we send the whole frame to the client so it can draw
diff --git a/content/renderer/android/synchronous_compositor_frame_sink.h b/content/renderer/android/synchronous_compositor_frame_sink.h index bab49796..d906795 100644 --- a/content/renderer/android/synchronous_compositor_frame_sink.h +++ b/content/renderer/android/synchronous_compositor_frame_sink.h
@@ -156,6 +156,9 @@ std::unique_ptr<cc::LocalSurfaceIdAllocator> local_surface_id_allocator_; cc::LocalSurfaceId child_local_surface_id_; cc::LocalSurfaceId root_local_surface_id_; + gfx::Size child_size_; + gfx::Size display_size_; + float device_scale_factor_ = 0; // Uses surface_manager_. std::unique_ptr<cc::CompositorFrameSinkSupport> root_support_; // Uses surface_manager_.
diff --git a/content/test/blink_test_environment.cc b/content/test/blink_test_environment.cc index 051dc2e2..6ba2ecd 100644 --- a/content/test/blink_test_environment.cc +++ b/content/test/blink_test_environment.cc
@@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/run_loop.h" #include "base/strings/string_tokenizer.h" +#include "base/task_scheduler/task_scheduler.h" #include "base/test/scoped_task_environment.h" #include "base/test/test_discardable_memory_allocator.h" #include "base/third_party/dynamic_annotations/dynamic_annotations.h" @@ -50,12 +51,15 @@ ~TestEnvironment() { } + // This returns when both the main thread and the TaskSchedules queues are + // empty. + void RunUntilIdle() { scoped_task_environment_.RunUntilIdle(); } + private: base::test::ScopedTaskEnvironment scoped_task_environment_; // Must be instantiated after ScopedTaskEnvironment. TestBlinkWebUnitTestSupport blink_test_support_; - TestContentClientInitializer content_initializer_; base::TestDiscardableMemoryAllocator discardable_memory_allocator_; }; @@ -86,7 +90,7 @@ void TearDownBlinkTestEnvironment() { // Flush any remaining messages before we kill ourselves. // http://code.google.com/p/chromium/issues/detail?id=9500 - base::RunLoop().RunUntilIdle(); + test_environment->RunUntilIdle(); if (RunningOnValgrind()) blink::WebCache::Clear();
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index b6d2d4f..e3abfd9 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -369,9 +369,15 @@ deps += [ "//extensions/shell:app_shell" ] } if (is_chromeos) { - sources += [ "api/virtual_keyboard/virtual_keyboard_apitest.cc" ] + sources += [ + "api/media_perception_private/media_perception_private_apitest.cc", + "api/virtual_keyboard/virtual_keyboard_apitest.cc", + ] - deps += [ "//chromeos" ] + deps += [ + "//chromeos", + "//chromeos:media_perception_proto", + ] } } @@ -511,9 +517,14 @@ if (is_chromeos) { sources += [ "api/audio/audio_device_id_calculator_unittest.cc", + "api/media_perception_private/conversion_utils_unittest.cc", + "api/media_perception_private/media_perception_api_manager_unittest.cc", "api/webcam_private/visca_webcam_unittest.cc", ] - deps += [ "//chromeos:test_support" ] + deps += [ + "//chromeos:media_perception_proto", + "//chromeos:test_support", + ] } }
diff --git a/extensions/browser/api/BUILD.gn b/extensions/browser/api/BUILD.gn index caf551d..b17d2e2 100644 --- a/extensions/browser/api/BUILD.gn +++ b/extensions/browser/api/BUILD.gn
@@ -106,6 +106,10 @@ if (is_chromeos) { sources += [ + "media_perception_private/conversion_utils.cc", + "media_perception_private/conversion_utils.h", + "media_perception_private/media_perception_api_manager.cc", + "media_perception_private/media_perception_api_manager.h", "media_perception_private/media_perception_private_api.cc", "media_perception_private/media_perception_private_api.h", ] @@ -119,7 +123,10 @@ "//extensions/browser/api/webcam_private", ] - deps += [ "//chromeos" ] + deps += [ + "//chromeos", + "//chromeos:media_perception_proto", + ] } }
diff --git a/extensions/browser/api/media_perception_private/conversion_utils.cc b/extensions/browser/api/media_perception_private/conversion_utils.cc new file mode 100644 index 0000000..ea303fc5 --- /dev/null +++ b/extensions/browser/api/media_perception_private/conversion_utils.cc
@@ -0,0 +1,248 @@ +// 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 "extensions/browser/api/media_perception_private/conversion_utils.h" + +#include "base/memory/ptr_util.h" + +namespace extensions { +namespace api { +namespace media_perception_private { + +namespace { + +std::unique_ptr<Point> PointProtoToIdl(const mri::Point& point) { + std::unique_ptr<Point> point_result = base::MakeUnique<Point>(); + if (point.has_x()) + point_result->x = base::MakeUnique<double>(point.x()); + + if (point.has_y()) + point_result->y = base::MakeUnique<double>(point.y()); + + return point_result; +} + +std::unique_ptr<BoundingBox> BoundingBoxProtoToIdl( + const mri::BoundingBox& bounding_box) { + std::unique_ptr<BoundingBox> bounding_box_result = + base::MakeUnique<BoundingBox>(); + if (bounding_box.has_normalized()) { + bounding_box_result->normalized = + base::MakeUnique<bool>(bounding_box.normalized()); + } + + if (bounding_box.has_top_left()) + bounding_box_result->top_left = PointProtoToIdl(bounding_box.top_left()); + + if (bounding_box.has_bottom_right()) { + bounding_box_result->bottom_right = + PointProtoToIdl(bounding_box.bottom_right()); + } + + return bounding_box_result; +} + +EntityType EntityTypeProtoToIdl(const mri::Entity& entity) { + if (entity.has_type()) { + switch (entity.type()) { + case mri::Entity::FACE: + return ENTITY_TYPE_FACE; + case mri::Entity::PERSON: + return ENTITY_TYPE_PERSON; + case mri::Entity::UNSPECIFIED: + return ENTITY_TYPE_UNSPECIFIED; + } + NOTREACHED() << "Unknown entity type: " << entity.type(); + } + return ENTITY_TYPE_UNSPECIFIED; +} + +Entity EntityProtoToIdl(const mri::Entity& entity) { + Entity entity_result; + if (entity.has_id()) + entity_result.id = base::MakeUnique<int>(entity.id()); + + entity_result.type = EntityTypeProtoToIdl(entity); + if (entity.has_confidence()) + entity_result.confidence = base::MakeUnique<double>(entity.confidence()); + + if (entity.has_bounding_box()) + entity_result.bounding_box = BoundingBoxProtoToIdl(entity.bounding_box()); + + return entity_result; +} + +FramePerception FramePerceptionProtoToIdl( + const mri::FramePerception& frame_perception) { + FramePerception frame_perception_result; + if (frame_perception.has_frame_id()) { + frame_perception_result.frame_id = + base::MakeUnique<int>(frame_perception.frame_id()); + } + if (frame_perception.has_frame_width_in_px()) { + frame_perception_result.frame_width_in_px = + base::MakeUnique<int>(frame_perception.frame_width_in_px()); + } + if (frame_perception.has_frame_height_in_px()) { + frame_perception_result.frame_height_in_px = + base::MakeUnique<int>(frame_perception.frame_height_in_px()); + } + if (frame_perception.has_timestamp()) { + frame_perception_result.timestamp = + base::MakeUnique<double>(frame_perception.timestamp()); + } + if (frame_perception.entity_size() > 0) { + frame_perception_result.entities = base::MakeUnique<std::vector<Entity>>(); + for (const auto& entity : frame_perception.entity()) + frame_perception_result.entities->emplace_back(EntityProtoToIdl(entity)); + } + return frame_perception_result; +} + +ImageFormat ImageFormatProtoToIdl(const mri::ImageFrame& image_frame) { + if (image_frame.has_format()) { + switch (image_frame.format()) { + case mri::ImageFrame::RGB: + return IMAGE_FORMAT_RAW; + case mri::ImageFrame::PNG: + return IMAGE_FORMAT_PNG; + case mri::ImageFrame::JPEG: + return IMAGE_FORMAT_JPEG; + case mri::ImageFrame::FORMAT_UNSPECIFIED: + return IMAGE_FORMAT_NONE; + } + NOTREACHED() << "Unknown image format: " << image_frame.format(); + } + return IMAGE_FORMAT_NONE; +} + +ImageFrame ImageFrameProtoToIdl(const mri::ImageFrame& image_frame) { + ImageFrame image_frame_result; + if (image_frame.has_width()) + image_frame_result.width = base::MakeUnique<int>(image_frame.width()); + + if (image_frame.has_height()) + image_frame_result.height = base::MakeUnique<int>(image_frame.height()); + + if (image_frame.has_data_length()) { + image_frame_result.data_length = + base::MakeUnique<int>(image_frame.data_length()); + } + + if (image_frame.has_pixel_data()) { + image_frame_result.frame = base::MakeUnique<std::vector<char>>( + image_frame.pixel_data().begin(), image_frame.pixel_data().end()); + } + + image_frame_result.format = ImageFormatProtoToIdl(image_frame); + return image_frame_result; +} + +PerceptionSample PerceptionSampleProtoToIdl( + const mri::PerceptionSample& perception_sample) { + PerceptionSample perception_sample_result; + if (perception_sample.has_frame_perception()) { + perception_sample_result.frame_perception = + base::MakeUnique<FramePerception>( + FramePerceptionProtoToIdl(perception_sample.frame_perception())); + } + if (perception_sample.has_image_frame()) { + perception_sample_result.image_frame = base::MakeUnique<ImageFrame>( + ImageFrameProtoToIdl(perception_sample.image_frame())); + } + return perception_sample_result; +} + +Status StateStatusProtoToIdl(const mri::State& state) { + switch (state.status()) { + case mri::State::UNINITIALIZED: + return STATUS_UNINITIALIZED; + case mri::State::STARTED: + return STATUS_STARTED; + case mri::State::RUNNING: + return STATUS_RUNNING; + case mri::State::SUSPENDED: + return STATUS_SUSPENDED; + case mri::State::STATUS_UNSPECIFIED: + return STATUS_NONE; + } + NOTREACHED() << "Reached status not in switch."; + return STATUS_NONE; +} + +mri::State::Status StateStatusIdlToProto(const State& state) { + switch (state.status) { + case STATUS_UNINITIALIZED: + return mri::State::UNINITIALIZED; + case STATUS_STARTED: + return mri::State::STARTED; + case STATUS_RUNNING: + return mri::State::RUNNING; + case STATUS_SUSPENDED: + return mri::State::SUSPENDED; + case STATUS_NONE: + return mri::State::STATUS_UNSPECIFIED; + } + NOTREACHED() << "Reached status not in switch."; + return mri::State::STATUS_UNSPECIFIED; +} + +} // namespace + +State StateProtoToIdl(const mri::State& state) { + State state_result; + if (state.has_status()) { + state_result.status = StateStatusProtoToIdl(state); + } + if (state.has_device_context()) { + state_result.device_context = + base::MakeUnique<std::string>(state.device_context()); + } + return state_result; +} + +mri::State StateIdlToProto(const State& state) { + mri::State state_result; + state_result.set_status(StateStatusIdlToProto(state)); + if (state.device_context) + state_result.set_device_context(*state.device_context); + + return state_result; +} + +MediaPerception MediaPerceptionProtoToIdl( + const mri::MediaPerception& media_perception) { + MediaPerception media_perception_result; + if (media_perception.has_timestamp()) { + media_perception_result.timestamp = + base::MakeUnique<double>(media_perception.timestamp()); + } + + if (media_perception.frame_perception_size() > 0) { + media_perception_result.frame_perceptions = + base::MakeUnique<std::vector<FramePerception>>(); + for (const auto& frame_perception : media_perception.frame_perception()) { + media_perception_result.frame_perceptions->emplace_back( + FramePerceptionProtoToIdl(frame_perception)); + } + } + return media_perception_result; +} + +Diagnostics DiagnosticsProtoToIdl(const mri::Diagnostics& diagnostics) { + Diagnostics diagnostics_result; + if (diagnostics.perception_sample_size() > 0) { + diagnostics_result.perception_samples = + base::MakeUnique<std::vector<PerceptionSample>>(); + for (const auto& perception_sample : diagnostics.perception_sample()) { + diagnostics_result.perception_samples->emplace_back( + PerceptionSampleProtoToIdl(perception_sample)); + } + } + return diagnostics_result; +} + +} // namespace media_perception_private +} // namespace api +} // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/conversion_utils.h b/extensions/browser/api/media_perception_private/conversion_utils.h new file mode 100644 index 0000000..a2e97fa --- /dev/null +++ b/extensions/browser/api/media_perception_private/conversion_utils.h
@@ -0,0 +1,36 @@ +// 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 EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_ +#define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_ + +#include "chromeos/media_perception/media_perception.pb.h" +#include "extensions/common/api/media_perception_private.h" + +namespace extensions { +namespace api { +namespace media_perception_private { + +// Converts State proto messages to State objects (generated by the +// media_perception_private.idl). +State StateProtoToIdl(const mri::State& state); + +// Converts State objects (generated by the media_perception_private.idl) to +// State proto messages. +mri::State StateIdlToProto(const State& state); + +// Converts MediaPerception proto messages to MediaPerception objects +// (generated by the media_perception_private.idl). +MediaPerception MediaPerceptionProtoToIdl( + const mri::MediaPerception& media_perception); + +// Converts Diagnostics proto messages to Diagnostics objects (generated by the +// media_perception_private.idl). +Diagnostics DiagnosticsProtoToIdl(const mri::Diagnostics& diagnostics); + +} // namespace media_perception_private +} // namespace api +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_CONVERSION_UTILS_H_
diff --git a/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc b/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc new file mode 100644 index 0000000..0c3aa0f --- /dev/null +++ b/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
@@ -0,0 +1,208 @@ +// 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 "extensions/browser/api/media_perception_private/conversion_utils.h" + +#include "base/memory/ptr_util.h" +#include "chromeos/media_perception/media_perception.pb.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media_perception = extensions::api::media_perception_private; + +namespace extensions { + +namespace { + +const char kTestDeviceContext[] = "Video camera"; + +void InitializeFakeFramePerception(const int index, + mri::FramePerception* frame_perception) { + frame_perception->set_frame_id(index); + frame_perception->set_frame_width_in_px(3); + frame_perception->set_frame_height_in_px(4); + frame_perception->set_timestamp(5); + + mri::Entity* entity_one = frame_perception->add_entity(); + entity_one->set_id(6); + entity_one->set_type(mri::Entity::FACE); + entity_one->set_confidence(7); + + mri::Entity* e_two = frame_perception->add_entity(); + e_two->set_id(8); + e_two->set_type(mri::Entity::PERSON); + e_two->set_confidence(9); + + mri::BoundingBox* bounding_box_one = entity_one->mutable_bounding_box(); + bounding_box_one->mutable_top_left()->set_x(10); + bounding_box_one->mutable_top_left()->set_y(11); + bounding_box_one->mutable_bottom_right()->set_x(12); + bounding_box_one->mutable_bottom_right()->set_y(13); + bounding_box_one->set_normalized(false); + + mri::BoundingBox* bounding_box_two = e_two->mutable_bounding_box(); + bounding_box_two->mutable_top_left()->set_x(14); + bounding_box_two->mutable_top_left()->set_y(15); + bounding_box_two->set_normalized(true); +} + +void ValidateFramePerceptionResult( + const int index, + const media_perception::FramePerception& frame_perception_result) { + ASSERT_TRUE(frame_perception_result.frame_id); + EXPECT_EQ(*frame_perception_result.frame_id, index); + ASSERT_TRUE(frame_perception_result.frame_width_in_px); + EXPECT_EQ(*frame_perception_result.frame_width_in_px, 3); + ASSERT_TRUE(frame_perception_result.frame_height_in_px); + EXPECT_EQ(*frame_perception_result.frame_height_in_px, 4); + ASSERT_TRUE(frame_perception_result.timestamp); + EXPECT_EQ(*frame_perception_result.timestamp, 5); + + ASSERT_EQ(2u, frame_perception_result.entities->size()); + const media_perception::Entity& entity_result_one = + frame_perception_result.entities->at(0); + ASSERT_TRUE(entity_result_one.id); + EXPECT_EQ(*entity_result_one.id, 6); + ASSERT_TRUE(entity_result_one.confidence); + EXPECT_EQ(*entity_result_one.confidence, 7); + EXPECT_EQ(entity_result_one.type, media_perception::ENTITY_TYPE_FACE); + + const media_perception::Entity& entity_result_two = + frame_perception_result.entities->at(1); + ASSERT_TRUE(entity_result_two.id); + EXPECT_EQ(*entity_result_two.id, 8); + ASSERT_TRUE(entity_result_two.confidence); + EXPECT_EQ(*entity_result_two.confidence, 9); + EXPECT_EQ(entity_result_two.type, media_perception::ENTITY_TYPE_PERSON); + + const media_perception::BoundingBox* bounding_box_result_one = + entity_result_one.bounding_box.get(); + ASSERT_TRUE(bounding_box_result_one); + ASSERT_TRUE(bounding_box_result_one->top_left); + ASSERT_TRUE(bounding_box_result_one->top_left->x); + EXPECT_EQ(*bounding_box_result_one->top_left->x, 10); + ASSERT_TRUE(bounding_box_result_one->top_left->y); + EXPECT_EQ(*bounding_box_result_one->top_left->y, 11); + ASSERT_TRUE(bounding_box_result_one->bottom_right); + ASSERT_TRUE(bounding_box_result_one->bottom_right->x); + EXPECT_EQ(*bounding_box_result_one->bottom_right->x, 12); + ASSERT_TRUE(bounding_box_result_one->bottom_right->y); + EXPECT_EQ(*bounding_box_result_one->bottom_right->y, 13); + EXPECT_FALSE(*bounding_box_result_one->normalized); + + const media_perception::BoundingBox* bounding_box_result_two = + entity_result_two.bounding_box.get(); + ASSERT_TRUE(bounding_box_result_two); + ASSERT_TRUE(bounding_box_result_two->top_left); + EXPECT_EQ(*bounding_box_result_two->top_left->x, 14); + EXPECT_EQ(*bounding_box_result_two->top_left->y, 15); + EXPECT_FALSE(bounding_box_result_two->bottom_right); + EXPECT_TRUE(*bounding_box_result_two->normalized); +} + +void InitializeFakeImageFrameData(mri::ImageFrame* image_frame) { + image_frame->set_width(1); + image_frame->set_height(2); + image_frame->set_data_length(3); + image_frame->set_pixel_data(" "); + image_frame->set_format(mri::ImageFrame::JPEG); +} + +void ValidateFakeImageFrameData( + const media_perception::ImageFrame& image_frame_result) { + ASSERT_TRUE(image_frame_result.width); + EXPECT_EQ(*image_frame_result.width, 1); + ASSERT_TRUE(image_frame_result.height); + EXPECT_EQ(*image_frame_result.height, 2); + ASSERT_TRUE(image_frame_result.data_length); + EXPECT_EQ(*image_frame_result.data_length, 3); + ASSERT_TRUE(image_frame_result.frame); + EXPECT_EQ((*image_frame_result.frame).size(), 4ul); + EXPECT_EQ(image_frame_result.format, media_perception::IMAGE_FORMAT_JPEG); +} + +} // namespace + +// Verifies that the data is converted successfully and as expected in each of +// these cases. + +TEST(MediaPerceptionConversionUtilsTest, MediaPerceptionProtoToIdl) { + const int kFrameId = 2; + mri::MediaPerception media_perception; + // Fill in fake values for the media_perception proto. + media_perception.set_timestamp(1); + mri::FramePerception* frame_perception = + media_perception.add_frame_perception(); + InitializeFakeFramePerception(kFrameId, frame_perception); + media_perception::MediaPerception media_perception_result = + media_perception::MediaPerceptionProtoToIdl(media_perception); + EXPECT_EQ(*media_perception_result.timestamp, 1); + ASSERT_TRUE(media_perception_result.frame_perceptions); + ASSERT_EQ(1u, media_perception_result.frame_perceptions->size()); + ValidateFramePerceptionResult( + kFrameId, media_perception_result.frame_perceptions->at(0)); +} + +TEST(MediaPerceptionConversionUtilsTest, DiagnosticsProtoToIdl) { + const size_t kNumSamples = 3; + mri::Diagnostics diagnostics; + for (size_t i = 0; i < kNumSamples; i++) { + mri::PerceptionSample* perception_sample = + diagnostics.add_perception_sample(); + mri::FramePerception* frame_perception = + perception_sample->mutable_frame_perception(); + InitializeFakeFramePerception(i, frame_perception); + mri::ImageFrame* image_frame = perception_sample->mutable_image_frame(); + InitializeFakeImageFrameData(image_frame); + } + media_perception::Diagnostics diagnostics_result = + media_perception::DiagnosticsProtoToIdl(diagnostics); + ASSERT_EQ(kNumSamples, diagnostics_result.perception_samples->size()); + for (size_t i = 0; i < kNumSamples; i++) { + SCOPED_TRACE(testing::Message() << "Sample number: " << i); + const media_perception::PerceptionSample& perception_sample_result = + diagnostics_result.perception_samples->at(i); + + const media_perception::FramePerception* frame_perception_result = + perception_sample_result.frame_perception.get(); + ASSERT_TRUE(frame_perception_result); + + const media_perception::ImageFrame* image_frame_result = + perception_sample_result.image_frame.get(); + ASSERT_TRUE(image_frame_result); + + ValidateFramePerceptionResult(i, *frame_perception_result); + ValidateFakeImageFrameData(*image_frame_result); + } +} + +TEST(MediaPerceptionConversionUtilsTest, StateProtoToIdl) { + mri::State state; + state.set_status(mri::State::RUNNING); + media_perception::State state_result = + media_perception::StateProtoToIdl(state); + EXPECT_EQ(state_result.status, media_perception::STATUS_RUNNING); + + state.set_status(mri::State::STARTED); + state.set_device_context(kTestDeviceContext); + state_result = media_perception::StateProtoToIdl(state); + EXPECT_EQ(state_result.status, media_perception::STATUS_STARTED); + ASSERT_TRUE(state_result.device_context); + EXPECT_EQ(*state_result.device_context, kTestDeviceContext); +} + +TEST(MediaPerceptionConversionUtilsTest, StateIdlToProto) { + media_perception::State state; + state.status = media_perception::STATUS_UNINITIALIZED; + mri::State state_proto = StateIdlToProto(state); + EXPECT_EQ(state_proto.status(), mri::State::UNINITIALIZED); + EXPECT_FALSE(state_proto.has_device_context()); + + state.status = media_perception::STATUS_SUSPENDED; + state.device_context = base::MakeUnique<std::string>(kTestDeviceContext); + state_proto = StateIdlToProto(state); + EXPECT_EQ(state_proto.status(), mri::State::SUSPENDED); + EXPECT_EQ(state_proto.device_context(), kTestDeviceContext); +} + +} // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.cc b/extensions/browser/api/media_perception_private/media_perception_api_manager.cc new file mode 100644 index 0000000..e071e5c --- /dev/null +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.cc
@@ -0,0 +1,180 @@ +// 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 "extensions/browser/api/media_perception_private/media_perception_api_manager.h" + +#include "base/lazy_instance.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/media_analytics_client.h" +#include "chromeos/dbus/upstart_client.h" +#include "extensions/browser/api/media_perception_private/conversion_utils.h" +#include "extensions/browser/event_router.h" +#include "extensions/browser/extension_function.h" + +namespace media_perception = extensions::api::media_perception_private; + +namespace extensions { + +// static +MediaPerceptionAPIManager* MediaPerceptionAPIManager::Get( + content::BrowserContext* context) { + return GetFactoryInstance()->Get(context); +} + +static base::LazyInstance< + BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>>::Leaky g_factory = + LAZY_INSTANCE_INITIALIZER; + +// static +BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>* +MediaPerceptionAPIManager::GetFactoryInstance() { + return g_factory.Pointer(); +} + +MediaPerceptionAPIManager::MediaPerceptionAPIManager( + content::BrowserContext* context) + : browser_context_(context), + analytics_process_state_(AnalyticsProcessState::IDLE), + weak_ptr_factory_(this) { + chromeos::MediaAnalyticsClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetMediaAnalyticsClient(); + dbus_client->SetMediaPerceptionSignalHandler( + base::Bind(&MediaPerceptionAPIManager::MediaPerceptionSignalHandler, + weak_ptr_factory_.GetWeakPtr())); +} + +MediaPerceptionAPIManager::~MediaPerceptionAPIManager() { + chromeos::MediaAnalyticsClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetMediaAnalyticsClient(); + dbus_client->ClearMediaPerceptionSignalHandler(); + // Stop the separate media analytics process. + chromeos::UpstartClient* upstart_client = + chromeos::DBusThreadManager::Get()->GetUpstartClient(); + upstart_client->StopMediaAnalytics(); +} + +void MediaPerceptionAPIManager::GetState(const APIStateCallback& callback) { + if (analytics_process_state_ == AnalyticsProcessState::RUNNING) { + chromeos::MediaAnalyticsClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetMediaAnalyticsClient(); + dbus_client->GetState(base::Bind(&MediaPerceptionAPIManager::StateCallback, + weak_ptr_factory_.GetWeakPtr(), callback)); + return; + } + + if (analytics_process_state_ == AnalyticsProcessState::LAUNCHING) { + callback.Run(CallbackStatus::PROCESS_LAUNCHING_ERROR, + media_perception::State()); + return; + } + + // Calling getState with process not running returns State UNINITIALIZED. + media_perception::State state_uninitialized; + state_uninitialized.status = media_perception::STATUS_UNINITIALIZED; + callback.Run(CallbackStatus::SUCCESS, std::move(state_uninitialized)); +} + +void MediaPerceptionAPIManager::SetState(const media_perception::State& state, + const APIStateCallback& callback) { + mri::State state_proto = StateIdlToProto(state); + DCHECK(state_proto.status() == mri::State::RUNNING || + state_proto.status() == mri::State::SUSPENDED) + << "Cannot set state to something other than RUNNING or SUSPENDED."; + + if (analytics_process_state_ == AnalyticsProcessState::RUNNING) { + SetStateInternal(callback, state_proto); + return; + } + + if (analytics_process_state_ == AnalyticsProcessState::LAUNCHING) { + callback.Run(CallbackStatus::PROCESS_LAUNCHING_ERROR, + media_perception::State()); + return; + } + + // Analytics process is in state IDLE. + if (state_proto.status() == mri::State::RUNNING) { + analytics_process_state_ = AnalyticsProcessState::LAUNCHING; + chromeos::UpstartClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetUpstartClient(); + dbus_client->StartMediaAnalytics( + base::Bind(&MediaPerceptionAPIManager::UpstartCallback, + weak_ptr_factory_.GetWeakPtr(), callback, state_proto)); + return; + } + + callback.Run(CallbackStatus::PROCESS_IDLE_ERROR, media_perception::State()); +} + +void MediaPerceptionAPIManager::SetStateInternal( + const APIStateCallback& callback, + const mri::State& state) { + chromeos::MediaAnalyticsClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetMediaAnalyticsClient(); + dbus_client->SetState(state, + base::Bind(&MediaPerceptionAPIManager::StateCallback, + weak_ptr_factory_.GetWeakPtr(), callback)); +} + +void MediaPerceptionAPIManager::GetDiagnostics( + const APIGetDiagnosticsCallback& callback) { + chromeos::MediaAnalyticsClient* dbus_client = + chromeos::DBusThreadManager::Get()->GetMediaAnalyticsClient(); + dbus_client->GetDiagnostics( + base::Bind(&MediaPerceptionAPIManager::GetDiagnosticsCallback, + weak_ptr_factory_.GetWeakPtr(), callback)); +} + +void MediaPerceptionAPIManager::UpstartCallback( + const APIStateCallback& callback, + const mri::State& state, + bool succeeded) { + if (!succeeded) { + analytics_process_state_ = AnalyticsProcessState::IDLE; + callback.Run(CallbackStatus::PROCESS_IDLE_ERROR, media_perception::State()); + return; + } + analytics_process_state_ = AnalyticsProcessState::RUNNING; + SetStateInternal(callback, state); +} + +void MediaPerceptionAPIManager::StateCallback(const APIStateCallback& callback, + bool succeeded, + const mri::State& state_proto) { + media_perception::State state; + if (!succeeded) { + callback.Run(CallbackStatus::DBUS_ERROR, media_perception::State()); + return; + } + callback.Run(CallbackStatus::SUCCESS, + media_perception::StateProtoToIdl(state_proto)); +} + +void MediaPerceptionAPIManager::GetDiagnosticsCallback( + const APIGetDiagnosticsCallback& callback, + bool succeeded, + const mri::Diagnostics& diagnostics_proto) { + if (!succeeded) { + callback.Run(CallbackStatus::DBUS_ERROR, media_perception::Diagnostics()); + return; + } + callback.Run(CallbackStatus::SUCCESS, + media_perception::DiagnosticsProtoToIdl(diagnostics_proto)); +} + +void MediaPerceptionAPIManager::MediaPerceptionSignalHandler( + const mri::MediaPerception& media_perception_proto) { + EventRouter* router = EventRouter::Get(browser_context_); + DCHECK(router) << "EventRouter is null."; + + media_perception::MediaPerception media_perception = + media_perception::MediaPerceptionProtoToIdl(media_perception_proto); + std::unique_ptr<Event> event( + new Event(events::MEDIA_PERCEPTION_PRIVATE_ON_MEDIA_PERCEPTION, + media_perception::OnMediaPerception::kEventName, + media_perception::OnMediaPerception::Create(media_perception))); + router->BroadcastEvent(std::move(event)); +} + +} // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.h b/extensions/browser/api/media_perception_private/media_perception_api_manager.h new file mode 100644 index 0000000..a404a0d --- /dev/null +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.h
@@ -0,0 +1,108 @@ +// 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 EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_ +#define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_ + +#include "base/memory/weak_ptr.h" +#include "chromeos/media_perception/media_perception.pb.h" +#include "extensions/browser/browser_context_keyed_api_factory.h" +#include "extensions/common/api/media_perception_private.h" + +namespace extensions { + +class MediaPerceptionAPIManager : public BrowserContextKeyedAPI { + public: + enum class CallbackStatus { + // Request to media analytics process was successful. + SUCCESS, + // Request to media analytics process failed at D-Bus layer. + DBUS_ERROR, + // The media analytics process is not running. + PROCESS_IDLE_ERROR, + // The media analytics process is still being launched via Upstart + // service. + PROCESS_LAUNCHING_ERROR + }; + + using APIStateCallback = base::Callback<void( + CallbackStatus status, + extensions::api::media_perception_private::State state)>; + + using APIGetDiagnosticsCallback = base::Callback<void( + CallbackStatus status, + extensions::api::media_perception_private::Diagnostics diagnostics)>; + + explicit MediaPerceptionAPIManager(content::BrowserContext* context); + ~MediaPerceptionAPIManager() override; + + // Convenience method to get the MediaPeceptionAPIManager for a + // BrowserContext. + static MediaPerceptionAPIManager* Get(content::BrowserContext* context); + + // BrowserContextKeyedAPI implementation. + static BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>* + GetFactoryInstance(); + + // Public functions for MediaPerceptionPrivateAPI implementation. + void GetState(const APIStateCallback& callback); + void SetState(const extensions::api::media_perception_private::State& state, + const APIStateCallback& callback); + void GetDiagnostics(const APIGetDiagnosticsCallback& callback); + + private: + friend class BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>; + + // BrowserContextKeyedAPI: + static const char* service_name() { return "MediaPerceptionAPIManager"; } + + enum class AnalyticsProcessState { + // The process is not running. + IDLE, + // The process has been launched via Upstart, but waiting for callback to + // confirm. + LAUNCHING, + // The process is running. + RUNNING + }; + + // Sets the state of the analytics process. + void SetStateInternal(const APIStateCallback& callback, + const mri::State& state); + + // Event handler for MediaPerception proto messages coming over D-Bus as + // signal. + void MediaPerceptionSignalHandler( + const mri::MediaPerception& media_perception); + + // Callback for State D-Bus method calls to the media analytics process. + void StateCallback(const APIStateCallback& callback, + bool succeeded, + const mri::State& state); + + // Callback for GetDiagnostics D-Bus method calls to the media analytics + // process. + void GetDiagnosticsCallback(const APIGetDiagnosticsCallback& callback, + bool succeeded, + const mri::Diagnostics& diagnostics); + + // Callback for Upstart command to start media analytics process. + void UpstartCallback(const APIStateCallback& callback, + const mri::State& state, + bool succeeded); + + content::BrowserContext* const browser_context_; + + // Keeps track of whether the analytics process is running so that it can be + // started with an Upstart D-Bus method call if necessary. + AnalyticsProcessState analytics_process_state_; + + base::WeakPtrFactory<MediaPerceptionAPIManager> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionAPIManager); +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc b/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc new file mode 100644 index 0000000..47180d3 --- /dev/null +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager_unittest.cc
@@ -0,0 +1,208 @@ +// 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 "extensions/browser/api/media_perception_private/media_perception_api_manager.h" + +#include <queue> + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "base/run_loop.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/fake_media_analytics_client.h" +#include "chromeos/dbus/fake_upstart_client.h" +#include "chromeos/dbus/media_analytics_client.h" +#include "chromeos/dbus/upstart_client.h" +#include "content/public/test/test_browser_context.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media_perception = extensions::api::media_perception_private; + +namespace chromeos { +namespace { + +class TestUpstartClient : public FakeUpstartClient { + public: + TestUpstartClient() : enqueue_requests_(false) {} + + ~TestUpstartClient() override{}; + + // Overrides behavior to queue start requests. + void StartMediaAnalytics(const UpstartCallback& callback) override { + pending_upstart_request_callbacks_.push(callback); + if (!enqueue_requests_) { + HandleNextUpstartRequest(true); + return; + } + } + + // Triggers the next queue'd start request to succeed or fail. + bool HandleNextUpstartRequest(bool should_succeed) { + if (pending_upstart_request_callbacks_.empty()) + return false; + + UpstartCallback callback = pending_upstart_request_callbacks_.front(); + pending_upstart_request_callbacks_.pop(); + + if (!should_succeed) { + callback.Run(false); + return true; + } + + FakeUpstartClient::StartMediaAnalytics(callback); + return true; + } + + void set_enqueue_requests(bool enqueue_requests) { + enqueue_requests_ = enqueue_requests; + } + + private: + std::queue<UpstartCallback> pending_upstart_request_callbacks_; + + bool enqueue_requests_; + + DISALLOW_COPY_AND_ASSIGN(TestUpstartClient); +}; + +} // namespace +} // namespace chromeos + +namespace extensions { + +using CallbackStatus = MediaPerceptionAPIManager::CallbackStatus; + +namespace { + +void RecordStatusAndRunClosure(base::Closure quit_run_loop, + CallbackStatus* status, + CallbackStatus result_status, + media_perception::State result_state) { + *status = result_status; + quit_run_loop.Run(); +} + +CallbackStatus SetStateAndWaitForResponse( + MediaPerceptionAPIManager* manager, + const media_perception::State& state) { + base::RunLoop run_loop; + CallbackStatus status; + manager->SetState(state, base::Bind(&RecordStatusAndRunClosure, + run_loop.QuitClosure(), &status)); + run_loop.Run(); + return status; +} + +CallbackStatus GetStateAndWaitForResponse(MediaPerceptionAPIManager* manager) { + base::RunLoop run_loop; + CallbackStatus status; + manager->GetState( + base::Bind(&RecordStatusAndRunClosure, run_loop.QuitClosure(), &status)); + run_loop.Run(); + return status; +} + +} // namespace + +class MediaPerceptionAPIManagerTest : public testing::Test { + public: + MediaPerceptionAPIManagerTest() + : thread_bundle_(content::TestBrowserThreadBundle::DEFAULT) {} + + void SetUp() override { + std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = + chromeos::DBusThreadManager::GetSetterForTesting(); + auto media_analytics_client = + base::MakeUnique<chromeos::FakeMediaAnalyticsClient>(); + media_analytics_client_ = media_analytics_client.get(); + dbus_setter->SetMediaAnalyticsClient(std::move(media_analytics_client)); + + auto upstart_client = base::MakeUnique<chromeos::TestUpstartClient>(); + upstart_client_ = upstart_client.get(); + dbus_setter->SetUpstartClient(std::move(upstart_client)); + + manager_ = base::MakeUnique<MediaPerceptionAPIManager>(&browser_context_); + } + + void TearDown() override { + // Need to make sure that the MediaPerceptionAPIManager is destructed before + // the DbusThreadManager. + manager_.reset(); + chromeos::DBusThreadManager::Shutdown(); + } + + std::unique_ptr<MediaPerceptionAPIManager> manager_; + + // Ownership of both is passed on to chromeos::DbusThreadManager. + chromeos::FakeMediaAnalyticsClient* media_analytics_client_; + chromeos::TestUpstartClient* upstart_client_; + + private: + content::TestBrowserContext browser_context_; + content::TestBrowserThreadBundle thread_bundle_; + + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionAPIManagerTest); +}; + +TEST_F(MediaPerceptionAPIManagerTest, UpstartFailure) { + upstart_client_->set_enqueue_requests(true); + media_perception::State state; + state.status = media_perception::STATUS_RUNNING; + + base::RunLoop run_loop; + CallbackStatus status; + manager_->SetState(state, base::Bind(&RecordStatusAndRunClosure, + run_loop.QuitClosure(), &status)); + EXPECT_TRUE(upstart_client_->HandleNextUpstartRequest(false)); + run_loop.Run(); + EXPECT_EQ(CallbackStatus::PROCESS_IDLE_ERROR, status); + + // Check that after a failed request, setState RUNNING will go through. + upstart_client_->set_enqueue_requests(false); + EXPECT_EQ(CallbackStatus::SUCCESS, + SetStateAndWaitForResponse(manager_.get(), state)); +} + +TEST_F(MediaPerceptionAPIManagerTest, UpstartStall) { + upstart_client_->set_enqueue_requests(true); + media_perception::State state; + state.status = media_perception::STATUS_RUNNING; + + base::RunLoop run_loop; + CallbackStatus status; + manager_->SetState(state, base::Bind(&RecordStatusAndRunClosure, + run_loop.QuitClosure(), &status)); + + EXPECT_EQ(CallbackStatus::PROCESS_LAUNCHING_ERROR, + GetStateAndWaitForResponse(manager_.get())); + EXPECT_EQ(CallbackStatus::PROCESS_LAUNCHING_ERROR, + SetStateAndWaitForResponse(manager_.get(), state)); + EXPECT_TRUE(upstart_client_->HandleNextUpstartRequest(true)); + run_loop.Run(); + EXPECT_EQ(CallbackStatus::SUCCESS, status); + + // Verify that after the slow start, things works as normal. + upstart_client_->set_enqueue_requests(false); + EXPECT_EQ(CallbackStatus::SUCCESS, + GetStateAndWaitForResponse(manager_.get())); + state.status = media_perception::STATUS_SUSPENDED; + EXPECT_EQ(CallbackStatus::SUCCESS, + SetStateAndWaitForResponse(manager_.get(), state)); +} + +TEST_F(MediaPerceptionAPIManagerTest, MediaAnalyticsDbusError) { + media_perception::State state; + state.status = media_perception::STATUS_RUNNING; + EXPECT_EQ(CallbackStatus::SUCCESS, + SetStateAndWaitForResponse(manager_.get(), state)); + // Disable the functionality of the fake process. + media_analytics_client_->set_process_running(false); + EXPECT_EQ(CallbackStatus::DBUS_ERROR, + GetStateAndWaitForResponse(manager_.get())); + EXPECT_EQ(CallbackStatus::DBUS_ERROR, + SetStateAndWaitForResponse(manager_.get(), state)); +} + +} // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_api.cc b/extensions/browser/api/media_perception_private/media_perception_private_api.cc index daa65c1..e8f4ccbc 100644 --- a/extensions/browser/api/media_perception_private/media_perception_private_api.cc +++ b/extensions/browser/api/media_perception_private/media_perception_private_api.cc
@@ -4,8 +4,35 @@ #include "extensions/browser/api/media_perception_private/media_perception_private_api.h" +namespace media_perception = extensions::api::media_perception_private; + namespace extensions { +using CallbackStatus = MediaPerceptionAPIManager::CallbackStatus; + +namespace { + +const char kErrorStringStatusDbusError[] = "Service is unreachable."; +const char kErrorStringStatusIdle[] = "Service is not running."; +const char kErrorStringStatusLaunching[] = "Service busy launching."; + +std::string CallbackStatusToErrorMessage(const CallbackStatus& status) { + switch (status) { + case CallbackStatus::DBUS_ERROR: + return kErrorStringStatusDbusError; + case CallbackStatus::PROCESS_IDLE_ERROR: + return kErrorStringStatusIdle; + case CallbackStatus::PROCESS_LAUNCHING_ERROR: + return kErrorStringStatusLaunching; + case CallbackStatus::SUCCESS: + return "CallbackStatus success."; + } + NOTREACHED() << "Reached CallbackStatus not in switch."; + return "CallbackStatus string not found."; +} + +} // namespace + MediaPerceptionPrivateGetStateFunction :: MediaPerceptionPrivateGetStateFunction() {} @@ -14,7 +41,21 @@ ExtensionFunction::ResponseAction MediaPerceptionPrivateGetStateFunction::Run() { - return RespondNow(Error("Not implemented.")); + MediaPerceptionAPIManager* manager = + MediaPerceptionAPIManager::Get(browser_context()); + manager->GetState(base::Bind( + &MediaPerceptionPrivateGetStateFunction::GetStateCallback, this)); + return RespondLater(); +} + +void MediaPerceptionPrivateGetStateFunction::GetStateCallback( + CallbackStatus status, + media_perception::State state) { + if (status != CallbackStatus::SUCCESS) { + Respond(Error(CallbackStatusToErrorMessage(status))); + return; + } + Respond(OneArgument(state.ToValue())); } MediaPerceptionPrivateSetStateFunction :: @@ -25,7 +66,38 @@ ExtensionFunction::ResponseAction MediaPerceptionPrivateSetStateFunction::Run() { - return RespondNow(Error("Not implemented.")); + std::unique_ptr<media_perception::SetState::Params> params = + media_perception::SetState::Params::Create(*args_); + EXTENSION_FUNCTION_VALIDATE(params.get()); + if (params->state.status != media_perception::STATUS_RUNNING && + params->state.status != media_perception::STATUS_SUSPENDED) { + return RespondNow( + Error("Status can only be set to RUNNING and SUSPENDED.")); + } + + // Check that device context is only provided with SetState RUNNING. + if (params->state.status != media_perception::STATUS_RUNNING && + params->state.device_context.get() != nullptr) { + return RespondNow( + Error("Only provide deviceContext with SetState RUNNING.")); + } + MediaPerceptionAPIManager* manager = + MediaPerceptionAPIManager::Get(browser_context()); + manager->SetState( + params->state, + base::Bind(&MediaPerceptionPrivateSetStateFunction::SetStateCallback, + this)); + return RespondLater(); +} + +void MediaPerceptionPrivateSetStateFunction::SetStateCallback( + CallbackStatus status, + media_perception::State state) { + if (status != CallbackStatus::SUCCESS) { + Respond(Error(CallbackStatusToErrorMessage(status))); + return; + } + Respond(OneArgument(state.ToValue())); } MediaPerceptionPrivateGetDiagnosticsFunction :: @@ -36,7 +108,22 @@ ExtensionFunction::ResponseAction MediaPerceptionPrivateGetDiagnosticsFunction::Run() { - return RespondNow(Error("Not implemented.")); + MediaPerceptionAPIManager* manager = + MediaPerceptionAPIManager::Get(browser_context()); + manager->GetDiagnostics(base::Bind( + &MediaPerceptionPrivateGetDiagnosticsFunction::GetDiagnosticsCallback, + this)); + return RespondLater(); +} + +void MediaPerceptionPrivateGetDiagnosticsFunction::GetDiagnosticsCallback( + CallbackStatus status, + media_perception::Diagnostics diagnostics) { + if (status != CallbackStatus::SUCCESS) { + Respond(Error(CallbackStatusToErrorMessage(status))); + return; + } + Respond(OneArgument(diagnostics.ToValue())); } } // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_api.h b/extensions/browser/api/media_perception_private/media_perception_private_api.h index 16c57333..3528a50 100644 --- a/extensions/browser/api/media_perception_private/media_perception_private_api.h +++ b/extensions/browser/api/media_perception_private/media_perception_private_api.h
@@ -5,7 +5,9 @@ #ifndef EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_PRIVATE_API_H_ #define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_PRIVATE_API_H_ +#include "extensions/browser/api/media_perception_private/media_perception_api_manager.h" #include "extensions/browser/extension_function.h" +#include "extensions/common/api/media_perception_private.h" namespace extensions { @@ -22,6 +24,9 @@ // ExtensionFunction: ResponseAction Run() override; + void GetStateCallback(MediaPerceptionAPIManager::CallbackStatus status, + extensions::api::media_perception_private::State state); + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateGetStateFunction); }; @@ -38,6 +43,9 @@ // ExtensionFunction: ResponseAction Run() override; + void SetStateCallback(MediaPerceptionAPIManager::CallbackStatus status, + extensions::api::media_perception_private::State state); + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateSetStateFunction); }; @@ -54,6 +62,10 @@ // ExtensionFunction: ResponseAction Run() override; + void GetDiagnosticsCallback( + MediaPerceptionAPIManager::CallbackStatus status, + extensions::api::media_perception_private::Diagnostics diagnostics); + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateGetDiagnosticsFunction); };
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc new file mode 100644 index 0000000..c293bc6 --- /dev/null +++ b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc
@@ -0,0 +1,93 @@ +// 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/auto_reset.h" +#include "base/command_line.h" +#include "base/memory/ptr_util.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/fake_media_analytics_client.h" +#include "chromeos/dbus/media_analytics_client.h" +#include "chromeos/media_perception/media_perception.pb.h" +#include "extensions/browser/api/media_perception_private/media_perception_private_api.h" +#include "extensions/common/features/feature_session_type.h" +#include "extensions/common/switches.h" +#include "extensions/shell/test/shell_apitest.h" +#include "extensions/test/extension_test_message_listener.h" +#include "extensions/test/result_catcher.h" + +namespace extensions { + +class MediaPerceptionPrivateApiTest : public ShellApiTest { + public: + MediaPerceptionPrivateApiTest() {} + ~MediaPerceptionPrivateApiTest() override {} + + void SetUpCommandLine(base::CommandLine* command_line) override { + ShellApiTest::SetUpCommandLine(command_line); + // Whitelist of the extension ID of the test extension. + command_line->AppendSwitchASCII( + extensions::switches::kWhitelistedExtensionID, + "epcifkihnkjgphfkloaaleeakhpmgdmn"); + } + + void SetUpInProcessBrowserTestFixture() override { + std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = + chromeos::DBusThreadManager::GetSetterForTesting(); + auto media_analytics_client = + base::MakeUnique<chromeos::FakeMediaAnalyticsClient>(); + media_analytics_client_ = media_analytics_client.get(); + dbus_setter->SetMediaAnalyticsClient(std::move(media_analytics_client)); + } + + void SetUpOnMainThread() override { + session_feature_type_ = extensions::ScopedCurrentFeatureSessionType( + extensions::FeatureSessionType::KIOSK); + ShellApiTest::SetUpOnMainThread(); + } + + // Ownership is passed on to chromeos::DbusThreadManager. + chromeos::FakeMediaAnalyticsClient* media_analytics_client_; + + private: + std::unique_ptr<base::AutoReset<extensions::FeatureSessionType>> + session_feature_type_; + + DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateApiTest); +}; + +// Verify that we can set and get mediaPerception system state. +IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, State) { + ASSERT_TRUE(RunAppTest("media_perception_private/state")) << message_; +} + +// Verify that we can request Diagnostics. +IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, GetDiagnostics) { + // Allows us to validate that the right data comes through the code path. + mri::Diagnostics diagnostics; + diagnostics.add_perception_sample()->mutable_frame_perception()->set_frame_id( + 1); + media_analytics_client_->SetDiagnostics(diagnostics); + + ASSERT_TRUE(RunAppTest("media_perception_private/diagnostics")) << message_; +} + +// Verify that we can listen for MediaPerceptionDetection signals and handle +// them. +IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, MediaPerception) { + extensions::ResultCatcher catcher; + catcher.RestrictToBrowserContext(browser_context()); + + ExtensionTestMessageListener handler_registered_listener( + "mediaPerceptionListenerSet", false); + ASSERT_TRUE(LoadApp("media_perception_private/media_perception")) << message_; + ASSERT_TRUE(handler_registered_listener.WaitUntilSatisfied()); + + mri::MediaPerception media_perception; + media_perception.add_frame_perception()->set_frame_id(1); + ASSERT_TRUE( + media_analytics_client_->FireMediaPerceptionEvent(media_perception)); + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + +} // namespace extensions
diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc index 9412f16..8fcc2c6 100644 --- a/extensions/browser/extension_navigation_throttle.cc +++ b/extensions/browser/extension_navigation_throttle.cc
@@ -112,7 +112,8 @@ } // This is a subframe navigation to a |target_extension| resource. - // Enforce the web_accessible_resources restriction. + // Enforce the web_accessible_resources restriction, and same-origin + // restrictions for platform apps. content::RenderFrameHost* parent = navigation_handle()->GetParentFrame(); // Look to see if all ancestors belong to |target_extension|. If not, @@ -148,6 +149,22 @@ if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(target_extension, url.path())) return content::NavigationThrottle::BLOCK_REQUEST; + + // A platform app may not be loaded in an <iframe> by another origin. + // + // In fact, platform apps may not have any cross-origin iframes at all; for + // non-extension origins of |url| this is enforced by means of a Content + // Security Policy. But CSP is incapable of blocking the chrome-extension + // scheme. Thus, this case must be handled specially here. + if (target_extension->is_platform_app()) + return content::NavigationThrottle::CANCEL; + + // A platform app may not load another extension in an <iframe>. + const Extension* parent_extension = + registry->enabled_extensions().GetExtensionOrAppByURL( + parent->GetSiteInstance()->GetSiteURL()); + if (parent_extension && parent_extension->is_platform_app()) + return content::NavigationThrottle::BLOCK_REQUEST; } return content::NavigationThrottle::PROCEED;
diff --git a/extensions/test/data/media_perception_private/diagnostics/manifest.json b/extensions/test/data/media_perception_private/diagnostics/manifest.json new file mode 100644 index 0000000..f30f4cc --- /dev/null +++ b/extensions/test/data/media_perception_private/diagnostics/manifest.json
@@ -0,0 +1,16 @@ +// 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. +{ + "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC74Vbx3EbhPc/FOvn6+HxCjMSml0HdPMiuRjj5a3b+MnRML1iJ9OAgbKUYJ/u3s25/cGq8pNB0NbyupHGEqvqAE7TcNr1mdgs0PWxh2IOI1GKrxlzxpqzQuFmxq5WHKr5RrwZ4/Xq0t/+e8JkvhZdW0jarz/28Jom0gkM5lorsewIDAQAB", + "manifest_version": 2, + "name": "Test mediaPerceptionPrivate API's getDiagnostics function.", + "version": "1.0", + "app": { + "background": { + "scripts": ["runtest.js"] + } + }, + "permissions": ["mediaPerceptionPrivate"], + "kiosk_enabled": true +}
diff --git a/extensions/test/data/media_perception_private/diagnostics/runtest.js b/extensions/test/data/media_perception_private/diagnostics/runtest.js new file mode 100644 index 0000000..e9b247e --- /dev/null +++ b/extensions/test/data/media_perception_private/diagnostics/runtest.js
@@ -0,0 +1,26 @@ +// 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. + +chrome.test.runTests([ + function setStateRunning() { + // Need to start the mocked media analytics process. + chrome.mediaPerceptionPrivate.setState({ + status: 'RUNNING' + }, chrome.test.callbackPass(function(state) { + chrome.test.assertEq({ status: 'RUNNING' }, state); + })); + }, + function getDiagnostics() { + chrome.mediaPerceptionPrivate.getDiagnostics( + chrome.test.callbackPass(function(response) { + chrome.test.assertEq({ + perceptionSamples: [{ + framePerception: { + frameId: 1 + } + }] + }, response); + })); + } +]);
diff --git a/extensions/test/data/media_perception_private/media_perception/manifest.json b/extensions/test/data/media_perception_private/media_perception/manifest.json new file mode 100644 index 0000000..0e423b4 --- /dev/null +++ b/extensions/test/data/media_perception_private/media_perception/manifest.json
@@ -0,0 +1,16 @@ +// 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. +{ + "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC74Vbx3EbhPc/FOvn6+HxCjMSml0HdPMiuRjj5a3b+MnRML1iJ9OAgbKUYJ/u3s25/cGq8pNB0NbyupHGEqvqAE7TcNr1mdgs0PWxh2IOI1GKrxlzxpqzQuFmxq5WHKr5RrwZ4/Xq0t/+e8JkvhZdW0jarz/28Jom0gkM5lorsewIDAQAB", + "manifest_version": 2, + "name": "Test mediaPerceptionPrivate API's MediaPerceptionDetection event listener", + "version": "1.0", + "app": { + "background": { + "scripts": ["runtest.js"] + } + }, + "permissions": ["mediaPerceptionPrivate"], + "kiosk_enabled": true +}
diff --git a/extensions/test/data/media_perception_private/media_perception/runtest.js b/extensions/test/data/media_perception_private/media_perception/runtest.js new file mode 100644 index 0000000..19cd8a7 --- /dev/null +++ b/extensions/test/data/media_perception_private/media_perception/runtest.js
@@ -0,0 +1,32 @@ +// 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. + +// Set the state to STARTED to automatically start listening to +// MediaPerceptionDetection signals. + +chrome.test.runTests([ + function setStateRunning() { + // Need to start the mocked media analytics process. + chrome.mediaPerceptionPrivate.setState({ + status: 'RUNNING' + }, chrome.test.callbackPass(function(state) { + chrome.test.assertEq({ status: 'RUNNING' }, state); + })); + }, + function registerListener() { + chrome.test.listenOnce( + chrome.mediaPerceptionPrivate.onMediaPerception, + function(evt) { + chrome.test.assertEq({ + framePerceptions: [{ + frameId: 1 + }] + }, evt); + }); + // By sending this message, we trigger the fake D-Bus client to fire an + // onMediaPerception event. + chrome.test.sendMessage('mediaPerceptionListenerSet'); + } +]); +
diff --git a/extensions/test/data/media_perception_private/state/manifest.json b/extensions/test/data/media_perception_private/state/manifest.json new file mode 100644 index 0000000..1151d62 --- /dev/null +++ b/extensions/test/data/media_perception_private/state/manifest.json
@@ -0,0 +1,16 @@ +// 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. +{ + "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC74Vbx3EbhPc/FOvn6+HxCjMSml0HdPMiuRjj5a3b+MnRML1iJ9OAgbKUYJ/u3s25/cGq8pNB0NbyupHGEqvqAE7TcNr1mdgs0PWxh2IOI1GKrxlzxpqzQuFmxq5WHKr5RrwZ4/Xq0t/+e8JkvhZdW0jarz/28Jom0gkM5lorsewIDAQAB", + "manifest_version": 2, + "name": "Test mediaPerceptionPrivate API's get and set state functions", + "version": "1.0", + "app": { + "background": { + "scripts": ["runtest.js"] + } + }, + "permissions": ["mediaPerceptionPrivate"], + "kiosk_enabled": true +}
diff --git a/extensions/test/data/media_perception_private/state/runtest.js b/extensions/test/data/media_perception_private/state/runtest.js new file mode 100644 index 0000000..be02705 --- /dev/null +++ b/extensions/test/data/media_perception_private/state/runtest.js
@@ -0,0 +1,52 @@ +// 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. + +function getStateUninitialized() { + chrome.mediaPerceptionPrivate.getState( + chrome.test.callbackPass(function(state) { + chrome.test.assertEq({ status: 'UNINITIALIZED' }, state); + })); +} + +function setStateRunning() { + chrome.mediaPerceptionPrivate.setState({ + status: 'RUNNING', + deviceContext: 'device_context' + }, chrome.test.callbackPass(function(state) { + chrome.test.assertEq('RUNNING', state.status); + })); +} + +function getStateRunning() { + chrome.mediaPerceptionPrivate.getState( + chrome.test.callbackPass(function(state) { + chrome.test.assertEq('RUNNING', state.status); + })); +} + +function setStateUnsettable() { + const error = 'Status can only be set to RUNNING and SUSPENDED.'; + chrome.mediaPerceptionPrivate.setState({ + status: 'UNINITIALIZED' + }, chrome.test.callbackFail(error)); + chrome.mediaPerceptionPrivate.setState({ + status: 'STARTED' + }, chrome.test.callbackFail(error)); +} + +function setStateSuspendedButWithDeviceContextFail() { + const error = 'Only provide deviceContext with SetState RUNNING.'; + chrome.mediaPerceptionPrivate.setState({ + status: 'SUSPENDED', + deviceContext: 'device_context' + }, chrome.test.callbackFail(error)); +} + +chrome.test.runTests([ + getStateUninitialized, + setStateRunning, + getStateRunning, + setStateUnsettable, + setStateSuspendedButWithDeviceContextFail]); +
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index dc887c4..1ee4c3a 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc
@@ -4,11 +4,14 @@ #include "gin/public/v8_platform.h" +#include <algorithm> + #include "base/bind.h" #include "base/debug/stack_trace.h" #include "base/location.h" #include "base/sys_info.h" -#include "base/threading/worker_pool.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_scheduler.h" #include "base/trace_event/trace_event.h" #include "gin/per_isolate_data.h" @@ -16,6 +19,10 @@ namespace { +constexpr base::TaskTraits kBackgroundThreadTaskTraits = { + base::MayBlock(), base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN}; + base::LazyInstance<V8Platform>::Leaky g_v8_platform = LAZY_INSTANCE_INITIALIZER; void RunWithLocker(v8::Isolate* isolate, v8::Task* task) { @@ -58,25 +65,16 @@ V8Platform::~V8Platform() {} size_t V8Platform::NumberOfAvailableBackgroundThreads() { - // WorkerPool will currently always create additional threads for posted - // background tasks, unless there are threads sitting idle (on posix). - // Indicate that V8 should create no more than the number of cores available, - // reserving one core for the main thread. - const size_t available_cores = - static_cast<size_t>(base::SysInfo::NumberOfProcessors()); - if (available_cores > 1) { - return available_cores - 1; - } - return 1; + return std::max(1, base::TaskScheduler::GetInstance() + ->GetMaxConcurrentTasksWithTraitsDeprecated( + kBackgroundThreadTaskTraits)); } void V8Platform::CallOnBackgroundThread( v8::Task* task, v8::Platform::ExpectedRuntime expected_runtime) { - base::WorkerPool::PostTask( - FROM_HERE, - base::Bind(&v8::Task::Run, base::Owned(task)), - expected_runtime == v8::Platform::kLongRunningTask); + base::PostTaskWithTraits(FROM_HERE, kBackgroundThreadTaskTraits, + base::Bind(&v8::Task::Run, base::Owned(task))); } void V8Platform::CallOnForegroundThread(v8::Isolate* isolate, v8::Task* task) {
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index 08253220..4926147 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -109,7 +109,7 @@ new CommandBufferServiceLocked(transfer_buffer_manager_.get())); executor_.reset( - new CommandExecutor(command_buffer_.get(), api_mock_.get(), NULL)); + new CommandExecutor(command_buffer_.get(), api_mock_.get())); command_buffer_->SetPutOffsetChangeCallback(base::Bind( &CommandExecutor::PutChanged, base::Unretained(executor_.get()))); command_buffer_->SetGetBufferChangeCallback(base::Bind(
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index d5ddc747d..c43a6282 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -54,7 +54,7 @@ new CommandBufferService(transfer_buffer_manager_.get())); executor_.reset( - new CommandExecutor(command_buffer_.get(), api_mock_.get(), NULL)); + new CommandExecutor(command_buffer_.get(), api_mock_.get())); command_buffer_->SetPutOffsetChangeCallback(base::Bind( &CommandExecutor::PutChanged, base::Unretained(executor_.get()))); command_buffer_->SetGetBufferChangeCallback(base::Bind(
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc index 9ac028e6..bca071da 100644 --- a/gpu/command_buffer/client/mapped_memory_unittest.cc +++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -51,7 +51,7 @@ new CommandBufferService(transfer_buffer_manager_.get())); executor_.reset( - new CommandExecutor(command_buffer_.get(), api_mock_.get(), NULL)); + new CommandExecutor(command_buffer_.get(), api_mock_.get())); command_buffer_->SetPutOffsetChangeCallback(base::Bind( &CommandExecutor::PutChanged, base::Unretained(executor_.get()))); command_buffer_->SetGetBufferChangeCallback(base::Bind(
diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc index cae42a4..834f478 100644 --- a/gpu/command_buffer/client/ring_buffer_test.cc +++ b/gpu/command_buffer/client/ring_buffer_test.cc
@@ -76,7 +76,7 @@ new CommandBufferService(transfer_buffer_manager_.get())); executor_.reset( - new CommandExecutor(command_buffer_.get(), api_mock_.get(), NULL)); + new CommandExecutor(command_buffer_.get(), api_mock_.get())); command_buffer_->SetPutOffsetChangeCallback(base::Bind( &CommandExecutor::PutChanged, base::Unretained(executor_.get()))); command_buffer_->SetGetBufferChangeCallback(base::Bind(
diff --git a/gpu/command_buffer/service/async_api_interface.h b/gpu/command_buffer/service/async_api_interface.h index 6c6220c..c2f32b1 100644 --- a/gpu/command_buffer/service/async_api_interface.h +++ b/gpu/command_buffer/service/async_api_interface.h
@@ -10,6 +10,7 @@ #include <stddef.h> #include <stdint.h> +#include "base/strings/string_piece.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/gpu_export.h" @@ -22,6 +23,9 @@ AsyncAPIInterface() {} virtual ~AsyncAPIInterface() {} + virtual void BeginDecoding() = 0; + virtual void EndDecoding() = 0; + // Executes a single command. // Parameters: // command: the command index. @@ -47,6 +51,8 @@ // Returns a name for a command. Useful for logging / debuging. virtual const char* GetCommandName(unsigned int command_id) const = 0; + + virtual base::StringPiece GetLogPrefix() = 0; }; } // namespace gpu
diff --git a/gpu/command_buffer/service/command_executor.cc b/gpu/command_buffer/service/command_executor.cc index fb70cf6..ca09ddb 100644 --- a/gpu/command_buffer/service/command_executor.cc +++ b/gpu/command_buffer/service/command_executor.cc
@@ -12,7 +12,7 @@ #include "base/message_loop/message_loop.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" -#include "gpu/command_buffer/service/logger.h" +#include "gpu/command_buffer/common/cmd_buffer_common.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_fence.h" #include "ui/gl/gl_switches.h" @@ -22,15 +22,14 @@ namespace gpu { CommandExecutor::CommandExecutor(CommandBufferServiceBase* command_buffer, - AsyncAPIInterface* handler, - gles2::GLES2Decoder* decoder) - : command_buffer_(command_buffer), handler_(handler), decoder_(decoder) {} + AsyncAPIInterface* handler) + : command_buffer_(command_buffer), handler_(handler) {} CommandExecutor::~CommandExecutor() {} void CommandExecutor::PutChanged() { - TRACE_EVENT1("gpu", "CommandExecutor:PutChanged", "decoder", - decoder_ ? decoder_->GetLogger()->GetLogPrefix() : "None"); + TRACE_EVENT1("gpu", "CommandExecutor:PutChanged", "handler", + handler_->GetLogPrefix().as_string()); CommandBuffer::State state = command_buffer_->GetState(); @@ -46,8 +45,7 @@ return; error::Error error = error::kNoError; - if (decoder_) - decoder_->BeginDecoding(); + handler_->BeginDecoding(); while (put_ != get_) { if (PauseExecution()) break; @@ -78,12 +76,7 @@ break; } - if (decoder_) { - if (!error::IsError(error) && decoder_->WasContextLost()) { - command_buffer_->SetParseError(error::kLostContext); - } - decoder_->EndDecoding(); - } + handler_->EndDecoding(); } void CommandExecutor::SetScheduled(bool scheduled) { @@ -92,16 +85,6 @@ scheduled_ = scheduled; } -bool CommandExecutor::HasPendingQueries() const { - return (decoder_ && decoder_->HasPendingQueries()); -} - -void CommandExecutor::ProcessPendingQueries() { - if (!decoder_) - return; - decoder_->ProcessPendingQueries(false); -} - bool CommandExecutor::SetGetBuffer(int32_t transfer_buffer_id) { scoped_refptr<Buffer> ring_buffer = command_buffer_->GetTransferBuffer(transfer_buffer_id); @@ -144,26 +127,6 @@ return pause; } -bool CommandExecutor::HasMoreIdleWork() const { - return (decoder_ && decoder_->HasMoreIdleWork()); -} - -void CommandExecutor::PerformIdleWork() { - if (!decoder_) - return; - decoder_->PerformIdleWork(); -} - -bool CommandExecutor::HasPollingWork() const { - return (decoder_ && decoder_->HasPollingWork()); -} - -void CommandExecutor::PerformPollingWork() { - if (!decoder_) - return; - decoder_->PerformPollingWork(); -} - error::Error CommandExecutor::ProcessCommands(int num_commands) { int num_entries = put_ < get_ ? entry_count_ - get_ : put_ - get_; int entries_processed = 0;
diff --git a/gpu/command_buffer/service/command_executor.h b/gpu/command_buffer/service/command_executor.h index c5af6203..9038488 100644 --- a/gpu/command_buffer/service/command_executor.h +++ b/gpu/command_buffer/service/command_executor.h
@@ -15,22 +15,20 @@ #include "base/memory/shared_memory.h" #include "gpu/command_buffer/service/async_api_interface.h" #include "gpu/command_buffer/service/command_buffer_service.h" -#include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/gpu_export.h" namespace gpu { +union CommandBufferEntry; + // This class schedules commands that have been flushed. They are received via -// a command buffer and forwarded to a command handler. TODO(apatrick): This -// class should not know about the decoder. Do not add additional dependencies -// on it. +// a command buffer and forwarded to a command handler. class GPU_EXPORT CommandExecutor { public: static const int kParseCommandsSlice = 20; CommandExecutor(CommandBufferServiceBase* command_buffer, - AsyncAPIInterface* handler, - gles2::GLES2Decoder* decoder); + AsyncAPIInterface* handler); ~CommandExecutor(); @@ -43,31 +41,11 @@ bool scheduled() const { return scheduled_; } - // Returns whether the scheduler needs to be polled again in the future to - // process pending queries. - bool HasPendingQueries() const; - - // Process pending queries and return. HasPendingQueries() can be used to - // determine if there's more pending queries after this has been called. - void ProcessPendingQueries(); - void SetCommandProcessedCallback(const base::Closure& callback); using PauseExecutionCallback = base::Callback<bool(void)>; void SetPauseExecutionCallback(const PauseExecutionCallback& callback); - // Returns whether the scheduler needs to be polled again in the future to - // process idle work. - bool HasMoreIdleWork() const; - - // Perform some idle work and return. HasMoreIdleWork() can be used to - // determine if there's more idle work do be done after this has been called. - void PerformIdleWork(); - - // Whether there is state that needs to be regularly polled. - bool HasPollingWork() const; - void PerformPollingWork(); - private: bool PauseExecution(); error::Error ProcessCommands(int num_commands); @@ -80,10 +58,6 @@ // This is used to execute commands. AsyncAPIInterface* handler_; - // Does not own decoder. TODO(apatrick): The CommandExecutor shouldn't need a - // pointer to the decoder. - gles2::GLES2Decoder* decoder_; - CommandBufferOffset get_; CommandBufferOffset put_; volatile CommandBufferEntry* buffer_;
diff --git a/gpu/command_buffer/service/command_executor_unittest.cc b/gpu/command_buffer/service/command_executor_unittest.cc index ffb2cc0a..9a6edb7 100644 --- a/gpu/command_buffer/service/command_executor_unittest.cc +++ b/gpu/command_buffer/service/command_executor_unittest.cc
@@ -42,8 +42,7 @@ // Creates an executor, with a buffer of the specified size (in entries). void MakeExecutor(unsigned int entry_count) { command_buffer_ = base::MakeUnique<FakeCommandBufferServiceBase>(); - executor_.reset( - new CommandExecutor(command_buffer_.get(), api_mock(), nullptr)); + executor_.reset(new CommandExecutor(command_buffer_.get(), api_mock())); SetNewGetBuffer(entry_count * sizeof(CommandBufferEntry)); }
diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc index 9153536..d05895f 100644 --- a/gpu/command_buffer/service/common_decoder_unittest.cc +++ b/gpu/command_buffer/service/common_decoder_unittest.cc
@@ -55,18 +55,22 @@ class TestCommonDecoder : public CommonDecoder { public: - // Overridden from AsyncAPIInterface + // AsyncAPIInterface implementation + void BeginDecoding() override {} + void EndDecoding() override {} + const char* GetCommandName(unsigned int command_id) const override { return GetCommonCommandName(static_cast<cmd::CommandId>(command_id)); } - // Overridden from AsyncAPIInterface error::Error DoCommand(unsigned int command, unsigned int arg_count, const volatile void* cmd_data) override { return DoCommonCommand(command, arg_count, cmd_data); } + base::StringPiece GetLogPrefix() override { return "None"; } + CommonDecoder::Bucket* GetBucket(uint32_t id) const { return CommonDecoder::GetBucket(id); }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index e073e57..e5500b99 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -498,6 +498,10 @@ return DoCommands(1, cmd_data, arg_count + 1, 0); } +base::StringPiece GLES2Decoder::GetLogPrefix() { + return GetLogger()->GetLogPrefix(); +} + // This class implements GLES2Decoder so we don't have to expose all the GLES2 // cmd stuff to outside this class. class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index f30d062..1266b0ff 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -311,8 +311,8 @@ virtual Logger* GetLogger() = 0; - virtual void BeginDecoding(); - virtual void EndDecoding(); + void BeginDecoding() override; + void EndDecoding() override; virtual const ContextState* GetContextState() = 0; virtual scoped_refptr<ShaderTranslatorInterface> GetTranslator( @@ -329,6 +329,8 @@ unsigned int arg_count, const volatile void* cmd_data) override; + base::StringPiece GetLogPrefix() override; + private: bool initialized_; bool debug_;
diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h index f90194e..896306f 100644 --- a/gpu/command_buffer/service/mocks.h +++ b/gpu/command_buffer/service/mocks.h
@@ -60,6 +60,9 @@ volatile CommandBufferEntry* args_; }; + void BeginDecoding() override {} + void EndDecoding() override {} + MOCK_METHOD3(DoCommand, error::Error(unsigned int command, unsigned int arg_count, @@ -75,6 +78,8 @@ return ""; }; + base::StringPiece GetLogPrefix() override { return "None"; } + // Sets the engine, to forward SetToken commands to it. void set_command_buffer_service( CommandBufferServiceBase* command_buffer_service) {
diff --git a/gpu/command_buffer/tests/fuzzer_main.cc b/gpu/command_buffer/tests/fuzzer_main.cc index 85a3487b..6417c28 100644 --- a/gpu/command_buffer/tests/fuzzer_main.cc +++ b/gpu/command_buffer/tests/fuzzer_main.cc
@@ -156,8 +156,7 @@ InitializeInitialCommandBuffer(); decoder_.reset(gles2::GLES2Decoder::Create(context_group.get())); - executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), - decoder_.get())); + executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get())); decoder_->set_command_buffer_service(command_buffer_.get()); decoder_->SetFenceSyncReleaseCallback(base::Bind( &CommandBufferSetup::OnFenceSyncRelease, base::Unretained(this)));
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc index ac81e3f..f5785ab2 100644 --- a/gpu/command_buffer/tests/gl_manager.cc +++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -313,8 +313,7 @@ command_buffer_.reset(new CommandBufferService( decoder_->GetContextGroup()->transfer_buffer_manager())); - executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), - decoder_.get())); + executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get())); decoder_->set_command_buffer_service(command_buffer_.get()); @@ -433,7 +432,7 @@ } void GLManager::PerformIdleWork() { - executor_->PerformIdleWork(); + decoder_->PerformIdleWork(); } void GLManager::Destroy() {
diff --git a/gpu/gles2_conform_support/egl/context.cc b/gpu/gles2_conform_support/egl/context.cc index d7fb1f3..540ba849 100644 --- a/gpu/gles2_conform_support/egl/context.cc +++ b/gpu/gles2_conform_support/egl/context.cc
@@ -275,8 +275,7 @@ return false; std::unique_ptr<gpu::CommandExecutor> command_executor( - new gpu::CommandExecutor(command_buffer.get(), decoder.get(), - decoder.get())); + new gpu::CommandExecutor(command_buffer.get(), decoder.get())); decoder->set_command_buffer_service(command_buffer.get());
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc index b8ad83a2..a092d39 100644 --- a/gpu/ipc/in_process_command_buffer.cc +++ b/gpu/ipc/in_process_command_buffer.cc
@@ -326,8 +326,7 @@ decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); decoder_->set_command_buffer_service(command_buffer.get()); - executor_.reset(new CommandExecutor(command_buffer.get(), decoder_.get(), - decoder_.get())); + executor_.reset(new CommandExecutor(command_buffer.get(), decoder_.get())); command_buffer->SetGetBufferChangeCallback(base::Bind( &CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); command_buffer_ = std::move(command_buffer); @@ -589,7 +588,7 @@ // If we've processed all pending commands but still have pending queries, // pump idle work until the query is passed. if (put_offset == command_buffer_->GetLastState().get_offset && - (executor_->HasMoreIdleWork() || executor_->HasPendingQueries())) { + (decoder_->HasMoreIdleWork() || decoder_->HasPendingQueries())) { ScheduleDelayedWorkOnGpuThread(); } } @@ -599,9 +598,9 @@ delayed_work_pending_ = false; base::AutoLock lock(command_buffer_lock_); if (MakeCurrent()) { - executor_->PerformIdleWork(); - executor_->ProcessPendingQueries(); - if (executor_->HasMoreIdleWork() || executor_->HasPendingQueries()) { + decoder_->PerformIdleWork(); + decoder_->ProcessPendingQueries(false); + if (decoder_->HasMoreIdleWork() || decoder_->HasPendingQueries()) { ScheduleDelayedWorkOnGpuThread(); } } @@ -919,7 +918,7 @@ void InProcessCommandBuffer::DescheduleUntilFinishedOnGpuThread() { if (!service_->BlockThreadOnWaitSyncToken()) { DCHECK(executor_->scheduled()); - DCHECK(executor_->HasPollingWork()); + DCHECK(decoder_->HasPollingWork()); executor_->SetScheduled(false); }
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc index a798308..7e2ef675 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.cc +++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -320,8 +320,8 @@ // Ensure that any delayed work that was created will be handled. if (have_context) { - if (executor_) - executor_->ProcessPendingQueries(); + if (decoder_) + decoder_->ProcessPendingQueries(false); ScheduleDelayedWork( base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); } @@ -412,7 +412,7 @@ if (decoder_.get() && !MakeCurrent()) return; - if (executor_) { + if (decoder_) { uint32_t current_unprocessed_num = channel()->sync_point_manager()->GetUnprocessedOrderNum(); // We're idle when no messages were processed or scheduled. @@ -430,11 +430,11 @@ if (is_idle) { last_idle_time_ = base::TimeTicks::Now(); - executor_->PerformIdleWork(); + decoder_->PerformIdleWork(); } - executor_->ProcessPendingQueries(); - executor_->PerformPollingWork(); + decoder_->ProcessPendingQueries(false); + decoder_->PerformPollingWork(); } ScheduleDelayedWork( @@ -451,9 +451,9 @@ } void GpuCommandBufferStub::ScheduleDelayedWork(base::TimeDelta delay) { - bool has_more_work = executor_.get() && (executor_->HasPendingQueries() || - executor_->HasMoreIdleWork() || - executor_->HasPollingWork()); + bool has_more_work = decoder_.get() && (decoder_->HasPendingQueries() || + decoder_->HasMoreIdleWork() || + decoder_->HasPollingWork()); if (!has_more_work) { last_idle_time_ = base::TimeTicks(); return; @@ -480,8 +480,7 @@ // for more work at the rate idle work is performed. This also ensures // that idle work is done as efficiently as possible without any // unnecessary delays. - if (executor_.get() && executor_->scheduled() && - executor_->HasMoreIdleWork()) { + if (executor_->scheduled() && decoder_->HasMoreIdleWork()) { delay = base::TimeDelta(); } @@ -646,8 +645,7 @@ new CommandBufferService(context_group_->transfer_buffer_manager())); decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); - executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), - decoder_.get())); + executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get())); sync_point_client_state_ = channel_->sync_point_manager()->CreateSyncPointClientState( @@ -1084,7 +1082,7 @@ void GpuCommandBufferStub::OnDescheduleUntilFinished() { DCHECK(executor_->scheduled()); - DCHECK(executor_->HasPollingWork()); + DCHECK(decoder_->HasPollingWork()); executor_->SetScheduled(false); channel_->OnCommandBufferDescheduled(this);
diff --git a/headless/lib/browser/headless_shell_application_mac.h b/headless/lib/browser/headless_shell_application_mac.h index c69b153..b9bdf913 100644 --- a/headless/lib/browser/headless_shell_application_mac.h +++ b/headless/lib/browser/headless_shell_application_mac.h
@@ -10,11 +10,15 @@ // Headless shell uses |MessagePumpMac|, so it needs to implement the // |CRAppProtocol|. -@interface HeadlessShellCrApplication : NSApplication<CrAppProtocol> +@interface HeadlessShellCrApplication + : NSApplication<CrAppProtocol, CrAppControlProtocol> // CrAppProtocol: - (BOOL)isHandlingSendEvent; +// CrAppControlProtocol: +- (void)setHandlingSendEvent:(BOOL)handlingSendEvent; + @end #endif // HEADLESS_LIB_BROWSER_HEADLESS_SHELL_APPLICATION_MAC_H_
diff --git a/headless/lib/browser/headless_shell_application_mac.mm b/headless/lib/browser/headless_shell_application_mac.mm index 12c3795..d1ac000 100644 --- a/headless/lib/browser/headless_shell_application_mac.mm +++ b/headless/lib/browser/headless_shell_application_mac.mm
@@ -13,4 +13,8 @@ return false; } +// This method is required to allow handling some input events on Mac OS. +- (void)setHandlingSendEvent:(BOOL)handlingSendEvent { +} + @end
diff --git a/infra/config/cq.cfg b/infra/config/cq.cfg index d567ae6e..2412a3e 100644 --- a/infra/config/cq.cfg +++ b/infra/config/cq.cfg
@@ -75,10 +75,7 @@ # TODO(dpranke): reenable ASAP; see crbug.com/669297. #builders { name: "linux_chromium_clobber_rel_ng" } builders { name: "linux_chromium_compile_dbg_ng" } - builders { - name: "linux_chromium_headless_rel" - experiment_percentage: 100 - } + builders { name: "linux_chromium_headless_rel" } builders { name: "linux_chromium_rel_ng" } builders { name: "linux_chromium_tsan_rel_ng" } }
diff --git a/ios/BUILD.gn b/ios/BUILD.gn index f2a11e2d..2ab6c244 100644 --- a/ios/BUILD.gn +++ b/ios/BUILD.gn
@@ -57,6 +57,7 @@ "//ios/web:all_tests", "//ios/web/shell/test:all_tests", "//ios/web_view/shell/test:all_tests", + "//ios/web_view/test:all_tests", ] } }
diff --git a/ios/web_view/test/BUILD.gn b/ios/web_view/test/BUILD.gn new file mode 100644 index 0000000..b4dbe82 --- /dev/null +++ b/ios/web_view/test/BUILD.gn
@@ -0,0 +1,43 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//ios/build/config.gni") +import("//build/config/ios/rules.gni") +import("//testing/test.gni") + +group("all_tests") { + testonly = true + deps = [ + ":ios_web_view_inttests", + ] +} + +test("ios_web_view_inttests") { + testonly = true + sources = [ + "boolean_observer.h", + "boolean_observer.mm", + "chrome_web_view_kvo_inttest.mm", + "chrome_web_view_test.h", + "chrome_web_view_test.mm", + "web_view_interaction_test_util.h", + "web_view_interaction_test_util.mm", + ] + + deps = [ + "//base", + "//base/test:run_all_unittests", + "//ios/testing:ios_test_support", + "//ios/web_view:web_view+link", + "//net", + "//net:test_support", + "//testing/gtest", + ] + + bundle_deps = [ "//ios/web_view:web_view+bundle" ] + + configs += [ "//build/config/compiler:enable_arc" ] + + assert_no_deps = ios_assert_no_deps +}
diff --git a/ios/web_view/test/DEPS b/ios/web_view/test/DEPS new file mode 100644 index 0000000..4ccbc06 --- /dev/null +++ b/ios/web_view/test/DEPS
@@ -0,0 +1,6 @@ +include_rules = [ + "+base", + "+ios/testing", + "+ios/web_view/public", + "+net", +]
diff --git a/ios/web_view/test/boolean_observer.h b/ios/web_view/test/boolean_observer.h new file mode 100644 index 0000000..154fe51 --- /dev/null +++ b/ios/web_view/test/boolean_observer.h
@@ -0,0 +1,35 @@ +// 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 IOS_WEB_VIEW_TEST_BOOLEAN_OBSERVER_H_ +#define IOS_WEB_VIEW_TEST_BOOLEAN_OBSERVER_H_ + +#import <Foundation/Foundation.h> + +// Class to observe a boolean KVO compliant property. To use this object, first +// create an instance of BooleanObserver and call |setObservedObject:keyPath:|. +// After an expected change in the value of |keyPath|, ask for |lastValue| and +// compare to the expected value. +@interface BooleanObserver : NSObject + +// The last value of performing |keyPath| on |object| after being notified of a +// KVO value change or null if a change has not been observed. +@property(nonatomic, nullable, readonly) NSNumber* lastValue; + +// The |keyPath| of |object| being observed. +@property(nonatomic, nullable, readonly) NSString* keyPath; + +// The current |object| being observed. +@property(nonatomic, nullable, readonly, weak) NSObject* object; + +// Sets the |object| and |keyPath| to observe. Performing |keyPath| on |object| +// must return a BOOL value and |keyPath| must be KVO compliant. +// If |object| is null and |self.object| is nonnull, |self.object| will stop +// being observed. If |object| is nonnull, |keyPath| must be nonnull. +- (void)setObservedObject:(nullable NSObject*)object + keyPath:(nullable NSString*)keyPath; + +@end + +#endif // IOS_WEB_VIEW_TEST_BOOLEAN_OBSERVER_H_
diff --git a/ios/web_view/test/boolean_observer.mm b/ios/web_view/test/boolean_observer.mm new file mode 100644 index 0000000..fc2b5f2 --- /dev/null +++ b/ios/web_view/test/boolean_observer.mm
@@ -0,0 +1,46 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web_view/test/boolean_observer.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation BooleanObserver + +@synthesize keyPath = _keyPath; +@synthesize lastValue = _lastValue; +@synthesize object = _object; + +- (void)setObservedObject:(NSObject*)object keyPath:(NSString*)keyPath { + [_object removeObserver:self forKeyPath:_keyPath]; + + _lastValue = nil; + _keyPath = [keyPath copy]; + _object = object; + if (keyPath) { + [_object addObserver:self + forKeyPath:_keyPath + options:NSKeyValueObservingOptionNew + context:nil]; + } +} + +- (void)observeValueForKeyPath:(NSString*)keyPath + ofObject:(id)object + change:(NSDictionary<NSKeyValueChangeKey, id>*)change + context:(void*)context { + if (![object isEqual:_object] || ![keyPath isEqualToString:_keyPath]) { + // Ignore extraneous call from previous |_object| or |_keyPath|. + return; + } + _lastValue = change[NSKeyValueChangeNewKey]; +} + +- (void)dealloc { + [_object removeObserver:self forKeyPath:_keyPath]; +} + +@end
diff --git a/ios/web_view/test/chrome_web_view_kvo_inttest.mm b/ios/web_view/test/chrome_web_view_kvo_inttest.mm new file mode 100644 index 0000000..4425439e --- /dev/null +++ b/ios/web_view/test/chrome_web_view_kvo_inttest.mm
@@ -0,0 +1,96 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <ChromeWebView/ChromeWebView.h> +#import <Foundation/Foundation.h> + +#import "base/mac/scoped_nsobject.h" +#import "ios/web_view/test/boolean_observer.h" +#import "ios/web_view/test/chrome_web_view_test.h" +#import "ios/web_view/test/web_view_interaction_test_util.h" +#import "net/base/mac/url_conversions.h" +#include "testing/gtest_mac.h" +#include "url/gurl.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +// Tests that the KVO compliant properties of CWVWebView correctly report +// changes. +class ChromeWebViewKvoTest : public ios_web_view::ChromeWebViewTest { + protected: + ChromeWebViewKvoTest() { + CWVWebViewConfiguration* configuration = + [CWVWebViewConfiguration defaultConfiguration]; + web_view_.reset([[CWVWebView alloc] + initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0) + configuration:configuration]); + } + + // Web View used to listen for expected KVO property changes. + base::scoped_nsobject<CWVWebView> web_view_; +}; + +namespace ios_web_view { + +// Tests that CWVWebView correctly reports |canGoBack| and |canGoForward| state. +TEST_F(ChromeWebViewKvoTest, CanGoBackForward) { + BooleanObserver* back_observer = [[BooleanObserver alloc] init]; + [back_observer setObservedObject:web_view_ keyPath:@"canGoBack"]; + + BooleanObserver* forward_observer = [[BooleanObserver alloc] init]; + [forward_observer setObservedObject:web_view_ keyPath:@"canGoForward"]; + + ASSERT_FALSE(back_observer.lastValue); + ASSERT_FALSE(forward_observer.lastValue); + + // Define pages in reverse order so the links can reference the "next" page. + GURL page_3_url = GetUrlForPageWithTitle("Page 3"); + + std::string page_2_html = + "<a id='link_2' href='" + page_3_url.spec() + "'>Link 2</a>"; + GURL page_2_url = GetUrlForPageWithHTMLBody(page_2_html); + + std::string page_1_html = + "<a id='link_1' href='" + page_2_url.spec() + "'>Link 1</a>"; + GURL page_1_url = GetUrlForPageWithHTMLBody(page_1_html); + + LoadUrl(web_view_, net::NSURLWithGURL(page_1_url)); + // Loading initial URL should not affect back/forward navigation state. + EXPECT_FALSE([back_observer.lastValue boolValue]); + EXPECT_FALSE([forward_observer.lastValue boolValue]); + + // Navigate to page 2. + EXPECT_TRUE(test::TapChromeWebViewElementWithId(web_view_, @"link_1")); + WaitForPageLoadCompletion(web_view_); + EXPECT_TRUE([back_observer.lastValue boolValue]); + EXPECT_FALSE([forward_observer.lastValue boolValue]); + + // Navigate back to page 1. + [web_view_ goBack]; + WaitForPageLoadCompletion(web_view_); + EXPECT_FALSE([back_observer.lastValue boolValue]); + EXPECT_TRUE([forward_observer.lastValue boolValue]); + + // Navigate forward to page 2. + [web_view_ goForward]; + WaitForPageLoadCompletion(web_view_); + EXPECT_TRUE([back_observer.lastValue boolValue]); + EXPECT_FALSE([forward_observer.lastValue boolValue]); + + // Navigate to page 3. + EXPECT_TRUE(test::TapChromeWebViewElementWithId(web_view_, @"link_2")); + WaitForPageLoadCompletion(web_view_); + EXPECT_TRUE([back_observer.lastValue boolValue]); + EXPECT_FALSE([forward_observer.lastValue boolValue]); + + // Navigate back to page 2. + [web_view_ goBack]; + WaitForPageLoadCompletion(web_view_); + EXPECT_TRUE([back_observer.lastValue boolValue]); + EXPECT_TRUE([forward_observer.lastValue boolValue]); +} + +} // namespace ios_web_view
diff --git a/ios/web_view/test/chrome_web_view_test.h b/ios/web_view/test/chrome_web_view_test.h new file mode 100644 index 0000000..5605a64 --- /dev/null +++ b/ios/web_view/test/chrome_web_view_test.h
@@ -0,0 +1,58 @@ +// 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 IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ +#define IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ + +#include <memory> +#include <string> + +#include "testing/platform_test.h" + +namespace net { +namespace test_server { +class EmbeddedTestServer; +} // namespace test_server +} // namespace net + +@class CWVWebView; +class GURL; +@class NSURL; + +namespace ios_web_view { + +// A test fixture for testing CWVWebView. A test server is also created to +// support loading content. The server supports the urls defined by +// RegisterDefaultHandlers in net/test/embedded_test_server/default_handlers.h +// as well as urls returned by the GetUrl* methods below. +class ChromeWebViewTest : public PlatformTest { + protected: + ChromeWebViewTest(); + ~ChromeWebViewTest() override; + + // Returns URL to an html page with title set to |title|. + GURL GetUrlForPageWithTitle(const std::string& title); + + // Returns URL to an html page with |html| within page's body tags. + GURL GetUrlForPageWithHTMLBody(const std::string& html); + + // Loads |URL| in |web_view| and waits until the load completes. Asserts if + // loading does not complete. + void LoadUrl(CWVWebView* web_view, NSURL* url); + + // Waits until |web_view| stops loading. Asserts if loading does not complete. + void WaitForPageLoadCompletion(CWVWebView* web_view); + + // PlatformTest methods. + void SetUp() override; + + // Embedded server for handling responses to urls as registered by + // net/test/embedded_test_server/default_handlers.h and the GetURLForPageWith* + // methods. + std::unique_ptr<net::test_server::EmbeddedTestServer> test_server_; +}; + +} // namespace ios_web_view + +#endif // IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_
diff --git a/ios/web_view/test/chrome_web_view_test.mm b/ios/web_view/test/chrome_web_view_test.mm new file mode 100644 index 0000000..44942e5 --- /dev/null +++ b/ios/web_view/test/chrome_web_view_test.mm
@@ -0,0 +1,98 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web_view/test/chrome_web_view_test.h" + +#import <ChromeWebView/ChromeWebView.h> +#import <Foundation/Foundation.h> + +#include "base/base64.h" +#import "base/memory/ptr_util.h" +#import "ios/testing/wait_util.h" +#include "net/test/embedded_test_server/default_handlers.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/test/embedded_test_server/http_request.h" +#include "net/test/embedded_test_server/http_response.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +// Test server path which echos the remainder of the url as html. The html +// must be base64 encoded. +const char kPageHtmlBodyPath[] = "/PageHtmlBody?"; + +// Generates an html response from a request to |kPageHtmlBodyPath|. +std::unique_ptr<net::test_server::HttpResponse> EchoPageHTMLBodyInResponse( + const net::test_server::HttpRequest& request) { + DCHECK(base::StartsWith(request.relative_url, kPageHtmlBodyPath, + base::CompareCase::INSENSITIVE_ASCII)); + + std::string body = request.relative_url.substr(strlen(kPageHtmlBodyPath)); + + std::string unescaped_body; + base::Base64Decode(body, &unescaped_body); + std::string html = "<html><body>" + unescaped_body + "</body></html>"; + + auto http_response = base::MakeUnique<net::test_server::BasicHttpResponse>(); + http_response->set_content(html); + return std::move(http_response); +} + +// Maps test server requests to responses. +std::unique_ptr<net::test_server::HttpResponse> TestRequestHandler( + const net::test_server::HttpRequest& request) { + if (base::StartsWith(request.relative_url, kPageHtmlBodyPath, + base::CompareCase::INSENSITIVE_ASCII)) { + return EchoPageHTMLBodyInResponse(request); + } + return nullptr; +} + +} // namespace + +namespace ios_web_view { + +ChromeWebViewTest::ChromeWebViewTest() + : test_server_(base::MakeUnique<net::EmbeddedTestServer>( + net::test_server::EmbeddedTestServer::TYPE_HTTP)) { + net::test_server::RegisterDefaultHandlers(test_server_.get()); + test_server_->RegisterRequestHandler(base::Bind(&TestRequestHandler)); +} + +ChromeWebViewTest::~ChromeWebViewTest() = default; + +void ChromeWebViewTest::SetUp() { + PlatformTest::SetUp(); + ASSERT_TRUE(test_server_->Start()); +} + +GURL ChromeWebViewTest::GetUrlForPageWithTitle(const std::string& title) { + return test_server_->GetURL("/echotitle/" + title); +} + +GURL ChromeWebViewTest::GetUrlForPageWithHTMLBody(const std::string& html) { + std::string base64_html; + base::Base64Encode(html, &base64_html); + return test_server_->GetURL(kPageHtmlBodyPath + base64_html); +} + +void ChromeWebViewTest::LoadUrl(CWVWebView* web_view, NSURL* url) { + [web_view loadRequest:[NSURLRequest requestWithURL:url]]; + + WaitForPageLoadCompletion(web_view); +} + +void ChromeWebViewTest::WaitForPageLoadCompletion(CWVWebView* web_view) { + BOOL success = + testing::WaitUntilConditionOrTimeout(testing::kWaitForPageLoadTimeout, ^{ + return !web_view.isLoading; + }); + ASSERT_TRUE(success); +} + +} // namespace ios_web_view
diff --git a/ios/web_view/test/web_view_interaction_test_util.h b/ios/web_view/test/web_view_interaction_test_util.h new file mode 100644 index 0000000..830b002 --- /dev/null +++ b/ios/web_view/test/web_view_interaction_test_util.h
@@ -0,0 +1,21 @@ +// 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 IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_ +#define IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_ + +@class CWVWebView; +@class NSString; + +namespace ios_web_view { +namespace test { + +// Returns whether the element with |element_id| in the passed |web_view| has +// been tapped using a JavaScript click() event. +bool TapChromeWebViewElementWithId(CWVWebView* web_view, NSString* element_id); + +} // namespace test +} // namespace ios_web_view + +#endif // IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_
diff --git a/ios/web_view/test/web_view_interaction_test_util.mm b/ios/web_view/test/web_view_interaction_test_util.mm new file mode 100644 index 0000000..205e45c --- /dev/null +++ b/ios/web_view/test/web_view_interaction_test_util.mm
@@ -0,0 +1,46 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web_view/test/web_view_interaction_test_util.h" + +#import <ChromeWebView/ChromeWebView.h> + +#import "ios/testing/wait_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace ios_web_view { +namespace test { + +bool TapChromeWebViewElementWithId(CWVWebView* web_view, NSString* element_id) { + // TODO(crbug.com/725524): Share this script with Chrome. + NSString* script = [NSString + stringWithFormat:@"(function() {" + " var element = document.getElementById('%@');" + " if (element) {" + " element.click();" + " return true;" + " }" + " return false;" + "})();", + element_id]; + __block bool did_complete = false; + __block bool element_found = false; + [web_view evaluateJavaScript:script + completionHandler:^(id result, NSError*) { + did_complete = true; + element_found = [result boolValue]; + }]; + + testing::WaitUntilConditionOrTimeout(testing::kWaitForJSCompletionTimeout, ^{ + return did_complete; + }); + + return element_found; +} + +} // namespace test +} // namespace ios_web_view
diff --git a/media/mojo/clients/BUILD.gn b/media/mojo/clients/BUILD.gn index 738515a..8fba059 100644 --- a/media/mojo/clients/BUILD.gn +++ b/media/mojo/clients/BUILD.gn
@@ -6,7 +6,7 @@ source_set("clients") { visibility = [ "//chromecast/*", - "//content/renderer", + "//content/renderer:*", # TODO(xhwang): Only allow //media/mojo:media_mojo_unittests "//media/mojo:*",
diff --git a/net/quic/platform/impl/quic_chromium_clock.cc b/net/quic/platform/impl/quic_chromium_clock.cc index fb591f84..78ca26e 100644 --- a/net/quic/platform/impl/quic_chromium_clock.cc +++ b/net/quic/platform/impl/quic_chromium_clock.cc
@@ -4,12 +4,6 @@ #include "net/quic/platform/impl/quic_chromium_clock.h" -#if defined(OS_IOS) -#include <time.h> - -#include "base/ios/ios_util.h" -#endif - #include "base/memory/singleton.h" #include "base/time/time.h" @@ -29,21 +23,17 @@ } QuicTime QuicChromiumClock::Now() const { -#if defined(OS_IOS) - if (base::ios::IsRunningOnIOS10OrLater()) { - struct timespec tp; - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { - return CreateTimeFromMicroseconds(tp.tv_sec * 1000000 + - tp.tv_nsec / 1000); - } - } -#endif - return CreateTimeFromMicroseconds(base::TimeTicks::Now().ToInternalValue()); + int64_t ticks = (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds(); + DCHECK_GE(ticks, 0); + return CreateTimeFromMicroseconds(ticks); } QuicWallTime QuicChromiumClock::WallNow() const { - return QuicWallTime::FromUNIXMicroseconds(base::Time::Now().ToJavaTime() * - 1000); + const base::TimeDelta time_since_unix_epoch = + base::Time::Now() - base::Time::UnixEpoch(); + int64_t time_since_unix_epoch_micro = time_since_unix_epoch.InMicroseconds(); + DCHECK_GE(time_since_unix_epoch_micro, 0); + return QuicWallTime::FromUNIXMicroseconds(time_since_unix_epoch_micro); } } // namespace net
diff --git a/net/spdy/core/spdy_deframer_visitor_test.cc b/net/spdy/core/spdy_deframer_visitor_test.cc index 32e7403..9ed930c 100644 --- a/net/spdy/core/spdy_deframer_visitor_test.cc +++ b/net/spdy/core/spdy_deframer_visitor_test.cc
@@ -99,7 +99,7 @@ const CollectedFrame& cf0 = collected_frames_[0]; ASSERT_NE(cf0.frame_ir, nullptr); - SpdyDataIR expected_ir(1, "hello"); + SpdyDataIR expected_ir(/* stream_id = */ 1, "hello"); expected_ir.set_padding_len(8); EXPECT_TRUE(cf0.VerifyHasFrame(expected_ir)); } @@ -135,7 +135,7 @@ EXPECT_TRUE(cf0.VerifyHasHeaders(headers)); - SpdyHeadersIR expected_ir(1); + SpdyHeadersIR expected_ir(/* stream_id = */ 1); // Yet again SpdyFramerVisitorInterface is lossy: it doesn't call OnPadding // for HEADERS, just for DATA. Sigh. // expected_ir.set_padding_len(5); @@ -174,7 +174,9 @@ ASSERT_EQ(1u, collected_frames_.size()); const CollectedFrame& cf0 = collected_frames_[0]; - SpdyPriorityIR expected_ir(101, 1, 17, true); + SpdyPriorityIR expected_ir(/* stream_id = */ 101, + /* parent_stream_id = */ 1, /* weight = */ 17, + /* exclusive = */ true); EXPECT_TRUE(cf0.VerifyHasFrame(expected_ir)); // Confirm that mismatches are also detected.
diff --git a/net/spdy/core/spdy_framer_test.cc b/net/spdy/core/spdy_framer_test.cc index ba50672d..a318bcfc 100644 --- a/net/spdy/core/spdy_framer_test.cc +++ b/net/spdy/core/spdy_framer_test.cc
@@ -822,7 +822,7 @@ SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION); // Encode the header block into a Headers frame. - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.SetHeader("alpha", "beta"); headers.SetHeader("gamma", "charlie"); headers.SetHeader("cookie", "key1=value1; key2=value2"); @@ -842,7 +842,7 @@ SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION); // Encode the header block into a Headers frame. - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.SetHeader("alpha", "beta"); headers.SetHeader("gamma", "charlie"); SpdySerializedFrame frame( @@ -1072,7 +1072,7 @@ framer.set_visitor(&visitor); const char bytes[] = "hello"; - SpdyDataIR data_ir(0, bytes); + SpdyDataIR data_ir(/* stream_id = */ 0, bytes); SpdySerializedFrame frame(framer.SerializeData(data_ir)); // We shouldn't have to read the whole frame before we signal an error. @@ -1090,7 +1090,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyHeadersIR headers(0); + SpdyHeadersIR headers(/* stream_id = */ 0); headers.SetHeader("alpha", "beta"); SpdySerializedFrame frame( SpdyFramerPeer::SerializeHeaders(&framer, headers, &output_)); @@ -1110,7 +1110,10 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyPriorityIR priority_ir(0, 1, 16, true); + SpdyPriorityIR priority_ir(/* stream_id = */ 0, + /* parent_stream_id = */ 1, + /* weight = */ 16, + /* exclusive = */ true); SpdySerializedFrame frame(framer.SerializeFrame(priority_ir)); if (use_output_) { EXPECT_EQ(framer.SerializeFrame(priority_ir, &output_), frame.size()); @@ -1132,7 +1135,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyRstStreamIR rst_stream_ir(0, ERROR_CODE_PROTOCOL_ERROR); + SpdyRstStreamIR rst_stream_ir(/* stream_id = */ 0, ERROR_CODE_PROTOCOL_ERROR); SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream_ir)); if (use_output_) { EXPECT_TRUE(framer.SerializeRstStream(rst_stream_ir, &output_)); @@ -1209,7 +1212,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyContinuationIR continuation(0); + SpdyContinuationIR continuation(/* stream_id = */ 0); auto some_nonsense_encoding = SpdyMakeUnique<SpdyString>("some nonsense encoding"); continuation.take_encoding(std::move(some_nonsense_encoding)); @@ -1235,7 +1238,8 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyPushPromiseIR push_promise(0, 4); + SpdyPushPromiseIR push_promise(/* stream_id = */ 0, + /* promised_stream_id = */ 4); push_promise.SetHeader("alpha", "beta"); SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise( &framer, push_promise, use_output_ ? &output_ : nullptr)); @@ -1255,7 +1259,8 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyPushPromiseIR push_promise(3, 0); + SpdyPushPromiseIR push_promise(/* stream_id = */ 3, + /* promised_stream_id = */ 0); push_promise.SetHeader("alpha", "beta"); SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise( &framer, push_promise, use_output_ ? &output_ : nullptr)); @@ -1478,14 +1483,15 @@ const char kValue1[] = "value1"; const char kValue2[] = "value2"; - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.SetHeader(kHeader1, kValue1); headers.SetHeader(kHeader2, kValue2); SpdySerializedFrame headers_frame(SpdyFramerPeer::SerializeHeaders( &framer, headers, use_output_ ? &output_ : nullptr)); const char bytes[] = "this is a test test test test test!"; - SpdyDataIR data_ir(1, SpdyStringPiece(bytes, arraysize(bytes))); + SpdyDataIR data_ir(/* stream_id = */ 1, + SpdyStringPiece(bytes, arraysize(bytes))); data_ir.set_fin(true); SpdySerializedFrame send_frame(framer.SerializeData(data_ir)); @@ -1514,7 +1520,8 @@ TEST_P(SpdyFramerTest, WindowUpdateFrame) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyWindowUpdateIR window_update(1, 0x12345678); + SpdyWindowUpdateIR window_update(/* stream_id = */ 1, + /* delta = */ 0x12345678); SpdySerializedFrame frame(framer.SerializeWindowUpdate(window_update)); if (use_output_) { ASSERT_TRUE(framer.SerializeWindowUpdate(window_update, &output_)); @@ -1550,11 +1557,11 @@ // frame-format on const char bytes[] = "hello"; - SpdyDataIR data_ir(1, bytes); + SpdyDataIR data_ir(/* stream_id = */ 1, bytes); SpdySerializedFrame frame(framer.SerializeData(data_ir)); CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); - SpdyDataIR data_header_ir(1); + SpdyDataIR data_header_ir(/* stream_id = */ 1); data_header_ir.SetDataShallow(bytes); frame = framer.SerializeDataFrameHeaderWithPaddingLengthField(data_header_ir); @@ -1601,7 +1608,7 @@ // clang-format on const char bytes[] = "hello"; - SpdyDataIR data_ir(1, bytes); + SpdyDataIR data_ir(/* stream_id = */ 1, bytes); // 247 zeros and the pad length field make the overall padding to be 248 // bytes. data_ir.set_padding_len(248); @@ -1632,7 +1639,7 @@ // frame-format on const char bytes[] = "hello"; - SpdyDataIR data_ir(1, bytes); + SpdyDataIR data_ir(/* stream_id = */ 1, bytes); // 7 zeros and the pad length field make the overall padding to be 8 bytes. data_ir.set_padding_len(8); SpdySerializedFrame frame(framer.SerializeData(data_ir)); @@ -1655,7 +1662,7 @@ // frame-format on const char bytes[] = "hello"; - SpdyDataIR data_ir(1, bytes); + SpdyDataIR data_ir(/* stream_id = */ 1, bytes); // The pad length field itself is used for the 1-byte padding and no padding // payload is needed. data_ir.set_padding_len(1); @@ -1678,7 +1685,7 @@ 0x00, 0x00, 0x00, 0x01, // Stream: 1 0xff, // Payload }; - SpdyDataIR data_ir(1, "\xff"); + SpdyDataIR data_ir(/* stream_id = */ 1, "\xff"); SpdySerializedFrame frame(framer.SerializeData(data_ir)); CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); } @@ -1693,7 +1700,7 @@ 0x68, 0x65, 0x6c, 0x6c, // Payload 0x6f, // }; - SpdyDataIR data_ir(1, "hello"); + SpdyDataIR data_ir(/* stream_id = */ 1, "hello"); data_ir.set_fin(true); SpdySerializedFrame frame(framer.SerializeData(data_ir)); CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -1707,7 +1714,7 @@ 0x00, // Flags: none 0x00, 0x00, 0x00, 0x01, // Stream: 1 }; - SpdyDataIR data_ir(1, ""); + SpdyDataIR data_ir(/* stream_id = */ 1, ""); SpdySerializedFrame frame(framer.SerializeData(data_ir)); CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -1728,7 +1735,7 @@ 0x68, 0x65, 0x6c, 0x6c, // Payload 0x6f, // }; - SpdyDataIR data_ir(0x7fffffff, "hello"); + SpdyDataIR data_ir(/* stream_id = */ 0x7fffffff, "hello"); data_ir.set_fin(true); SpdySerializedFrame frame(framer.SerializeData(data_ir)); CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -1747,7 +1754,7 @@ 0x00, 0x00, 0x00, 0x01, // Stream: 1 0x00, 0x00, 0x00, 0x01, // Error: PROTOCOL_ERROR }; - SpdyRstStreamIR rst_stream(1, ERROR_CODE_PROTOCOL_ERROR); + SpdyRstStreamIR rst_stream(/* stream_id = */ 1, ERROR_CODE_PROTOCOL_ERROR); SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream)); if (use_output_) { ASSERT_TRUE(framer.SerializeRstStream(rst_stream, &output_)); @@ -1766,7 +1773,8 @@ 0x7f, 0xff, 0xff, 0xff, // Stream: 0x7fffffff 0x00, 0x00, 0x00, 0x01, // Error: PROTOCOL_ERROR }; - SpdyRstStreamIR rst_stream(0x7FFFFFFF, ERROR_CODE_PROTOCOL_ERROR); + SpdyRstStreamIR rst_stream(/* stream_id = */ 0x7FFFFFFF, + ERROR_CODE_PROTOCOL_ERROR); SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream)); if (use_output_) { output_.Reset(); @@ -1785,7 +1793,8 @@ 0x7f, 0xff, 0xff, 0xff, // Stream: 0x7fffffff 0x00, 0x00, 0x00, 0x02, // Error: INTERNAL_ERROR }; - SpdyRstStreamIR rst_stream(0x7FFFFFFF, ERROR_CODE_INTERNAL_ERROR); + SpdyRstStreamIR rst_stream(/* stream_id = */ 0x7FFFFFFF, + ERROR_CODE_INTERNAL_ERROR); SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream)); if (use_output_) { output_.Reset(); @@ -1938,7 +1947,8 @@ 0x00, 0x00, 0x00, 0x00, // Error: NO_ERROR 0x47, 0x41, // Description }; - SpdyGoAwayIR goaway_ir(0, ERROR_CODE_NO_ERROR, "GA"); + SpdyGoAwayIR goaway_ir(/* last_good_stream_id = */ 0, ERROR_CODE_NO_ERROR, + "GA"); SpdySerializedFrame frame(framer.SerializeGoAway(goaway_ir)); if (use_output_) { ASSERT_TRUE(framer.SerializeGoAway(goaway_ir, &output_)); @@ -1958,7 +1968,8 @@ 0x00, 0x00, 0x00, 0x02, // Error: INTERNAL_ERROR 0x47, 0x41, // Description }; - SpdyGoAwayIR goaway_ir(0x7FFFFFFF, ERROR_CODE_INTERNAL_ERROR, "GA"); + SpdyGoAwayIR goaway_ir(/* last_good_stream_id = */ 0x7FFFFFFF, + ERROR_CODE_INTERNAL_ERROR, "GA"); SpdySerializedFrame frame(framer.SerializeGoAway(goaway_ir)); if (use_output_) { output_.Reset(); @@ -1994,8 +2005,7 @@ 0x62, 0x61, 0x72, // bar }; // frame-format on - - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.SetHeader("bar", "foo"); headers.SetHeader("foo", "bar"); SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( @@ -2025,7 +2035,7 @@ 0x62, 0x61, 0x72, // bar }; // frame-format on - SpdyHeadersIR headers(0x7fffffff); + SpdyHeadersIR headers(/* stream_id = */ 0x7fffffff); headers.set_fin(true); headers.SetHeader("", "foo"); headers.SetHeader("foo", "bar"); @@ -2056,7 +2066,7 @@ 0x00, // Value Len: 0 }; // frame-format on - SpdyHeadersIR headers_ir(0x7fffffff); + SpdyHeadersIR headers_ir(/* stream_id = */ 0x7fffffff); headers_ir.set_fin(true); headers_ir.SetHeader("bar", "foo"); headers_ir.SetHeader("foo", ""); @@ -2090,7 +2100,7 @@ 0x00, // Value Len: 0 }; // frame-format on - SpdyHeadersIR headers_ir(0x7fffffff); + SpdyHeadersIR headers_ir(/* stream_id = */ 0x7fffffff); headers_ir.set_fin(true); headers_ir.set_has_priority(true); headers_ir.set_weight(220); @@ -2127,7 +2137,7 @@ 0x00, // Value Len: 0 }; // frame-format on - SpdyHeadersIR headers_ir(0x7fffffff); + SpdyHeadersIR headers_ir(/* stream_id = */ 0x7fffffff); headers_ir.set_fin(true); headers_ir.set_has_priority(true); headers_ir.set_weight(220); @@ -2166,7 +2176,7 @@ 0x00, // Value Len: 0 }; // frame-format on - SpdyHeadersIR headers_ir(0x7fffffff); + SpdyHeadersIR headers_ir(/* stream_id = */ 0x7fffffff); headers_ir.set_fin(true); headers_ir.set_has_priority(true); headers_ir.set_weight(220); @@ -2206,7 +2216,7 @@ 0x00, // Padding }; // frame-format on - SpdyHeadersIR headers_ir(0x7fffffff); + SpdyHeadersIR headers_ir(/* stream_id = */ 0x7fffffff); headers_ir.set_fin(true); headers_ir.SetHeader("", "foo"); headers_ir.SetHeader("foo", "bar"); @@ -2229,12 +2239,12 @@ 0x00, 0x00, 0x00, 0x01, // Stream: 1 0x00, 0x00, 0x00, 0x01, // Increment: 1 }; - SpdySerializedFrame frame( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(1, 1))); + SpdySerializedFrame frame(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1))); if (use_output_) { output_.Reset(); - ASSERT_TRUE( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(1, 1), &output_)); + ASSERT_TRUE(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1), &output_)); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); } CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -2249,12 +2259,13 @@ 0x7f, 0xff, 0xff, 0xff, // Stream: 0x7fffffff 0x00, 0x00, 0x00, 0x01, // Increment: 1 }; - SpdySerializedFrame frame( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(0x7FFFFFFF, 1))); + SpdySerializedFrame frame(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 0x7FFFFFFF, /* delta = */ 1))); if (use_output_) { output_.Reset(); ASSERT_TRUE(framer.SerializeWindowUpdate( - SpdyWindowUpdateIR(0x7FFFFFFF, 1), &output_)); + SpdyWindowUpdateIR(/* stream_id = */ 0x7FFFFFFF, /* delta = */ 1), + &output_)); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); } CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -2269,12 +2280,13 @@ 0x00, 0x00, 0x00, 0x01, // Stream: 1 0x7f, 0xff, 0xff, 0xff, // Increment: 0x7fffffff }; - SpdySerializedFrame frame( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(1, 0x7FFFFFFF))); + SpdySerializedFrame frame(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 0x7FFFFFFF))); if (use_output_) { output_.Reset(); ASSERT_TRUE(framer.SerializeWindowUpdate( - SpdyWindowUpdateIR(1, 0x7FFFFFFF), &output_)); + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 0x7FFFFFFF), + &output_)); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); } CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData)); @@ -2309,7 +2321,8 @@ }; // frame-format on - SpdyPushPromiseIR push_promise(41, 58); + SpdyPushPromiseIR push_promise(/* stream_id = */ 41, + /* promised_stream_id = */ 58); push_promise.SetHeader("bar", "foo"); push_promise.SetHeader("foo", "bar"); SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise( @@ -2345,7 +2358,8 @@ }; // frame-format on - SpdyPushPromiseIR push_promise(41, 58); + SpdyPushPromiseIR push_promise(/* stream_id = */ 41, + /* promised_stream_id = */ 58); push_promise.set_padding_len(1); push_promise.SetHeader("bar", "foo"); push_promise.SetHeader("foo", "bar"); @@ -2404,7 +2418,8 @@ // clang-format on // frame-format on - SpdyPushPromiseIR push_promise(42, 57); + SpdyPushPromiseIR push_promise(/* stream_id = */ 42, + /* promised_stream_id = */ 57); push_promise.set_padding_len(177); push_promise.SetHeader("bar", "foo"); push_promise.SetHeader("foo", "bar"); @@ -2462,7 +2477,7 @@ encoder.DisableCompression(); encoder.EncodeHeaderSet(header_block, buffer.get()); - SpdyContinuationIR continuation(42); + SpdyContinuationIR continuation(/* stream_id = */ 42); continuation.take_encoding(std::move(buffer)); continuation.set_end_headers(true); @@ -2570,7 +2585,8 @@ }; // frame-format on - SpdyPushPromiseIR push_promise(42, 57); + SpdyPushPromiseIR push_promise(/* stream_id = */ 42, + /* promised_stream_id = */ 57); push_promise.set_padding_len(1); SpdyString big_value(TestSpdyVisitor::sent_control_frame_max_size(), 'x'); push_promise.SetHeader("xxx", big_value); @@ -2626,7 +2642,7 @@ '3', 'A', 'd', '=', '"', 'h', '_', '\\', '\\', 'o', '\\', '"', 's', 't', ':', '1', '2', '3', '"', ';', ' ', 'm', 'a', '=', '4', '2', ';', ' ', 'v', '=', '"', '2', '4', '"'}; - SpdyAltSvcIR altsvc_ir(3); + SpdyAltSvcIR altsvc_ir(/* stream_id = */ 3); altsvc_ir.set_origin("origin"); altsvc_ir.add_altsvc(SpdyAltSvcWireFormat::AlternativeService( "pid1", "host", 443, 5, SpdyAltSvcWireFormat::VersionVector())); @@ -2653,7 +2669,10 @@ 0x80, 0x00, 0x00, 0x01, // Parent: 1 (Exclusive) 0x10, // Weight: 17 }; - SpdyPriorityIR priority_ir(2, 1, 17, true); + SpdyPriorityIR priority_ir(/* stream_id = */ 2, + /* parent_stream_id = */ 1, + /* weight = */ 17, + /* exclusive = */ true); SpdySerializedFrame frame(framer.SerializeFrame(priority_ir)); if (use_output_) { EXPECT_EQ(framer.SerializeFrame(priority_ir, &output_), frame.size()); @@ -2664,7 +2683,7 @@ TEST_P(SpdyFramerTest, ReadCompressedHeadersHeaderBlock) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyHeadersIR headers_ir(1); + SpdyHeadersIR headers_ir(/* stream_id = */ 1); headers_ir.SetHeader("alpha", "beta"); headers_ir.SetHeader("gamma", "delta"); SpdySerializedFrame control_frame(SpdyFramerPeer::SerializeHeaders( @@ -2682,7 +2701,7 @@ TEST_P(SpdyFramerTest, ReadCompressedHeadersHeaderBlockWithHalfClose) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyHeadersIR headers_ir(1); + SpdyHeadersIR headers_ir(/* stream_id = */ 1); headers_ir.set_fin(true); headers_ir.SetHeader("alpha", "beta"); headers_ir.SetHeader("gamma", "delta"); @@ -2701,7 +2720,7 @@ TEST_P(SpdyFramerTest, TooLargeHeadersFrameUsesContinuation) { SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION); - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.set_padding_len(256); // Exact payload length will change with HPACK, but this should be long @@ -2920,13 +2939,14 @@ } TEST_F(SpdyControlFrameIteratorTest, PriorityFrameWithIterator) { - auto ir = base::MakeUnique<SpdyPriorityIR>(2, 1, 17, true); + auto ir = SpdyMakeUnique<SpdyPriorityIR>(2, 1, 17, true); RunTest(std::move(ir)); } TEST_P(SpdyFramerTest, TooLargePushPromiseFrameUsesContinuation) { SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION); - SpdyPushPromiseIR push_promise(1, 2); + SpdyPushPromiseIR push_promise(/* stream_id = */ 1, + /* promised_stream_id = */ 2); push_promise.set_padding_len(256); // Exact payload length will change with HPACK, but this should be long @@ -3228,7 +3248,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyDataIR data_ir(1, data_payload); + SpdyDataIR data_ir(/* stream_id = */ 1, data_payload); data_ir.set_padding_len(kPaddingLen); SpdySerializedFrame frame(framer.SerializeData(data_ir)); @@ -3280,11 +3300,11 @@ TEST_P(SpdyFramerTest, ReadWindowUpdate) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdySerializedFrame control_frame( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(1, 2))); + SpdySerializedFrame control_frame(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 2))); if (use_output_) { - ASSERT_TRUE( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(1, 2), &output_)); + ASSERT_TRUE(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 2), &output_)); control_frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); } TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION); @@ -3297,7 +3317,8 @@ TEST_P(SpdyFramerTest, ReadCompressedPushPromise) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyPushPromiseIR push_promise(42, 57); + SpdyPushPromiseIR push_promise(/* stream_id = */ 42, + /* promised_stream_id = */ 57); push_promise.SetHeader("foo", "bar"); push_promise.SetHeader("bar", "foofoo"); SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise( @@ -3933,7 +3954,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyDataIR data_ir(1, "hello"); + SpdyDataIR data_ir(/* stream_id = */ 1, "hello"); SpdySerializedFrame frame(framer.SerializeData(data_ir)); SetFrameFlags(&frame, flags); @@ -3983,7 +4004,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyRstStreamIR rst_stream(13, ERROR_CODE_CANCEL); + SpdyRstStreamIR rst_stream(/* stream_id = */ 13, ERROR_CODE_CANCEL); SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream)); if (use_output_) { output_.Reset(); @@ -4055,7 +4076,8 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyGoAwayIR goaway_ir(97, ERROR_CODE_NO_ERROR, "test"); + SpdyGoAwayIR goaway_ir(/* last_good_stream_id = */ 97, ERROR_CODE_NO_ERROR, + "test"); SpdySerializedFrame frame(framer.SerializeGoAway(goaway_ir)); if (use_output_) { output_.Reset(); @@ -4083,7 +4105,7 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdyHeadersIR headers_ir(57); + SpdyHeadersIR headers_ir(/* stream_id = */ 57); if (flags & HEADERS_FLAG_PRIORITY) { headers_ir.set_weight(3); headers_ir.set_has_priority(true); @@ -4162,8 +4184,8 @@ SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); framer.set_visitor(&visitor); - SpdySerializedFrame frame( - framer.SerializeWindowUpdate(SpdyWindowUpdateIR(4, 1024))); + SpdySerializedFrame frame(framer.SerializeWindowUpdate( + SpdyWindowUpdateIR(/* stream_id = */ 4, /* delta = */ 1024))); SetFrameFlags(&frame, flags); EXPECT_CALL(visitor, OnWindowUpdate(4, 1024)); @@ -4239,7 +4261,7 @@ EXPECT_CALL(visitor, OnHeaders(42, false, 0, 0, false, false, false)); EXPECT_CALL(visitor, OnHeaderFrameStart(42)).Times(1); - SpdyHeadersIR headers_ir(42); + SpdyHeadersIR headers_ir(/* stream_id = */ 42); headers_ir.SetHeader("foo", "bar"); SpdySerializedFrame frame0; if (use_output_) { @@ -4250,7 +4272,7 @@ } SetFrameFlags(&frame0, 0); - SpdyContinuationIR continuation(42); + SpdyContinuationIR continuation(/* stream_id = */ 42); SpdySerializedFrame frame1; if (use_output_) { char* begin = output_.Begin() + output_.Size(); @@ -4474,7 +4496,7 @@ // Tests handling of ALTSVC frames delivered in small chunks. TEST_P(SpdyFramerTest, ReadChunkedAltSvcFrame) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyAltSvcIR altsvc_ir(1); + SpdyAltSvcIR altsvc_ir(/* stream_id = */ 1); SpdyAltSvcWireFormat::AlternativeService altsvc1( "pid1", "host", 443, 5, SpdyAltSvcWireFormat::VersionVector()); SpdyAltSvcWireFormat::AlternativeService altsvc2( @@ -4567,7 +4589,10 @@ // Tests handling of PRIORITY frames. TEST_P(SpdyFramerTest, ReadPriority) { SpdyFramer framer(SpdyFramer::ENABLE_COMPRESSION); - SpdyPriorityIR priority(3, 1, 256, false); + SpdyPriorityIR priority(/* stream_id = */ 3, + /* parent_stream_id = */ 1, + /* weight = */ 256, + /* exclusive = */ false); SpdySerializedFrame frame(framer.SerializePriority(priority)); if (use_output_) { output_.Reset(); @@ -4699,7 +4724,7 @@ framer.set_visitor(visitor.get()); // Create two input frames. - SpdyHeadersIR headers(1); + SpdyHeadersIR headers(/* stream_id = */ 1); headers.SetHeader("alpha", "beta"); headers.SetHeader("gamma", "charlie"); headers.SetHeader("cookie", "key1=value1; key2=value2"); @@ -4707,7 +4732,7 @@ &framer, headers, use_output_ ? &output_ : nullptr)); const char four_score[] = "Four score and seven years ago"; - SpdyDataIR four_score_ir(1, four_score); + SpdyDataIR four_score_ir(/* stream_id = */ 1, four_score); SpdySerializedFrame four_score_frame(framer.SerializeData(four_score_ir)); // Put them in a single buffer (new variables here to make it easy to @@ -4748,10 +4773,10 @@ // Create two input frames. const char four_score[] = "Four score and ..."; - SpdyDataIR four_score_ir(1, four_score); + SpdyDataIR four_score_ir(/* stream_id = */ 1, four_score); SpdySerializedFrame four_score_frame(framer.SerializeData(four_score_ir)); - SpdyHeadersIR headers(2); + SpdyHeadersIR headers(/* stream_id = */ 2); headers.SetHeader("alpha", "beta"); headers.SetHeader("gamma", "charlie"); headers.SetHeader("cookie", "key1=value1; key2=value2");
diff --git a/net/spdy/core/spdy_protocol_test.cc b/net/spdy/core/spdy_protocol_test.cc index 494d12fc..cc222605 100644 --- a/net/spdy/core/spdy_protocol_test.cc +++ b/net/spdy/core/spdy_protocol_test.cc
@@ -221,36 +221,36 @@ // Confirm that it makes a string of zero length from a // SpdyStringPiece(nullptr). SpdyStringPiece s1; - SpdyDataIR d1(1, s1); - EXPECT_EQ(d1.data_len(), 0ul); - EXPECT_NE(d1.data(), nullptr); + SpdyDataIR d1(/* stream_id = */ 1, s1); + EXPECT_EQ(0u, d1.data_len()); + EXPECT_NE(nullptr, d1.data()); // Confirms makes a copy of char array. const char s2[] = "something"; - SpdyDataIR d2(2, s2); + SpdyDataIR d2(/* stream_id = */ 2, s2); EXPECT_EQ(SpdyStringPiece(d2.data(), d2.data_len()), s2); EXPECT_NE(SpdyStringPiece(d1.data(), d1.data_len()), s2); // Confirm copies a const string. const SpdyString foo = "foo"; - SpdyDataIR d3(3, foo); + SpdyDataIR d3(/* stream_id = */ 3, foo); EXPECT_EQ(foo, d3.data()); // Confirm copies a non-const string. SpdyString bar = "bar"; - SpdyDataIR d4(4, bar); + SpdyDataIR d4(/* stream_id = */ 4, bar); EXPECT_EQ("bar", bar); EXPECT_EQ("bar", SpdyStringPiece(d4.data(), d4.data_len())); // Confirm moves an rvalue reference. Note that the test string "baz" is too // short to trigger the move optimization, and instead a copy occurs. SpdyString baz = "the quick brown fox"; - SpdyDataIR d5(5, std::move(baz)); + SpdyDataIR d5(/* stream_id = */ 5, std::move(baz)); EXPECT_EQ("", baz); EXPECT_EQ(SpdyStringPiece(d5.data(), d5.data_len()), "the quick brown fox"); // Confirms makes a copy of string literal. - SpdyDataIR d7(7, "something else"); + SpdyDataIR d7(/* stream_id = */ 7, "something else"); EXPECT_EQ(SpdyStringPiece(d7.data(), d7.data_len()), "something else"); }
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 9b9f3c4..31a7e2ab 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1735,9 +1735,9 @@ ], "experiments": [ { - "name": "NetworkTimeQueriesEnabledBackgroundAndOnDemand", + "name": "NetworkTimeQueriesEnabledOnDemand", "params": { - "FetchBehavior": "background-and-on-demand" + "FetchBehavior": "on-demand-only" }, "enable_features": [ "NetworkTimeServiceQuerying"
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index 2e8d403..529ec9668 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -17773,7 +17773,6 @@ crbug.com/591099 http/tests/security/cross-origin-window-open-exception.html [ Failure ] crbug.com/591099 http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Failure ] crbug.com/591099 http/tests/security/dangling-markup/option.html [ Crash ] -crbug.com/591099 http/tests/security/dangling-markup/src-attribute.html [ Crash ] crbug.com/591099 http/tests/security/dangling-markup/textarea.html [ Crash ] crbug.com/591099 http/tests/security/dataTransfer-set-data-file-url.html [ Timeout ] crbug.com/591099 http/tests/security/data-url-inline.css.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 2cf75ae..bdf262a 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -2780,6 +2780,8 @@ # [css-grid] crbug.com/659610 fast/css-grid-layout/grid-baseline.html [ Failure ] crbug.com/659610 fast/css-grid-layout/grid-baseline-margins.html [ Failure ] +crbug.com/725903 external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013.html [ Failure ] +crbug.com/725903 external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017.html [ Failure ] crbug.com/511177 external/wpt/css/css-grid-1/grid-layout-properties.html [ Failure ] crbug.com/707359 [ Mac ] fast/css-grid-layout/grid-align-baseline-vertical.html [ Failure ] crbug.com/707359 [ Mac ] fast/css-grid-layout/grid-self-baseline-03.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt b/third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt index c57c260..9fad658 100644 --- a/third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test passes if it does not crash on ASan builds.
diff --git a/third_party/WebKit/LayoutTests/compositing/iframes/iframe-in-composited-layer-expected.txt b/third_party/WebKit/LayoutTests/compositing/iframes/iframe-in-composited-layer-expected.txt index c90a95b4..3255aa6 100644 --- a/third_party/WebKit/LayoutTests/compositing/iframes/iframe-in-composited-layer-expected.txt +++ b/third_party/WebKit/LayoutTests/compositing/iframes/iframe-in-composited-layer-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html b/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html index 3015e272..90b43a8 100644 --- a/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html +++ b/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html
@@ -11,10 +11,18 @@ #child1 { offset-position: inherit; } +#child3 { + offset-position: left 10% top; /* invalid */ +} +#child4 { + offset-position: bottom 10% right 20%; +} </style> <div id="container"> <div id="child1"></div> <div id="child2"></div> + <div id="child3"></div> + <div id="child4"></div> </div> <script> "use strict"; @@ -37,6 +45,14 @@ assert_equals(getComputedStyle(child2, null).offsetPosition, 'auto'); }, 'offset-position is not inherited by default'); +test(function() { + assert_equals(getComputedStyle(child3, null).offsetPosition, 'auto'); +}, 'offset-position may not use three values'); + +test(function() { + assert_equals(getComputedStyle(child4, null).offsetPosition, '80% 90%'); +}, 'offset-position may use four values'); + function computed(specified) { var element = document.createElement('div'); element.style['offset-position'] = specified;
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/dragstart-contains-default-content-expected.txt b/third_party/WebKit/LayoutTests/editing/pasteboard/dragstart-contains-default-content-expected.txt index 9c915e4..d7f3e48 100644 --- a/third_party/WebKit/LayoutTests/editing/pasteboard/dragstart-contains-default-content-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/pasteboard/dragstart-contains-default-content-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Simple test that the dragstart event contains the default data in the event. Select some text in this box and drag it.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001-ref.html new file mode 100644 index 0000000..71baf6d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001-ref.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + place-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001.html new file mode 100644 index 0000000..54f937def --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-001.html
@@ -0,0 +1,58 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-001-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a static position (left/rigth and top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-002.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-002.html new file mode 100644 index 0000000..50aea16 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-002.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-001-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'left' offset and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-003.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-003.html new file mode 100644 index 0000000..4e118624 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-003.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-001-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'top' offset and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + top: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-004.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-004.html new file mode 100644 index 0000000..7a724092 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-004.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-001-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'left' and 'top' offsets."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 0; + top: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005-ref.html new file mode 100644 index 0000000..0a19a46 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005-ref.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: end; + align-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005.html new file mode 100644 index 0000000..dacbc8528 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-005.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-005-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'right' offset and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + right: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006-ref.html new file mode 100644 index 0000000..5de990f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006-ref.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: start; + align-items: end; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006.html new file mode 100644 index 0000000..00930da --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-006.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-006-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'bottom' offset and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + bottom: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007-ref.html new file mode 100644 index 0000000..ddbf86e27 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007-ref.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + align-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007.html new file mode 100644 index 0000000..a663f0f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-007.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-007-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'left' and 'right' offsets and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 0; + right: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008-ref.html new file mode 100644 index 0000000..231e3ed9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008-ref.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008.html new file mode 100644 index 0000000..fab723d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-008.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-008-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'top' and 'bottom' offsets and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + top: 0; + bottom: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009-ref.html new file mode 100644 index 0000000..b7b881a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009-ref.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009.html new file mode 100644 index 0000000..dd1849e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-009.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-009-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'left, 'right', 'top' and 'bottom' offsets."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-010.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-010.html new file mode 100644 index 0000000..b1d53537 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-010.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-009-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a static position (left/rigth and top/bottom are 'auto') and a specific size."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + width: 100%; + height: 100%; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011-ref.html new file mode 100644 index 0000000..7b7ce484 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011-ref.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + place-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-left: 10px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011.html new file mode 100644 index 0000000..c0772d4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-011.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-011-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'left' offset and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 10px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012-ref.html new file mode 100644 index 0000000..7f2828d4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012-ref.html
@@ -0,0 +1,49 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: end; + align-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-right: 5px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012.html new file mode 100644 index 0000000..8e29b822 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-012.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-012-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'right' offset and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + right: 5px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013-ref.html new file mode 100644 index 0000000..952e1e7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013-ref.html
@@ -0,0 +1,52 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +body { + overflow: scroll; +} +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + align-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-left: 10px; + margin-right: 5px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013.html new file mode 100644 index 0000000..b78f706fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-013-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'left' and 'right' offsets and a static block position (top/bottom are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 10px; + right: 5px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014-ref.html new file mode 100644 index 0000000..b5062f0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014-ref.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + place-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-top: 15px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014.html new file mode 100644 index 0000000..37d643b9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-014.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-014-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'top' offset and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + top: 15px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015-ref.html new file mode 100644 index 0000000..000fd63 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015-ref.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: start; + align-items: end; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-bottom: 20px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015.html new file mode 100644 index 0000000..a1da3f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-015.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-015-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have a specific 'bottom' offset and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + bottom: 20px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016-ref.html new file mode 100644 index 0000000..dc1d958 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016-ref.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + justify-items: start; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-top: 15px; + margin-bottom: 20px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016.html new file mode 100644 index 0000000..06aedf3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-016.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-016-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'top' and 'bottom' offsets and a static inline position (left/right are 'auto')."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + top: 15px; + bottom: 20px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017-ref.html new file mode 100644 index 0000000..66c5751 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017-ref.html
@@ -0,0 +1,49 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items reference file</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; +} + +#grid > div { + writing-mode: vertical-lr; + margin-left: 10px; + margin-right: 5px; + margin-top: 15px; + margin-bottom: 20px; +} + +#firstItem { + background: magenta; +} + +#secondItem { + background: cyan; +} + +#thirdItem { + background: yellow; +} + +#fourthItem { + background: lime; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017.html new file mode 100644 index 0000000..f0f91ec --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Orthogonal positioned grid items</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#abspos" title="9. Absolute Positioning"> +<link rel="match" href="orthogonal-positioned-grid-items-017-ref.html"> +<meta name="assert" content="Checks that absolutely positioned orthogonal grid items are properly placed and sized when they have specific 'left, 'right', 'top' and 'bottom' offsets."> +<style> +#grid { + display: grid; + grid: 150px 100px / 200px 300px; + margin: 1px 2px 3px 4px; + padding: 20px 15px 10px 5px; + border-width: 9px 3px 12px 6px; + border-style: solid; + width: 550px; + height: 400px; + position: relative; +} + +#grid > div { + writing-mode: vertical-lr; + position: absolute; + left: 10px; + right: 5px; + top: 15px; + bottom: 20px; +} + +#firstItem { + background: magenta; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +#secondItem { + background: cyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +#thirdItem { + background: yellow; + grid-column: 1 / 2; + grid-row: 2 / 3; +} + +#fourthItem { + background: lime; + grid-column: 2 / 3; + grid-row: 2 / 3; +} +</style> + +<p>The test passes if it has the same output than the reference.</p> + +<div id="grid"> + <div id="firstItem">First item</div> + <div id="secondItem">Second item</div> + <div id="thirdItem">Third item</div> + <div id="fourthItem">Fourth item</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/dangling-markup-mitigation.tentative.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/dangling-markup-mitigation.tentative.html new file mode 100644 index 0000000..d3bef91c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/dangling-markup-mitigation.tentative.html
@@ -0,0 +1,158 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="./resources/helper.js"></script> +<body> +<script> + function readableURL(url) { + return url.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); + } + + var should_load = [ + `/images/green-1x1.png`, + `/images/gre\nen-1x1.png`, + `/images/gre\ten-1x1.png`, + `/images/gre\ren-1x1.png`, + `/images/green-1x1.png?img=<`, + `/images/green-1x1.png?img=<`, + `/images/green-1x1.png?img=%3C`, + `/images/gr\neen-1x1.png?img=%3C`, + `/images/gr\reen-1x1.png?img=%3C`, + `/images/gr\teen-1x1.png?img=%3C`, + `/images/green-1x1.png?img= `, + `/images/gr\neen-1x1.png?img= `, + `/images/gr\reen-1x1.png?img= `, + `/images/gr\teen-1x1.png?img= `, + ]; + should_load.forEach(url => async_test(t => { + fetch(url) + .then(t.step_func_done(r => { + assert_equals(r.status, 200); + })) + .catch(t.unreached_func("Fetch should succeed.")); + }, "Fetch: " + readableURL(url))); + + var should_block = [ + `/images/gre\nen-1x1.png?img=<`, + `/images/gre\ren-1x1.png?img=<`, + `/images/gre\ten-1x1.png?img=<`, + `/images/green-1x1.png?<\n=block`, + `/images/green-1x1.png?<\r=block`, + `/images/green-1x1.png?<\t=block`, + ]; + should_block.forEach(url => async_test(t => { + fetch(url) + .then(t.unreached_func("Fetch should fail.")) + .catch(t.step_func_done()); + }, "Fetch: " + readableURL(url))); + + + // For each of the following tests, we'll inject a frame containing the HTML we'd like to poke at + // as a `srcdoc` attribute. Because we're injecting markup via `srcdoc`, we need to entity-escape + // the content we'd like to treat as "raw" (e.g. `\n` => ` `, `<` => `<`), and + // double-escape the "escaped" content. + var rawBrace = "<"; + var escapedBrace = "&lt;"; + var rawNewline = " "; + var escapedNewline = "&#10;"; + + function appendFrameAndGetElement(test, frame) { + return new Promise((resolve, reject) => { + frame.onload = test.step_func(_ => { + frame.onload = null; + resolve(frame.contentDocument.querySelector('#dangling')); + }); + document.body.appendChild(frame); + }); + } + + function assert_img_loaded(test, frame) { + appendFrameAndGetElement(test, frame) + .then(test.step_func_done(img => { + assert_equals(img.naturalHeight, 1, "Height"); + frame.remove(); + })); + } + + function assert_img_not_loaded(test, frame) { + appendFrameAndGetElement(test, frame) + .then(test.step_func_done(img => { + assert_equals(img.naturalHeight, 0, "Height"); + assert_equals(img.naturalWidth, 0, "Width"); + })); + } + + function createFrame(markup) { + var i = document.createElement('iframe'); + i.srcdoc = `${markup}sekrit`; + return i; + } + + // The following resources should not be blocked, as their URLs do not contain both a `\n` and `<` + // character in the body of the URL. + var should_load = [ + // Brace alone doesn't block: + `<img id="dangling" src="/images/green-1x1.png?img=${rawBrace}b">`, + + // Newline alone doesn't block: + `<img id="dangling" src="/images/green-1x1.png?img=${rawNewline}b">`, + + // Entity-escaped characters don't trigger blocking: + `<img id="dangling" src="/images/green-1x1.png?img=${escapedNewline}b">`, + `<img id="dangling" src="/images/green-1x1.png?img=${escapedBrace}b">`, + `<img id="dangling" src="/images/green-1x1.png?img=${escapedNewline}b${escapedBrace}c">`, + + // Leading and trailing whitespace is stripped: + ` + <img id="dangling" src=" + /images/green-1x1.png?img= + "> + `, + ` + <img id="dangling" src=" + /images/green-1x1.png?img=${escapedBrace} + "> + `, + ` + <img id="dangling" src=" + /images/green-1x1.png?img=${escapedNewline} + "> + `, + + // Data URLs don't trigger blocking: + `<img id="dangling" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">`, + `<img id="dangling" src="data:image/png;base64,${rawNewline}iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">`, + `<img id="dangling" src="data:image/png;base64,i${rawNewline}VBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">`, + `<img id="dangling" src="data:image/svg+xml;utf8, + <svg width='1' height='1' xmlns='http://www.w3.org/2000/svg'> + <rect width='100%' height='100%' fill='rebeccapurple'/> + <rect x='10%' y='10%' width='80%' height='80%' fill='lightgreen'/> + </svg>">` + ]; + + should_load.forEach(markup => { + async_test(t => { + var i = createFrame(`${markup} <element attr="" another=''>`); + assert_img_loaded(t, i); + }, readableURL(markup)); + }); + + // The following resources should be blocked, as their URLs contain both `\n` and `<` characters: + var should_block = [ + `<img id="dangling" src="/images/green-1x1.png?img=${rawNewline}${rawBrace}b">`, + `<img id="dangling" src="/images/green-1x1.png?img=${rawBrace}${rawNewline}b">`, + ` + <img id="dangling" src="/images/green-1x1.png?img= + ${rawBrace} + ${rawNewline}b + "> + `, + ]; + + should_block.forEach(markup => { + async_test(t => { + var i = createFrame(`${markup}`); + assert_img_not_loaded(t, i); + }, readableURL(markup)); + }); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_constructor.html b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_constructor.html index f5f8201..43d0aa5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_constructor.html
@@ -33,11 +33,13 @@ ["getCoalescedEvents()[" + i + "].pointerType", coalescedEvent.pointerType, event.pointerType], ["getCoalescedEvents()[" + i + "].isPrimary", coalescedEvent.isPrimary, event.isPrimary], ["getCoalescedEvents()[" + i + "].getCoalescedEvents().length", coalescedEvent.getCoalescedEvents().length, 0], - ["getCoalescedEvents()[" + i + "].target", coalescedEvent.target, null], - ["getCoalescedEvents()[" + i + "].currentTarget", coalescedEvent.target, null], + ["getCoalescedEvents()[" + i + "].target", coalescedEvent.target, target0], + ["getCoalescedEvents()[" + i + "].currentTarget", coalescedEvent.currentTarget, null], ["getCoalescedEvents()[" + i + "].eventPhase", coalescedEvent.eventPhase, Event.NONE], ["getCoalescedEvents()[" + i + "].cancelable", coalescedEvent.cancelable, false], ["getCoalescedEvents()[" + i + "].bubbles", coalescedEvent.bubbles, false], + ["getCoalescedEvents()[" + i + "].offsetX", coalescedEvent.offsetX, event.offsetX + (i==0?-10:0)], + ["getCoalescedEvents()[" + i + "].offsetY", coalescedEvent.offsetY, event.offsetY], ]); } }));
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-canvas-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-canvas-expected.txt index e534171..292b39a 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-canvas-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-canvas-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test Results solid on solid alpha on solid solid on alpha alpha on alpha source-over
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-image-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-image-expected.txt index db4cbb3..6a84b9e 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-image-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-image-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test Results solid on solid alpha on solid solid on alpha alpha on alpha source-over
diff --git a/third_party/WebKit/LayoutTests/fast/css/counters/counter-traverse-table-cell-expected.txt b/third_party/WebKit/LayoutTests/fast/css/counters/counter-traverse-table-cell-expected.txt index 4b1e555..2186b92 100644 --- a/third_party/WebKit/LayoutTests/fast/css/counters/counter-traverse-table-cell-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/counters/counter-traverse-table-cell-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. This tests that we don't crash when using the CSS counters feature.
diff --git a/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing-expected.txt b/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing-expected.txt index c1531b3..914ef142 100644 --- a/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing-expected.txt
@@ -82,7 +82,7 @@ PASS style.scrollSnapDestination is "calc(20px + 10%) 40%" Test case: 3 piece percentage destination -PASS style.scrollSnapDestination is "0% 50%" +PASS style.scrollSnapDestination is "0px 0px" Test case: 1 piece destination with implied center PASS style.scrollSnapDestination is "50% 0%" @@ -94,7 +94,7 @@ PASS style.scrollSnapCoordinate is "50% 100%" Test case: 3 piece percentage coordinate -PASS style.scrollSnapCoordinate is "0% 50%" +PASS style.scrollSnapCoordinate is "none" Test case: 4 piece pixel coordinate PASS style.scrollSnapCoordinate is "10px 15px"
diff --git a/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing.html b/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing.html index 8960c7ab..c88349b 100644 --- a/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing.html +++ b/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing.html
@@ -45,17 +45,17 @@ <div class="test" property="scroll-snap-destination" style="scroll-snap-destination: 5% 100%;" expected="5% 100%" desc="percentage/percentage destination" ></div> <div class="test" property="scroll-snap-destination" style="scroll-snap-destination: calc(10% + 20px) 40%;" expected="calc(20px + 10%) 40%" desc="calc/percentage destination" ></div> -<div class="test" property="scroll-snap-destination" style="scroll-snap-destination: left top 50%;" expected="0% 50%" desc="3 piece percentage destination" ></div> +<div class="test" property="scroll-snap-destination" style="scroll-snap-destination: left top 50%;" expected="0px 0px" desc="3 piece percentage destination" ></div> <div class="test" property="scroll-snap-destination" style="scroll-snap-destination: top;" expected="50% 0%" desc="1 piece destination with implied center" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50px 100px;" expected="50px 100px" desc="single pixel coordinate" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50% 100%;" expected="50% 100%" desc="single percentage coordinate" ></div> -<div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: left top 50%;" expected="0% 50%" desc="3 piece percentage coordinate" ></div> +<div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: left top 50%;" expected="none" desc="3 piece percentage coordinate" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: left 10px top 15px;" expected="10px 15px" desc="4 piece pixel coordinate" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: left;" expected="0% 50%" desc="1 piece coordinate with implied center" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50px 100px, 150px 100px, left 200px top 100px;" expected="50px 100px, 150px 100px, 200px 100px" desc="multiple pixel coordinates" ></div> -<div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50% 100%, left top 100%, 200% 100%;" expected="50% 100%, 0% 100%, 200% 100%" desc="multiple percentage coordinates" ></div> +<div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50% 100%, left 0% top 100%, 200% 100%;" expected="50% 100%, 0% 100%, 200% 100%" desc="multiple percentage coordinates" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: calc(10% + 100px) 100%, 150%, 200px calc(5% + 10px);" expected="calc(100px + 10%) 100%, 150% 50%, 200px calc(10px + 5%)" desc="multiple mixed pixel/percentage/calc coordinates" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50px 100px, junk;" expected="none" desc="reject invalid position list" ></div> <div class="test" property="scroll-snap-coordinate" style="scroll-snap-coordinate: 50px 100px / 1px 1px;" expected="none" desc="reject invalid position separator" ></div>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html new file mode 100644 index 0000000..e4b6aea --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionBackgroundPosition = 2001; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionBackgroundPosition); + var div = document.createElement('div'); + + // These properties have their own counters. + div.style = 'shape-outside: circle(0px at left 10% top);'; + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; + div.style = 'object-position: left 10% top;'; + div.style = 'perspective-origin: left 10% top;'; + // These values are invalid. + div.style = 'offset-anchor: left 10% top;'; + div.style = 'offset-position: left 10% top;'; + div.style = 'transform-origin: left 10% top;'; + // These obsolete properties will never ship. + div.style = 'scroll-snap-coordinate: left 10% top;'; + div.style = 'scroll-snap-destination: left 10% top;'; + assert_false(isCounted(), + 'non background-position should not be counted'); + + div.style = 'background-position: left;'; + div.style = 'background-position: left 10%;'; + div.style = 'background-position: left 10% top 20%;'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'background-position: left 10% top;'; + assert_true(isCounted(), + 'background-position should be counted'); +}, 'Three valued position syntax is use counted for background-position'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background.html new file mode 100644 index 0000000..3f4752f --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionBackgroundPosition = 2001; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionBackgroundPosition); + var div = document.createElement('div'); + + // usecounter-position3value-background-position.html + // tests that other position-using properties do not + // increment the counter. + + div.style = 'background: left;'; + div.style = 'background: left 10%;'; + div.style = 'background: left 10% top 20%;'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'background: left 10% top;'; + assert_true(isCounted(), + 'background should be counted'); +}, 'Three valued position syntax is use counted for background'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-circle.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-circle.html new file mode 100644 index 0000000..973734f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-circle.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionBasicShape = 2002; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionBasicShape); + var div = document.createElement('div'); + + // These properties have their own counters. + div.style = 'background-position: left 10% top;'; + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; + div.style = 'object-position: left 10% top;'; + div.style = 'perspective-origin: left 10% top;'; + // These values are invalid. + div.style = 'offset-anchor: left 10% top;'; + div.style = 'offset-position: left 10% top;'; + div.style = 'transform-origin: left 10% top;'; + // These obsolete properties will never ship. + div.style = 'scroll-snap-coordinate: left 10% top;'; + div.style = 'scroll-snap-destination: left 10% top;'; + assert_false(isCounted(), + 'non basic-shape should not be counted'); + + div.style = 'shape-outside: circle(0px at left);'; + div.style = 'shape-outside: circle(0px at left 10%);'; + div.style = 'shape-outside: circle(0px at left 10% top 20%);'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'shape-outside: circle(0px at left 10% top);'; + assert_true(isCounted(), + 'basic-shape should be counted'); +}, 'Three valued position syntax is use counted for circle'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-ellipse.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-ellipse.html new file mode 100644 index 0000000..4f0d586 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-ellipse.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionBasicShape = 2002; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionBasicShape); + var div = document.createElement('div'); + + // usecounter-position3value-basic-shape-circle.html + // tests that other position-using properties do not + // increment the counter. + + div.style = 'shape-outside: ellipse(at left);'; + div.style = 'shape-outside: ellipse(at left 10%);'; + div.style = 'shape-outside: ellipse(at left 10% top 20%);'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'shape-outside: ellipse(at left 10% top);'; + assert_true(isCounted(), + 'basic-shape should be counted'); +}, 'Three valued position syntax is use counted for ellipse'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-conic-gradient.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-conic-gradient.html new file mode 100644 index 0000000..b98cd45a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-conic-gradient.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionGradient = 2003; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionGradient); + var div = document.createElement('div'); + + // usecounter-position3value-radial-gradient.html + // tests that other position-using properties do not + // increment the counter. + + div.style = 'background-image: conic-gradient(at left, black, red);'; + div.style = 'background-image: conic-gradient(at left 10%, black, red);'; + div.style = 'background-image: conic-gradient(at left 10% top 20%, black, red);'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'background-image: conic-gradient(at left 10% top, black, red);'; + assert_true(isCounted(), + 'gradient should be counted'); +}, 'Three valued position syntax is use counted for conic-gradient'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-object-position.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-object-position.html new file mode 100644 index 0000000..baf3b8c --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-object-position.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionObjectPosition = 2004; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionObjectPosition); + var div = document.createElement('div'); + + // These properties have their own counters. + div.style = 'background-position: left 10% top;'; + div.style = 'shape-outside: circle(0px at left 10% top);'; + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; + div.style = 'perspective-origin: left 10% top;'; + // These values are invalid. + div.style = 'offset-anchor: left 10% top;'; + div.style = 'offset-position: left 10% top;'; + div.style = 'transform-origin: left 10% top;'; + // These obsolete properties will never ship. + div.style = 'scroll-snap-coordinate: left 10% top;'; + div.style = 'scroll-snap-destination: left 10% top;'; + assert_false(isCounted(), + 'non object-position should not be counted'); + + div.style = 'object-position: left;'; + div.style = 'object-position: left 10%;'; + div.style = 'object-position: left 10% top 20%;'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'object-position: left 10% top;'; + assert_true(isCounted(), + 'object-position should be counted'); +}, 'Three valued position syntax is use counted for object-position'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-perspective-origin.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-perspective-origin.html new file mode 100644 index 0000000..d2db175 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-perspective-origin.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionPerspectiveOrigin = 2005; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionPerspectiveOrigin); + var div = document.createElement('div'); + + // These properties have their own counters. + div.style = 'background-position: left 10% top;'; + div.style = 'shape-outside: circle(0px at left 10% top);'; + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; + div.style = 'object-position: left 10% top;'; + // These values are invalid. + div.style = 'offset-anchor: left 10% top;'; + div.style = 'offset-position: left 10% top;'; + div.style = 'transform-origin: left 10% top;'; + // These obsolete properties will never ship. + div.style = 'scroll-snap-coordinate: left 10% top;'; + div.style = 'scroll-snap-destination: left 10% top;'; + assert_false(isCounted(), + 'non perspective-origin should not be counted'); + + div.style = 'perspective-origin: left;'; + div.style = 'perspective-origin: left 10%;'; + div.style = 'perspective-origin: left 10% top 20%;'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'perspective-origin: left 10% top;'; + assert_true(isCounted(), + 'perspective-origin should be counted'); +}, 'Three valued position syntax is use counted for perspective-origin'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html new file mode 100644 index 0000000..72a589aa --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let ThreeValuedPositionGradient = 2003; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionGradient); + var div = document.createElement('div'); + + // These properties have their own counters. + div.style = 'background-position: left 10% top;'; + div.style = 'shape-outside: circle(0px at left 10% top);'; + div.style = 'object-position: left 10% top;'; + div.style = 'perspective-origin: left 10% top;'; + // These values are invalid. + div.style = 'offset-anchor: left 10% top;'; + div.style = 'offset-position: left 10% top;'; + div.style = 'transform-origin: left 10% top;'; + // These obsolete properties will never ship. + div.style = 'scroll-snap-coordinate: left 10% top;'; + div.style = 'scroll-snap-destination: left 10% top;'; + assert_false(isCounted(), + 'non gradient should not be counted'); + + div.style = 'background-image: radial-gradient(0em circle at left, blue);'; + div.style = 'background-image: radial-gradient(0em circle at left 10%, yellow, blue);'; + div.style = 'background-image: radial-gradient(0em circle at left 10% top 20%, yellow, blue);'; + assert_false(isCounted(), + '1,2,4 values should not be counted'); + + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; + assert_true(isCounted(), + 'gradient should be counted'); +}, 'Three valued position syntax is use counted for radial-gradient'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt index 568beb4..89d26cf 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. static: body: (0, 0) child: (27, 27) relative: body: (0, 0) child: (17, 17) fixed: body: (0, 0) child: (17, 17)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt index 07884717..5e3da62 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. control: (0, 0) static: (10, 10) absolute: (20, 10)
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt index 2a0d8d3a6..74a01c9a 100644 --- a/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. This tests the constructor for the TrackEvent DOM class. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt index 4683904..bc4f50d 100644 --- a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Check autoscroll within an inner frame by drag-and-drop On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/events/resize-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/resize-subframe-expected.txt index fc99a4e3..9c7032118 100644 --- a/third_party/WebKit/LayoutTests/fast/events/resize-subframe-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/resize-subframe-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. ALERT: PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt index 5c13fc0..79cf179f 100644 --- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/files/null-origin-string-expected.txt b/third_party/WebKit/LayoutTests/fast/files/null-origin-string-expected.txt index 415ccd9..a117861 100644 --- a/third_party/WebKit/LayoutTests/fast/files/null-origin-string-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/files/null-origin-string-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: line 30: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE MESSAGE: line 1: Started reading... PASS if no crash.
diff --git a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt index fb16425f..270de6a0 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/fast/frames/negative-remaining-length-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/negative-remaining-length-crash-expected.txt index 6e41aad..8b13789 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/negative-remaining-length-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/negative-remaining-length-crash-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details.
diff --git a/third_party/WebKit/LayoutTests/fast/loader/simultaneous-reloads-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/loader/simultaneous-reloads-assert-expected.txt index 181979e..d911ebb7 100644 --- a/third_party/WebKit/LayoutTests/fast/loader/simultaneous-reloads-assert-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/loader/simultaneous-reloads-assert-expected.txt
@@ -1,4 +1,3 @@ ALERT: If you do not hit an assertion failure when running this test with a debug build and you get a SUCCESS message, then you pass the test. -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. ALERT: SUCCESS
diff --git a/third_party/WebKit/LayoutTests/fast/loader/stateobjects/pushstate-in-data-url-denied-expected.txt b/third_party/WebKit/LayoutTests/fast/loader/stateobjects/pushstate-in-data-url-denied-expected.txt index 14ac789..d8a96f92 100644 --- a/third_party/WebKit/LayoutTests/fast/loader/stateobjects/pushstate-in-data-url-denied-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/loader/stateobjects/pushstate-in-data-url-denied-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. ALERT: PASS: data URLs cannot be manipulated via pushState.
diff --git a/third_party/WebKit/LayoutTests/fast/loader/url-strip-cr-lf-tab-expected.txt b/third_party/WebKit/LayoutTests/fast/loader/url-strip-cr-lf-tab-expected.txt index 4b4f3bf..c36cd0ef 100644 --- a/third_party/WebKit/LayoutTests/fast/loader/url-strip-cr-lf-tab-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/loader/url-strip-cr-lf-tab-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test for bug 8770: XMLHttpRequest should strip CR/LF characters from the URL (not just XMLHttpRequest, really, and TAB is also stripped). Success
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-expected.txt index 1e28fae0..25061c5 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. This is link_1.
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-zero-size-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-zero-size-expected.txt index 195ec453..0019f62 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-zero-size-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-hidden-iframe-zero-size-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. This is link_1.
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-nested-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-nested-expected.txt index f58c98af..6f67f45 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-nested-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-nested-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Link Link
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-focusable-content-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-focusable-content-expected.txt index 0c77c6e..3348dcd1 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-focusable-content-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-focusable-content-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. a
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt index bfa9010..cf213f6 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. a
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-recursive-offset-parent-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-recursive-offset-parent-expected.txt index 122c3a9f..3f78909b 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-recursive-offset-parent-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-recursive-offset-parent-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Link PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element-expected.txt b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element-expected.txt index 09d33bb..c296742 100644 --- a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-ellipsis-in-inline-blocks-2.html b/third_party/WebKit/LayoutTests/fast/text/place-ellipsis-in-inline-blocks-2.html new file mode 100644 index 0000000..9c28ed4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-ellipsis-in-inline-blocks-2.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see abcdef... below.</p> +<div> + <span>abc</span> <span>def</span> <span>ghi</span> <span>abc</span> <span>def</span> <span>ghi</span> +</div> + +<p>You should see ...defabc below.</p> +<div class="rtl"> + <span>abc</span> <span>def</span> <span>ghi</span> <span>abc</span> <span>def</span> <span>ghi</span> +</div> + +<p>You should see abcde... then abcde... below.</p> +<div> + <span>abcdefghijklm<br>abcdefghijklm</span> <span>ghi</span> <span>jkl</span> <span>ghi</span> <span>jkl</span> +</div> + +<p>You should see ...hijklm then ...hijklm below.</p> +<div class="rtl"> + <span>abcdefghijklm<br>abcdefghijklm</span> <span>ghi</span> <span>jkl</span> <span>ghi</span> <span>jkl</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-2.html b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-2.html new file mode 100644 index 0000000..f5a7f73e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-2.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבx</span> <span>דהx</span> <span>זחx</span> <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבx</span> <span>דהx</span> <span>זחx</span> <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2.html b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2.html new file mode 100644 index 0000000..27faf2e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: center; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2.html b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2.html new file mode 100644 index 0000000..88cc072a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2.html b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2.html new file mode 100644 index 0000000..903d48b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: right; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבx</span> <span>דהx</span> <span>זחx</span> + <span>אבx</span> <span>דהx</span> <span>זחx</span> +</div> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבגדהוזabcdefg<br>אבגדהוabcdefg</span> <span>זחa</span> <span>יכa</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/place-rtl-ellipsis-in-inline-blocks-2.html b/third_party/WebKit/LayoutTests/fast/text/place-rtl-ellipsis-in-inline-blocks-2.html new file mode 100644 index 0000000..a6bdc98 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/place-rtl-ellipsis-in-inline-blocks-2.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<style> +div { + width: 95px; + font: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.rtl { + direction: rtl; +} +span { + display: inline-block; +} +</style> +<p>crbug.com/133700: Ellipsis placed correctly in rtl text in an inline-block wth an rtl flow.</p> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבג</span> <span>דהו</span> <span>זחט</span> <span>אבג</span> <span>דהו</span> <span>זחט</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבג</span> <span>דהו</span> <span>זחט</span> <span>אבג</span> <span>דהו</span> <span>זחט</span> +</div> + +<p>You should see text followed by ellipsis below.</p> +<div> + <span>אבגדהוזחטיכךל<br>אבגדהוזחטיכךל</span> <span>זחט</span> <span>יכך</span> +</div> + +<p>You should see ellipsis followed by text below.</p> +<div class="rtl"> + <span>אבגדהוזחטיכךל<br>אבגדהוזחטיכךל</span> <span>זחט</span> <span>יכך</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt index 1689b406..c6343a5 100644 --- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt +++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test entering full screen security restrictions. An iframe without an allow attribute is still permitted to fullscreen if the request comes from the containing document. To test manually, press any key - the page should enter full screen mode.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute-expected.txt deleted file mode 100644 index dd27ac26..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. -This is a testharness.js-based test. -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?data=1 b"> -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?img=2 b<c"> -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?img=3 b<c "> -FAIL <img id="dangling" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABnAQMAAACQMjadAAAAA1BMVEX///+nxBvIAAAAEUlEQVQ4y2MYBaNgFIwCegAABG0AAd5G4RkAAAAASUVORK5CYII="> assert_equals: Height expected 0 but got 103 -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?4&img=<b"> -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?5&data=&#10;b"> -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?6&img=&lt;b"> -PASS <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?7&img=&#10;b&lt;c"> -PASS <img id="dangling" src=" http://127.0.0.1:8000/security/resources/abe.png?8 "> <input type=hidden name=csrf value=sekrit> -PASS <img id="dangling" src=" http://127.0.0.1:8000/security/resources/abe.png?9&img=&lt; "> <input type=hidden name=csrf value=sekrit> -PASS <img id="dangling" src=" http://127.0.0.1:8000/security/resources/abe.png?10&img=&#10; "> <input type=hidden name=csrf value=sekrit> -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute.html b/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute.html deleted file mode 100644 index 3c03d51..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/security/dangling-markup/src-attribute.html +++ /dev/null
@@ -1,73 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="./resources/helper.js"></script> -<body> -<script> - // We're injecting markup via `srcdoc` so, confusingly, we need to - // entity-escape the "raw" content, and double-escape the "escaped" - // content. - var rawBrace = "<"; - var escapedBrace = "&lt;"; - var rawNewline = " "; - var escapedNewline = "&#10;"; - - var abeSizedPng = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABnAQMAAACQMjadAAAAA1BMVEX///+nxBvIAAAAEUlEQVQ4y2MYBaNgFIwCegAABG0AAd5G4RkAAAAASUVORK5CYII="; - var abeSizedPngWithNewline = abeSizedPng.replace("i", "i\n"); - - var should_block = [ - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?data=1${rawNewline}b">`, - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?img=2${rawNewline}b${rawBrace}c">`, - ` - <img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?img=3 - b${rawBrace}c - "> - `, - `<img id="dangling" src="${abeSizedPngWithNewline}">`, - ]; - - should_block.forEach(markup => { - async_test(t => { - var i = createFrame(`${markup}`); - assert_img_not_loaded(t, i); - }, markup.replace(/[\n\r]/g, '')); - }); - - var should_load = [ - // Brace alone doesn't block: - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?4&img=${rawBrace}b">`, - - // Entity-escaped characters don't trigger blocking: - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?5&data=${escapedNewline}b">`, - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?6&img=${escapedBrace}b">`, - `<img id="dangling" src="http://127.0.0.1:8000/security/resources/abe.png?7&img=${escapedNewline}b${escapedBrace}c">`, - - // Leading and trailing whitespace is stripped: - ` - <img id="dangling" src=" - http://127.0.0.1:8000/security/resources/abe.png?8 - "> - <input type=hidden name=csrf value=sekrit> - `, - ` - <img id="dangling" src=" - http://127.0.0.1:8000/security/resources/abe.png?9&img=${escapedBrace} - "> - <input type=hidden name=csrf value=sekrit> - `, - ` - <img id="dangling" src=" - http://127.0.0.1:8000/security/resources/abe.png?10&img=${escapedNewline} - "> - <input type=hidden name=csrf value=sekrit> - `, - ]; - - should_load.forEach(markup => { - async_test(t => { - var i = createFrame(`${markup} <element attr="" another=''>`); - assert_img_loaded(t, i); - }, markup.replace(/[\n\r]/g, '')); - }); -</script> -
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/document-all-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/document-all-expected.txt index 44c56277..ca9071d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/document-all-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/document-all-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. ALERT: true
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/no-indexeddb-from-sandbox-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/no-indexeddb-from-sandbox-expected.txt index 3fb9246..e391647 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/no-indexeddb-from-sandbox-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/no-indexeddb-from-sandbox-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE MESSAGE: line 1: PASS: indexedDB.open() threw a SECURITY_ERR!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-expected.txt index 35ec840..3df45730 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE ERROR: line 1: Blocked opening 'about:blank' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set. CONSOLE MESSAGE: line 1: PASS To run this test outside of DumpRenderTree, please disable your popup blocker!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt index b63c4d7f..007894b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE ERROR: line 1: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/no-popup-from-sandbox-top.html' from frame with URL 'data:text/html, <script> var win = window.open('about:blank', '_top'); console.log(win ? 'FAIL' : 'PASS'); </script>'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set. CONSOLE MESSAGE: line 1: PASS
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-can-navigate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-can-navigate-expected.txt index 9d9f590..c1b12c5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-can-navigate-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-can-navigate-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. To run this test outside of DumpRenderTree, please disable your popup blocker! This test passes if it doesn't hang.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-control-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-control-expected.txt index 43a1631..c58943b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-control-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-control-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE MESSAGE: line 1: /PASS/ To run this test outside of DumpRenderTree, please disable your popup blocker!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-expected.txt index 7e64c99c..89b29a71 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-is-sandboxed-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE ERROR: line 1: Blocked form submission to 'javascript:alert(/FAIL/)' because the form's frame is sandboxed and the 'allow-forms' permission is not set. To run this test outside of DumpRenderTree, please disable your popup blocker!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed-expected.txt index da508271..7f3be17 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE MESSAGE: line 1: PASS To run this test outside of DumpRenderTree, please disable your popup blocker!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window-expected.txt index 26ecb629..2d8d1cf 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. To run this test outside of DumpRenderTree, please disable your popup blocker! This test passes if it doesn't hang.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/window-named-proto-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/window-named-proto-expected.txt index 2d0ed3f8..415dc9e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/window-named-proto-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/window-named-proto-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE ERROR: line 2: Uncaught TypeError: Cannot read property 'innerHTML' of null
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt index b7bbfad..61813406 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/window-named-valueOf-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. This passes if it doesn't alert the contents of innocent-victim.
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index c584336a..b6c2bdc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1,21 +1,28 @@ +[INTERFACES] interface BackgroundFetchClickEvent : BackgroundFetchEvent + attribute @@toStringTag getter state method constructor interface BackgroundFetchEvent : ExtendableEvent + attribute @@toStringTag getter tag method constructor interface BackgroundFetchFailEvent : BackgroundFetchEvent + attribute @@toStringTag getter fetches method constructor interface BackgroundFetchFetch + attribute @@toStringTag getter request method constructor interface BackgroundFetchManager + attribute @@toStringTag method constructor method fetch method get method getTags interface BackgroundFetchRegistration + attribute @@toStringTag getter icons getter tag getter title @@ -23,16 +30,20 @@ method abort method constructor interface BackgroundFetchSettledFetch : BackgroundFetchFetch + attribute @@toStringTag getter response method constructor interface BackgroundFetchedEvent : BackgroundFetchEvent + attribute @@toStringTag getter fetches method constructor method updateUI interface BarcodeDetector + attribute @@toStringTag method constructor method detect interface Blob + attribute @@toStringTag getter isClosed getter size getter type @@ -40,6 +51,7 @@ method constructor method slice interface BroadcastChannel : EventTarget + attribute @@toStringTag getter name getter onmessage getter onmessageerror @@ -49,11 +61,13 @@ setter onmessage setter onmessageerror interface BudgetService + attribute @@toStringTag method constructor method getBudget method getCost method reserve interface BudgetState + attribute @@toStringTag getter budgetAt getter time method constructor @@ -61,6 +75,7 @@ method constructor method size interface Cache + attribute @@toStringTag method add method addAll method constructor @@ -70,6 +85,7 @@ method matchAll method put interface CacheStorage + attribute @@toStringTag method constructor method delete method has @@ -77,11 +93,14 @@ method match method open interface CanvasGradient + attribute @@toStringTag method addColorStop method constructor interface CanvasPattern + attribute @@toStringTag method constructor interface Client + attribute @@toStringTag getter frameType getter id getter type @@ -89,12 +108,14 @@ method constructor method postMessage interface Clients + attribute @@toStringTag method claim method constructor method get method matchAll method openWindow interface CloseEvent : Event + attribute @@toStringTag getter code getter reason getter wasClean @@ -103,20 +124,24 @@ method constructor method size interface Crypto + attribute @@toStringTag getter subtle method constructor method getRandomValues interface CryptoKey + attribute @@toStringTag getter algorithm getter extractable getter type getter usages method constructor interface CustomEvent : Event + attribute @@toStringTag getter detail method constructor method initCustomEvent interface DOMException + attribute @@toStringTag attribute ABORT_ERR attribute DATA_CLONE_ERR attribute DOMSTRING_SIZE_ERR @@ -148,6 +173,7 @@ method constructor method toString interface DOMMatrix : DOMMatrixReadOnly + attribute @@toStringTag getter a getter b getter c @@ -209,6 +235,7 @@ static method fromFloat32Array static method fromFloat64Array static method fromMatrix + attribute @@toStringTag getter a getter b getter c @@ -252,6 +279,7 @@ method transformPoint method translate interface DOMPoint : DOMPointReadOnly + attribute @@toStringTag getter w getter x getter y @@ -263,6 +291,7 @@ setter z interface DOMPointReadOnly static method fromPoint + attribute @@toStringTag getter w getter x getter y @@ -273,6 +302,7 @@ interface DOMQuad static method fromQuad static method fromRect + attribute @@toStringTag getter p1 getter p2 getter p3 @@ -281,6 +311,7 @@ method getBounds method toJSON interface DOMRect : DOMRectReadOnly + attribute @@toStringTag getter height getter width getter x @@ -292,6 +323,7 @@ setter y interface DOMRectReadOnly static method fromRect + attribute @@toStringTag getter bottom getter height getter left @@ -303,11 +335,14 @@ method constructor method toJSON interface DOMStringList + attribute @@toStringTag getter length + method @@iterator method constructor method contains method item interface DataView + attribute @@toStringTag getter buffer getter byteLength getter byteOffset @@ -329,6 +364,7 @@ method setUint32 method setUint8 interface Event + attribute @@toStringTag attribute AT_TARGET attribute BUBBLING_PHASE attribute CAPTURING_PHASE @@ -355,6 +391,7 @@ setter cancelBubble setter returnValue interface EventSource : EventTarget + attribute @@toStringTag attribute CLOSED attribute CONNECTING attribute OPEN @@ -370,14 +407,17 @@ setter onmessage setter onopen interface EventTarget + attribute @@toStringTag method addEventListener method constructor method dispatchEvent method removeEventListener interface ExtendableEvent : Event + attribute @@toStringTag method constructor method waitUntil interface ExtendableMessageEvent : ExtendableEvent + attribute @@toStringTag getter data getter lastEventId getter origin @@ -385,9 +425,11 @@ getter source method constructor interface FaceDetector + attribute @@toStringTag method constructor method detect interface FetchEvent : ExtendableEvent + attribute @@toStringTag getter clientId getter isReload getter preloadResponse @@ -395,16 +437,20 @@ method constructor method respondWith interface File : Blob + attribute @@toStringTag getter lastModified getter lastModifiedDate getter name getter webkitRelativePath method constructor interface FileList + attribute @@toStringTag getter length + method @@iterator method constructor method item interface FileReader : EventTarget + attribute @@toStringTag attribute DONE attribute EMPTY attribute LOADING @@ -430,11 +476,14 @@ setter onloadstart setter onprogress interface ForeignFetchEvent : ExtendableEvent + attribute @@toStringTag getter origin getter request method constructor method respondWith interface FormData + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -447,6 +496,8 @@ method set method values interface Headers + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -458,6 +509,7 @@ method set method values interface IDBCursor + attribute @@toStringTag getter direction getter key getter primaryKey @@ -469,9 +521,11 @@ method delete method update interface IDBCursorWithValue : IDBCursor + attribute @@toStringTag getter value method constructor interface IDBDatabase : EventTarget + attribute @@toStringTag getter name getter objectStoreNames getter onabort @@ -489,11 +543,13 @@ setter onerror setter onversionchange interface IDBFactory + attribute @@toStringTag method cmp method constructor method deleteDatabase method open interface IDBIndex + attribute @@toStringTag getter keyPath getter multiEntry getter name @@ -513,6 +569,7 @@ static method lowerBound static method only static method upperBound + attribute @@toStringTag getter lower getter lowerOpen getter upper @@ -520,6 +577,7 @@ method constructor method includes interface IDBObjectStore + attribute @@toStringTag getter autoIncrement getter indexNames getter keyPath @@ -542,21 +600,25 @@ method put setter name interface IDBObservation + attribute @@toStringTag getter key getter type getter value method constructor interface IDBObserver + attribute @@toStringTag method constructor method observe method unobserve interface IDBOpenDBRequest : IDBRequest + attribute @@toStringTag getter onblocked getter onupgradeneeded method constructor setter onblocked setter onupgradeneeded interface IDBRequest : EventTarget + attribute @@toStringTag getter error getter onerror getter onsuccess @@ -568,6 +630,7 @@ setter onerror setter onsuccess interface IDBTransaction : EventTarget + attribute @@toStringTag getter db getter error getter mode @@ -582,17 +645,20 @@ setter oncomplete setter onerror interface IDBVersionChangeEvent : Event + attribute @@toStringTag getter dataLoss getter dataLossMessage getter newVersion getter oldVersion method constructor interface ImageBitmap + attribute @@toStringTag getter height getter width method close method constructor interface ImageData + attribute @@toStringTag getter data getter dataUnion getter height @@ -600,13 +666,16 @@ method constructor method getColorSettings interface InstallEvent : ExtendableEvent + attribute @@toStringTag method constructor method registerForeignFetch interface MessageChannel + attribute @@toStringTag getter port1 getter port2 method constructor interface MessageEvent : Event + attribute @@toStringTag getter data getter lastEventId getter origin @@ -616,6 +685,7 @@ method constructor method initMessageEvent interface MessagePort : EventTarget + attribute @@toStringTag getter onmessage getter onmessageerror method close @@ -625,12 +695,14 @@ setter onmessage setter onmessageerror interface NavigationPreloadManager + attribute @@toStringTag method constructor method disable method enable method getState method setHeaderValue interface NetworkInformation : EventTarget + attribute @@toStringTag getter downlink getter downlinkMax getter onchange @@ -643,6 +715,7 @@ interface Notification : EventTarget static getter maxActions static getter permission + attribute @@toStringTag getter actions getter badge getter body @@ -669,11 +742,13 @@ setter onerror setter onshow interface NotificationEvent : ExtendableEvent + attribute @@toStringTag getter action getter notification getter reply method constructor interface OffscreenCanvas : EventTarget + attribute @@toStringTag getter height getter width method constructor @@ -683,6 +758,7 @@ setter height setter width interface OffscreenCanvasRenderingContext2D + attribute @@toStringTag getter canvas getter fillStyle getter filter @@ -754,6 +830,7 @@ setter shadowOffsetY setter strokeStyle interface Path2D + attribute @@toStringTag method addPath method arc method arcTo @@ -766,6 +843,7 @@ method quadraticCurveTo method rect interface PaymentInstruments + attribute @@toStringTag method clear method constructor method delete @@ -774,45 +852,54 @@ method keys method set interface PaymentRequestEvent : ExtendableEvent + attribute @@toStringTag getter appRequest method constructor method respondWith interface PerformanceObserverEntryList + attribute @@toStringTag method constructor method getEntries method getEntriesByName method getEntriesByType interface PermissionStatus : EventTarget + attribute @@toStringTag getter onchange getter state method constructor setter onchange interface Permissions + attribute @@toStringTag method constructor method query method request method requestAll method revoke interface PromiseRejectionEvent : Event + attribute @@toStringTag getter promise getter reason method constructor interface PushEvent : ExtendableEvent + attribute @@toStringTag getter data method constructor interface PushManager static getter supportedContentEncodings + attribute @@toStringTag method constructor method getSubscription method permissionState method subscribe interface PushMessageData + attribute @@toStringTag method arrayBuffer method blob method constructor method json method text interface PushSubscription + attribute @@toStringTag getter endpoint getter expirationTime getter options @@ -821,6 +908,7 @@ method toJSON method unsubscribe interface PushSubscriptionOptions + attribute @@toStringTag getter applicationServerKey getter userVisibleOnly method constructor @@ -833,6 +921,7 @@ method pipeTo method tee interface Request + attribute @@toStringTag getter bodyUsed getter cache getter credentials @@ -854,6 +943,7 @@ interface Response static method error static method redirect + attribute @@toStringTag getter body getter bodyUsed getter headers @@ -871,8 +961,10 @@ method json method text interface ServiceWorkerGlobalScope : WorkerGlobalScope + attribute @@toStringTag method constructor interface ServiceWorkerRegistration : EventTarget + attribute @@toStringTag getter active getter backgroundFetch getter installing @@ -890,14 +982,17 @@ method update setter onupdatefound interface SharedArrayBuffer + attribute @@toStringTag getter byteLength method constructor method slice interface StorageManager + attribute @@toStringTag method constructor method estimate method persisted interface SubtleCrypto + attribute @@toStringTag method constructor method decrypt method deriveBits @@ -912,27 +1007,33 @@ method verify method wrapKey interface SyncEvent : ExtendableEvent + attribute @@toStringTag getter lastChance getter tag method constructor interface SyncManager + attribute @@toStringTag method constructor method getTags method register interface TextDecoder + attribute @@toStringTag getter encoding getter fatal getter ignoreBOM method constructor method decode interface TextDetector + attribute @@toStringTag method constructor method detect interface TextEncoder + attribute @@toStringTag getter encoding method constructor method encode interface URL + attribute @@toStringTag getter hash getter host getter hostname @@ -958,6 +1059,8 @@ setter search setter username interface URLSearchParams + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -971,6 +1074,7 @@ method toString method values interface WebGL2RenderingContext + attribute @@toStringTag attribute ACTIVE_ATTRIBUTES attribute ACTIVE_TEXTURE attribute ACTIVE_UNIFORMS @@ -1760,6 +1864,7 @@ method viewport method waitSync interface WebGLRenderingContext + attribute @@toStringTag attribute ACTIVE_ATTRIBUTES attribute ACTIVE_TEXTURE attribute ACTIVE_UNIFORMS @@ -2198,6 +2303,7 @@ method vertexAttribPointer method viewport interface WebSocket : EventTarget + attribute @@toStringTag attribute CLOSED attribute CLOSING attribute CONNECTING @@ -2221,12 +2327,14 @@ setter onmessage setter onopen interface WindowClient : Client + attribute @@toStringTag getter focused getter visibilityState method constructor method focus method navigate interface WorkerGlobalScope : EventTarget + attribute @@toStringTag getter addressSpace getter caches getter crypto @@ -2255,6 +2363,7 @@ setter onunhandledrejection setter origin interface WorkerLocation + attribute @@toStringTag getter hash getter host getter hostname @@ -2267,6 +2376,7 @@ method constructor method toString interface WorkerNavigator + attribute @@toStringTag getter appCodeName getter appName getter appVersion @@ -2285,7 +2395,7 @@ method abort method constructor method getWriter -global object +[GLOBAL OBJECT] attribute Atomics attribute console attribute internals
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js index 08743cc..2a06adfa 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js
@@ -1,139 +1,19 @@ -/* Adopted from LayoutTests/webexposed/resources/global-interface-listing.js */ - -// Run all the code in a local scope. +// Avoid polluting the global scope. (function(global_object) { -var globals = []; + // Save the list of property names of the global object before loading other scripts. + var global_property_names = Object.getOwnPropertyNames(global_object); -// List of builtin JS constructors; Blink is not controlling what properties these -// objects have, so exercising them in a Blink test doesn't make sense. -// -// This list should be kept in sync with the one at LayoutTests/webexposed/resources/global-interface-listing.js -var js_builtins = new Set([ - 'Array', - 'ArrayBuffer', - 'Boolean', - 'Date', - 'Error', - 'EvalError', - 'Float32Array', - 'Float64Array', - 'Function', - 'Infinity', - 'Int16Array', - 'Int32Array', - 'Int8Array', - 'Intl', - 'JSON', - 'Map', - 'Math', - 'NaN', - 'Number', - 'Object', - 'Promise', - 'Proxy', - 'RangeError', - 'ReferenceError', - 'Reflect', - 'RegExp', - 'Set', - 'String', - 'Symbol', - 'SyntaxError', - 'TypeError', - 'URIError', - 'Uint16Array', - 'Uint32Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'WeakMap', - 'WeakSet', - 'WebAssembly', - 'decodeURI', - 'decodeURIComponent', - 'encodeURI', - 'encodeURIComponent', - 'escape', - 'eval', - 'isFinite', - 'isNaN', - 'parseFloat', - 'parseInt', - 'undefined', - 'unescape', -]); + importScripts('/js-test-resources/global-interface-listing.js'); -function is_web_idl_constructor(property_name) { - if (js_builtins.has(property_name)) - return false; - var descriptor = Object.getOwnPropertyDescriptor(this, property_name); - if (descriptor.value === undefined || - descriptor.value.prototype === undefined) { - return false; - } - return descriptor.writable && !descriptor.enumerable && - descriptor.configurable; -} + var globals = []; -function collect_property_info(object, property_name, output) { - var keywords = ('prototype' in object) ? 'static ' : ''; - var descriptor = Object.getOwnPropertyDescriptor(object, property_name); - if ('value' in descriptor) { - var type; - if (typeof descriptor.value === 'function') { - type = 'method'; - } else { - type = 'attribute'; - } - output.push(' ' + keywords + type + ' ' + property_name); - } else { - if (descriptor.get) - output.push(' ' + keywords + 'getter ' + property_name); - if (descriptor.set) - output.push(' ' + keywords + 'setter ' + property_name); - } -} + globalInterfaceListing(global_object, + global_property_names, + string => globals.push(string)); -var interface_names = Object.getOwnPropertyNames(global_object).filter(is_web_idl_constructor); -interface_names.sort(); -interface_names.forEach(function(interface_name) { - var inherits_from = this[interface_name].__proto__.name; - if (inherits_from) - globals.push('interface ' + interface_name + ' : ' + inherits_from); - else - globals.push('interface ' + interface_name); - // List static properties then prototype properties. - [this[interface_name], this[interface_name].prototype].forEach(function(object) { - if ('prototype' in object) { - // Skip properties that aren't static (e.g. consts), or are inherited. - var proto_properties = new Set(Object.keys(object.prototype).concat( - Object.keys(object.__proto__))); - var property_names = Object.keys(object).filter(function(name) { - return !proto_properties.has(name); - }); - } else { - var property_names = Object.getOwnPropertyNames(object); - } - var property_strings = []; - property_names.forEach(function(property_name) { - collect_property_info(object, property_name, property_strings); - }); - globals.push.apply(globals, property_strings.sort()); + self.addEventListener('message', function(event) { + event.ports[0].postMessage({ result: globals }); }); -}); -globals.push('global object'); -var property_strings = []; -var member_names = Object.getOwnPropertyNames(global_object).filter(function(property_name) { - return !js_builtins.has(property_name) && !is_web_idl_constructor(property_name); -}); -member_names.forEach(function(property_name) { - collect_property_info(global_object, property_name, property_strings); -}); -globals.push.apply(globals, property_strings.sort()); - -self.addEventListener('message', function(event) { - event.ports[0].postMessage({ result: globals }); -}); - -})(this); // Run all the code in a local scope. +})(this);
diff --git a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/resources/global-interface-listing-worklet.js b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/resources/global-interface-listing-worklet.js index 0f2ae2b..80b1dc69f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/resources/global-interface-listing-worklet.js +++ b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/resources/global-interface-listing-worklet.js
@@ -1,4 +1,4 @@ -/* Adopted from LayoutTests/webexposed/resources/global-interface-listing.js */ +/* Adopted from LayoutTests/resources/global-interface-listing.js */ // Run all the code in a local scope. (function(global_object) { @@ -8,7 +8,7 @@ // List of builtin JS constructors; Blink is not controlling what properties these // objects have, so exercising them in a Blink test doesn't make sense. // -// This list should be kept in sync with the one at LayoutTests/webexposed/resources/global-interface-listing.js +// This list should be kept in sync with the one at LayoutTests/resources/global-interface-listing.js var js_builtins = new Set([ 'Array', 'ArrayBuffer',
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-basic-allow-access-control-origin-header-data-url-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-basic-allow-access-control-origin-header-data-url-expected.txt index f2353ff..4f7bafa8 100644 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-basic-allow-access-control-origin-header-data-url-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-basic-allow-access-control-origin-header-data-url-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. CONSOLE WARNING: line 1: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. PASS: Cross-domain access allowed. HTTP_ORIGIN: null
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/newline-in-request-uri-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/newline-in-request-uri-expected.txt index b88c102..87f0768 100644 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/newline-in-request-uri-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/newline-in-request-uri-expected.txt
@@ -1,7 +1,5 @@ CONSOLE WARNING: line 10: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. -CONSOLE WARNING: line 11: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. -CONSOLE ERROR: line 11: Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://127.0.0.1:8000/xmlhttprequest/resources/print-headers.cgi'. Test for bug 22731: Newline in XMLHttpRequest URL can be used to remove HTTP headers (e.g. Host:). -LF FAIL: test did not run -CR FAIL: test did not run +LF SUCCESS +CR SUCCESS
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt index d3c0ec2..bbe89d1ef 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. { "layers": [ {
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/frames/frameset-style-recalc-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/frames/frameset-style-recalc-expected.txt index ccd8f62d..8dde2be 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/frames/frameset-style-recalc-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/frames/frameset-style-recalc-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..ef65bdfec --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index 87dfef6..fcc5b68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index 87dfef6..fcc5b68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index 87dfef6..fcc5b68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index 87dfef6..fcc5b68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-expected.png index 87dfef6..fcc5b68 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..6724aed --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..2a3dbe0b --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index 93430d95..ac8962d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index e15d186..3c62a2c7c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..90f148f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index 5e63673..1a4d7c6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..91ebe2d9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index dce34fc3..a188f985 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index e15d186..3c62a2c7c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..691e6b8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt index 81109b1..97e19398 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. { "layers": [ {
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt index 81109b1..97e19398 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. { "layers": [ {
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..4ed780a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index 4768aed..66beee9a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index aea0584..25afa3c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index 4768aed..66beee9a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index aea0584..25afa3c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-expected.png index aea0584..25afa3c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..28967e5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..ee4d336 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index 1e05428..fd2af0a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index 5ee6a011..e62b794 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..7ae6931 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index 4a1a9fe..58547ab 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..3a10dc7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index b0b00006..d9952eca 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index 5ee6a011..e62b794 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..17cd9a5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png index 1c8960ead..fdbbcbbfa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png index 1c8960ead..fdbbcbbfa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png index 1c8960ead..fdbbcbbfa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png index 1c8960ead..fdbbcbbfa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png index 1c8960ead..fdbbcbbfa 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..897dba7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index f250617..b5a8e27 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index a7452b8..ca6bcc9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index f250617..b5a8e27 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index a7452b8..ca6bcc9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-expected.png index a7452b8..ca6bcc9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..6418811 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..6ea0ff9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index d55a32e..889b345 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index 9d94c46..b3ab2d3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..c1ab85c3d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index 269a0c5..f5e124b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..92365b4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index 86e8adb..13acd2e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index 9d94c46..b3ab2d3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..8b683922 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png index 1bca2bb..e61b9b7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png index 1bca2bb..e61b9b7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png index 1bca2bb..e61b9b7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png index 1bca2bb..e61b9b7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png index 1bca2bb..e61b9b7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/frames/frameset-style-recalc-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/frames/frameset-style-recalc-expected.txt index 3369ae7..a9bd29e 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/frames/frameset-style-recalc-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/frames/frameset-style-recalc-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..6f2d4d7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index b96cc5cf..1f07d5a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index b7d4ba7..1fe6314a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index b96cc5cf..1f07d5a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index b7d4ba7..1fe6314a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-expected.png index b7d4ba7..1fe6314a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..2c52aaf --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..5fecb4e1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index d70ca9c..e087a76 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index 3397ab5e..ee1a083 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..5fbe1772 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index e25e103..7a0f9c7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..0a9a4c0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index b276ccb..fbea3492 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index 3397ab5e..ee1a083 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..0057d16 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png index 19cba7e..44ff320 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png index 19cba7e..44ff320 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png index 19cba7e..44ff320 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png index 19cba7e..44ff320 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png index 19cba7e..44ff320 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index b07cd14..a920dd7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1,9 +1,12 @@ +[INTERFACES] interface Blob + attribute @@toStringTag getter size getter type method constructor method slice interface BroadcastChannel : EventTarget + attribute @@toStringTag getter name getter onmessage getter onmessageerror @@ -16,6 +19,7 @@ method constructor method size interface Cache + attribute @@toStringTag method add method addAll method constructor @@ -25,6 +29,7 @@ method matchAll method put interface CacheStorage + attribute @@toStringTag method constructor method delete method has @@ -32,6 +37,7 @@ method match method open interface Client + attribute @@toStringTag getter frameType getter id getter type @@ -39,12 +45,14 @@ method constructor method postMessage interface Clients + attribute @@toStringTag method claim method constructor method get method matchAll method openWindow interface CloseEvent : Event + attribute @@toStringTag getter code getter reason getter wasClean @@ -53,20 +61,24 @@ method constructor method size interface Crypto + attribute @@toStringTag getter subtle method constructor method getRandomValues interface CryptoKey + attribute @@toStringTag getter algorithm getter extractable getter type getter usages method constructor interface CustomEvent : Event + attribute @@toStringTag getter detail method constructor method initCustomEvent interface DOMException + attribute @@toStringTag attribute ABORT_ERR attribute DATA_CLONE_ERR attribute DOMSTRING_SIZE_ERR @@ -98,11 +110,14 @@ method constructor method toString interface DOMStringList + attribute @@toStringTag getter length + method @@iterator method constructor method contains method item interface DataView + attribute @@toStringTag getter buffer getter byteLength getter byteOffset @@ -124,6 +139,7 @@ method setUint32 method setUint8 interface Event + attribute @@toStringTag attribute AT_TARGET attribute BUBBLING_PHASE attribute CAPTURING_PHASE @@ -150,6 +166,7 @@ setter cancelBubble setter returnValue interface EventSource : EventTarget + attribute @@toStringTag attribute CLOSED attribute CONNECTING attribute OPEN @@ -165,14 +182,17 @@ setter onmessage setter onopen interface EventTarget + attribute @@toStringTag method addEventListener method constructor method dispatchEvent method removeEventListener interface ExtendableEvent : Event + attribute @@toStringTag method constructor method waitUntil interface ExtendableMessageEvent : ExtendableEvent + attribute @@toStringTag getter data getter lastEventId getter origin @@ -180,6 +200,7 @@ getter source method constructor interface FetchEvent : ExtendableEvent + attribute @@toStringTag getter clientId getter isReload getter preloadResponse @@ -187,16 +208,20 @@ method constructor method respondWith interface File : Blob + attribute @@toStringTag getter lastModified getter lastModifiedDate getter name getter webkitRelativePath method constructor interface FileList + attribute @@toStringTag getter length + method @@iterator method constructor method item interface FileReader : EventTarget + attribute @@toStringTag attribute DONE attribute EMPTY attribute LOADING @@ -222,6 +247,8 @@ setter onloadstart setter onprogress interface FormData + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -234,6 +261,8 @@ method set method values interface Headers + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -245,6 +274,7 @@ method set method values interface IDBCursor + attribute @@toStringTag getter direction getter key getter primaryKey @@ -256,9 +286,11 @@ method delete method update interface IDBCursorWithValue : IDBCursor + attribute @@toStringTag getter value method constructor interface IDBDatabase : EventTarget + attribute @@toStringTag getter name getter objectStoreNames getter onabort @@ -276,11 +308,13 @@ setter onerror setter onversionchange interface IDBFactory + attribute @@toStringTag method cmp method constructor method deleteDatabase method open interface IDBIndex + attribute @@toStringTag getter keyPath getter multiEntry getter name @@ -300,6 +334,7 @@ static method lowerBound static method only static method upperBound + attribute @@toStringTag getter lower getter lowerOpen getter upper @@ -307,6 +342,7 @@ method constructor method includes interface IDBObjectStore + attribute @@toStringTag getter autoIncrement getter indexNames getter keyPath @@ -329,12 +365,14 @@ method put setter name interface IDBOpenDBRequest : IDBRequest + attribute @@toStringTag getter onblocked getter onupgradeneeded method constructor setter onblocked setter onupgradeneeded interface IDBRequest : EventTarget + attribute @@toStringTag getter error getter onerror getter onsuccess @@ -346,6 +384,7 @@ setter onerror setter onsuccess interface IDBTransaction : EventTarget + attribute @@toStringTag getter db getter error getter mode @@ -360,28 +399,34 @@ setter oncomplete setter onerror interface IDBVersionChangeEvent : Event + attribute @@toStringTag getter dataLoss getter dataLossMessage getter newVersion getter oldVersion method constructor interface ImageBitmap + attribute @@toStringTag getter height getter width method close method constructor interface ImageData + attribute @@toStringTag getter data getter height getter width method constructor interface InstallEvent : ExtendableEvent + attribute @@toStringTag method constructor interface MessageChannel + attribute @@toStringTag getter port1 getter port2 method constructor interface MessageEvent : Event + attribute @@toStringTag getter data getter lastEventId getter origin @@ -390,6 +435,7 @@ method constructor method initMessageEvent interface MessagePort : EventTarget + attribute @@toStringTag getter onmessage getter onmessageerror method close @@ -399,6 +445,7 @@ setter onmessage setter onmessageerror interface NavigationPreloadManager + attribute @@toStringTag method constructor method disable method enable @@ -407,6 +454,7 @@ interface Notification : EventTarget static getter maxActions static getter permission + attribute @@toStringTag getter actions getter badge getter body @@ -432,42 +480,51 @@ setter onerror setter onshow interface NotificationEvent : ExtendableEvent + attribute @@toStringTag getter action getter notification method constructor interface PerformanceObserverEntryList + attribute @@toStringTag method constructor method getEntries method getEntriesByName method getEntriesByType interface PermissionStatus : EventTarget + attribute @@toStringTag getter onchange getter state method constructor setter onchange interface Permissions + attribute @@toStringTag method constructor method query interface PromiseRejectionEvent : Event + attribute @@toStringTag getter promise getter reason method constructor interface PushEvent : ExtendableEvent + attribute @@toStringTag getter data method constructor interface PushManager static getter supportedContentEncodings + attribute @@toStringTag method constructor method getSubscription method permissionState method subscribe interface PushMessageData + attribute @@toStringTag method arrayBuffer method blob method constructor method json method text interface PushSubscription + attribute @@toStringTag getter endpoint getter expirationTime getter options @@ -476,6 +533,7 @@ method toJSON method unsubscribe interface PushSubscriptionOptions + attribute @@toStringTag getter applicationServerKey getter userVisibleOnly method constructor @@ -488,6 +546,7 @@ method pipeTo method tee interface Request + attribute @@toStringTag getter bodyUsed getter credentials getter headers @@ -508,6 +567,7 @@ interface Response static method error static method redirect + attribute @@toStringTag getter body getter bodyUsed getter headers @@ -525,8 +585,10 @@ method json method text interface ServiceWorkerGlobalScope : WorkerGlobalScope + attribute @@toStringTag method constructor interface ServiceWorkerRegistration : EventTarget + attribute @@toStringTag getter active getter installing getter navigationPreload @@ -542,13 +604,16 @@ method update setter onupdatefound interface SharedArrayBuffer + attribute @@toStringTag getter byteLength method constructor method slice interface StorageManager + attribute @@toStringTag method constructor method persisted interface SubtleCrypto + attribute @@toStringTag method constructor method decrypt method deriveBits @@ -563,24 +628,29 @@ method verify method wrapKey interface SyncEvent : ExtendableEvent + attribute @@toStringTag getter lastChance getter tag method constructor interface SyncManager + attribute @@toStringTag method constructor method getTags method register interface TextDecoder + attribute @@toStringTag getter encoding getter fatal getter ignoreBOM method constructor method decode interface TextEncoder + attribute @@toStringTag getter encoding method constructor method encode interface URL + attribute @@toStringTag getter hash getter host getter hostname @@ -606,6 +676,8 @@ setter search setter username interface URLSearchParams + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -619,6 +691,7 @@ method toString method values interface WebSocket : EventTarget + attribute @@toStringTag attribute CLOSED attribute CLOSING attribute CONNECTING @@ -642,12 +715,14 @@ setter onmessage setter onopen interface WindowClient : Client + attribute @@toStringTag getter focused getter visibilityState method constructor method focus method navigate interface WorkerGlobalScope : EventTarget + attribute @@toStringTag getter caches getter crypto getter indexedDB @@ -675,6 +750,7 @@ setter onunhandledrejection setter origin interface WorkerLocation + attribute @@toStringTag getter hash getter host getter hostname @@ -687,6 +763,7 @@ method constructor method toString interface WorkerNavigator + attribute @@toStringTag getter appCodeName getter appName getter appVersion @@ -703,7 +780,7 @@ method abort method constructor method getWriter -global object +[GLOBAL OBJECT] attribute Atomics attribute console attribute internals
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt index 15ff3fc..53ae704 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface Blob [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt index 784297a5..b8bb7768 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE WARNING: line 95: 'webkitURL' is deprecated. Please use 'URL' instead. +CONSOLE WARNING: line 70: 'webkitURL' is deprecated. Please use 'URL' instead. This test documents all interface attributes and methods on the global window object and element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt index a0f7647..cc12639a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface Blob [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/frames/frameset-style-recalc-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/frames/frameset-style-recalc-expected.txt index 96acac2..55265c98 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/frames/frameset-style-recalc-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/frames/frameset-style-recalc-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..030de2a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index 9acce24..3d7d6bd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index c368d5a..58f07c6f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index 9acce24..3d7d6bd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index c368d5a..58f07c6f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-expected.png index c368d5a..58f07c6f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..64b6b6b0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..bd5b3fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index 0a9b8da..0cf6632 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index d8f918b..bae5f81 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..d083d0c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index a09fdb4..fdfed6eb 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..d6b9a56 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index ae6f584..be3bee9 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index d8f918b..bae5f81 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..8be61b1b --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png index 69391a2a..80bbb636 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png index 69391a2a..80bbb636 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png index 69391a2a..80bbb636 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png index f4501a9..cf10386 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png index 69391a2a..80bbb636 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt index e5c8188..911d579b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. { "layers": [ {
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt index e5c8188..911d579b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/canvas-composite-repaint-by-all-imagesource-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. { "layers": [ {
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt index 77ccfe9..f304848 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE WARNING: line 95: 'webkitURL' is deprecated. Please use 'URL' instead. +CONSOLE WARNING: line 70: 'webkitURL' is deprecated. Please use 'URL' instead. This test documents all interface attributes and methods on the global window object and element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..3967bf3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png index b230d3e8..d6c49e6d 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png index 0e6a240..4a3e8f4 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png index b230d3e8..d6c49e6d 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png index 0e6a240..4a3e8f4 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-expected.png index 0e6a240..4a3e8f4 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..ada2e82 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png new file mode 100644 index 0000000..31ce51bd --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png index ed0adf1..f7f71eb 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png index 238eda3..9677d58b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png new file mode 100644 index 0000000..41a916e --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png index 1636c7b..3ff5a9d 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png new file mode 100644 index 0000000..ab2ac3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png index 33e5117..e50f9c303 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png index 238eda3..9677d58b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-mixed-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png new file mode 100644 index 0000000..8a03995 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png index f44c3f6b0..ab8b0d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png index f44c3f6b0..ab8b0d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png index f44c3f6b0..ab8b0d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png index e3bd0df..cf02d52 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-align-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png index f44c3f6b0..ab8b0d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/place-rtl-ellipsis-in-inline-blocks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/plugins/createScriptableObject-before-start-expected.txt b/third_party/WebKit/LayoutTests/plugins/createScriptableObject-before-start-expected.txt index df3f12d..83a7a2f 100644 --- a/third_party/WebKit/LayoutTests/plugins/createScriptableObject-before-start-expected.txt +++ b/third_party/WebKit/LayoutTests/plugins/createScriptableObject-before-start-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. Test for http://bugs.webkit.org/show_bug.cgi?id=12050 REGRESSION: Assertion failure in -[WebBaseNetscapePluginView willCallPlugInFunction] (plugin). No ASSERT means test PASS.
diff --git a/third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt index 1c028157..92de9dd5 100644 --- a/third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt +++ b/third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. layer at (0,0) size 1066x799 LayoutView at (0,0) size 1066x799 layer at (0,0) size 1066x400
diff --git a/third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing.js b/third_party/WebKit/LayoutTests/resources/global-interface-listing.js similarity index 74% rename from third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing.js rename to third_party/WebKit/LayoutTests/resources/global-interface-listing.js index 0c4f35c..1fd3136d 100644 --- a/third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing.js +++ b/third_party/WebKit/LayoutTests/resources/global-interface-listing.js
@@ -1,34 +1,9 @@ -// Run all the code in a local scope. -(function(globalObject) { +// * |globalObject| should be the global (usually |this|). +// * |propertyNamesInGlobal| should be a list of properties captured before +// other scripts are loaded, using: Object.getOwnPropertyNames(this); +// * |outputFunc| is called back with each line of output. -// Save the list of property names of the global object before loading other scripts. -var propertyNamesInGlobal = globalObject.propertyNamesInGlobal || Object.getOwnPropertyNames(globalObject); - -if (self.importScripts) { - importScripts('../../resources/js-test.js'); - - if (!self.postMessage) { - // Shared worker. Make postMessage send to the newest client, which in - // our tests is the only client. - - // Store messages for sending until we have somewhere to send them. - self.postMessage = function(message) { - if (typeof self.pendingMessages === "undefined") - self.pendingMessages = []; - self.pendingMessages.push(message); - }; - self.onconnect = function(event) { - self.postMessage = function(message) { - event.ports[0].postMessage(message); - }; - // Offload any stored messages now that someone has connected to us. - if (typeof self.pendingMessages === "undefined") - return; - while (self.pendingMessages.length) - event.ports[0].postMessage(self.pendingMessages.shift()); - }; - } -} +function globalInterfaceListing(globalObject, propertyNamesInGlobal, outputFunc) { // List of builtin JS constructors; Blink is not controlling what properties these // objects have, so exercising them in a Blink test doesn't make sense. @@ -142,7 +117,7 @@ Object.keys(object.__proto__), ownEnumerableSymbols(object.prototype), ownEnumerableSymbols(object.__proto__))); - return propertyKeys = Object.keys(object). + return Object.keys(object). concat(ownEnumerableSymbols(object)). filter(function(name) { return !protoProperties.has(name); @@ -152,15 +127,15 @@ } // FIXME: List interfaces with NoInterfaceObject specified in their IDL file. -debug('[INTERFACES]'); +outputFunc('[INTERFACES]'); var interfaceNames = Object.getOwnPropertyNames(this).filter(isWebIDLConstructor); interfaceNames.sort(); interfaceNames.forEach(function(interfaceName) { var inheritsFrom = this[interfaceName].__proto__.name; if (inheritsFrom) - debug('interface ' + interfaceName + ' : ' + inheritsFrom); + outputFunc('interface ' + interfaceName + ' : ' + inheritsFrom); else - debug('interface ' + interfaceName); + outputFunc('interface ' + interfaceName); // List static properties then prototype properties. [this[interfaceName], this[interfaceName].prototype].forEach(function(object) { var propertyKeys = collectPropertyKeys(object); @@ -168,11 +143,11 @@ propertyKeys.forEach(function(propertyKey) { collectPropertyInfo(object, propertyKey, propertyStrings); }); - propertyStrings.sort().forEach(debug); + propertyStrings.sort().forEach(outputFunc); }); }); -debug('[GLOBAL OBJECT]'); +outputFunc('[GLOBAL OBJECT]'); var propertyStrings = []; var memberNames = propertyNamesInGlobal.filter(function(propertyKey) { return !jsBuiltins.has(propertyKey) && !isWebIDLConstructor(propertyKey); @@ -180,9 +155,6 @@ memberNames.forEach(function(propertyKey) { collectPropertyInfo(globalObject, propertyKey, propertyStrings); }); -propertyStrings.sort().forEach(debug); +propertyStrings.sort().forEach(outputFunc); -if (isWorker()) - finishJSTest(); - -})(this); // Run all the code in a local scope. +}
diff --git a/third_party/WebKit/LayoutTests/svg/custom/g-outside-svg-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/g-outside-svg-expected.txt index d0f1de7..03938ca 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/g-outside-svg-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/custom/g-outside-svg-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. The SVG in the below frame should not render or crash.
diff --git a/third_party/WebKit/LayoutTests/svg/custom/large-image-pattern-crash-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/large-image-pattern-crash-expected.txt index 00e3afa9..886a96b8 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/large-image-pattern-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/custom/large-image-pattern-crash-expected.txt
@@ -1,3 +1,2 @@ -CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details. PASS: did not crash.
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index 8bd7d8e..9d16d17 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1,21 +1,28 @@ +[INTERFACES] interface BackgroundFetchClickEvent : BackgroundFetchEvent + attribute @@toStringTag getter state method constructor interface BackgroundFetchEvent : ExtendableEvent + attribute @@toStringTag getter tag method constructor interface BackgroundFetchFailEvent : BackgroundFetchEvent + attribute @@toStringTag getter fetches method constructor interface BackgroundFetchFetch + attribute @@toStringTag getter request method constructor interface BackgroundFetchManager + attribute @@toStringTag method constructor method fetch method get method getTags interface BackgroundFetchRegistration + attribute @@toStringTag getter icons getter tag getter title @@ -23,16 +30,20 @@ method abort method constructor interface BackgroundFetchSettledFetch : BackgroundFetchFetch + attribute @@toStringTag getter response method constructor interface BackgroundFetchedEvent : BackgroundFetchEvent + attribute @@toStringTag getter fetches method constructor method updateUI interface BarcodeDetector + attribute @@toStringTag method constructor method detect interface Blob + attribute @@toStringTag getter isClosed getter size getter type @@ -40,6 +51,7 @@ method constructor method slice interface BroadcastChannel : EventTarget + attribute @@toStringTag getter name getter onmessage getter onmessageerror @@ -49,11 +61,13 @@ setter onmessage setter onmessageerror interface BudgetService + attribute @@toStringTag method constructor method getBudget method getCost method reserve interface BudgetState + attribute @@toStringTag getter budgetAt getter time method constructor @@ -61,6 +75,7 @@ method constructor method size interface Cache + attribute @@toStringTag method add method addAll method constructor @@ -70,6 +85,7 @@ method matchAll method put interface CacheStorage + attribute @@toStringTag method constructor method delete method has @@ -77,11 +93,14 @@ method match method open interface CanvasGradient + attribute @@toStringTag method addColorStop method constructor interface CanvasPattern + attribute @@toStringTag method constructor interface Client + attribute @@toStringTag getter frameType getter id getter type @@ -89,12 +108,14 @@ method constructor method postMessage interface Clients + attribute @@toStringTag method claim method constructor method get method matchAll method openWindow interface CloseEvent : Event + attribute @@toStringTag getter code getter reason getter wasClean @@ -103,20 +124,24 @@ method constructor method size interface Crypto + attribute @@toStringTag getter subtle method constructor method getRandomValues interface CryptoKey + attribute @@toStringTag getter algorithm getter extractable getter type getter usages method constructor interface CustomEvent : Event + attribute @@toStringTag getter detail method constructor method initCustomEvent interface DOMException + attribute @@toStringTag attribute ABORT_ERR attribute DATA_CLONE_ERR attribute DOMSTRING_SIZE_ERR @@ -148,6 +173,7 @@ method constructor method toString interface DOMMatrix : DOMMatrixReadOnly + attribute @@toStringTag getter a getter b getter c @@ -209,6 +235,7 @@ static method fromFloat32Array static method fromFloat64Array static method fromMatrix + attribute @@toStringTag getter a getter b getter c @@ -252,6 +279,7 @@ method transformPoint method translate interface DOMPoint : DOMPointReadOnly + attribute @@toStringTag getter w getter x getter y @@ -263,6 +291,7 @@ setter z interface DOMPointReadOnly static method fromPoint + attribute @@toStringTag getter w getter x getter y @@ -273,6 +302,7 @@ interface DOMQuad static method fromQuad static method fromRect + attribute @@toStringTag getter p1 getter p2 getter p3 @@ -281,6 +311,7 @@ method getBounds method toJSON interface DOMRect : DOMRectReadOnly + attribute @@toStringTag getter height getter width getter x @@ -292,6 +323,7 @@ setter y interface DOMRectReadOnly static method fromRect + attribute @@toStringTag getter bottom getter height getter left @@ -303,11 +335,14 @@ method constructor method toJSON interface DOMStringList + attribute @@toStringTag getter length + method @@iterator method constructor method contains method item interface DataView + attribute @@toStringTag getter buffer getter byteLength getter byteOffset @@ -329,6 +364,7 @@ method setUint32 method setUint8 interface Event + attribute @@toStringTag attribute AT_TARGET attribute BUBBLING_PHASE attribute CAPTURING_PHASE @@ -355,6 +391,7 @@ setter cancelBubble setter returnValue interface EventSource : EventTarget + attribute @@toStringTag attribute CLOSED attribute CONNECTING attribute OPEN @@ -370,14 +407,17 @@ setter onmessage setter onopen interface EventTarget + attribute @@toStringTag method addEventListener method constructor method dispatchEvent method removeEventListener interface ExtendableEvent : Event + attribute @@toStringTag method constructor method waitUntil interface ExtendableMessageEvent : ExtendableEvent + attribute @@toStringTag getter data getter lastEventId getter origin @@ -385,25 +425,31 @@ getter source method constructor interface FaceDetector + attribute @@toStringTag method constructor method detect interface FetchEvent : ExtendableEvent + attribute @@toStringTag getter clientId getter isReload getter request method constructor method respondWith interface File : Blob + attribute @@toStringTag getter lastModified getter lastModifiedDate getter name getter webkitRelativePath method constructor interface FileList + attribute @@toStringTag getter length + method @@iterator method constructor method item interface FileReader : EventTarget + attribute @@toStringTag attribute DONE attribute EMPTY attribute LOADING @@ -429,11 +475,14 @@ setter onloadstart setter onprogress interface ForeignFetchEvent : ExtendableEvent + attribute @@toStringTag getter origin getter request method constructor method respondWith interface FormData + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -446,6 +495,8 @@ method set method values interface Headers + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -457,6 +508,7 @@ method set method values interface IDBCursor + attribute @@toStringTag getter direction getter key getter primaryKey @@ -468,9 +520,11 @@ method delete method update interface IDBCursorWithValue : IDBCursor + attribute @@toStringTag getter value method constructor interface IDBDatabase : EventTarget + attribute @@toStringTag getter name getter objectStoreNames getter onabort @@ -488,11 +542,13 @@ setter onerror setter onversionchange interface IDBFactory + attribute @@toStringTag method cmp method constructor method deleteDatabase method open interface IDBIndex + attribute @@toStringTag getter keyPath getter multiEntry getter name @@ -512,6 +568,7 @@ static method lowerBound static method only static method upperBound + attribute @@toStringTag getter lower getter lowerOpen getter upper @@ -519,6 +576,7 @@ method constructor method includes interface IDBObjectStore + attribute @@toStringTag getter autoIncrement getter indexNames getter keyPath @@ -541,21 +599,25 @@ method put setter name interface IDBObservation + attribute @@toStringTag getter key getter type getter value method constructor interface IDBObserver + attribute @@toStringTag method constructor method observe method unobserve interface IDBOpenDBRequest : IDBRequest + attribute @@toStringTag getter onblocked getter onupgradeneeded method constructor setter onblocked setter onupgradeneeded interface IDBRequest : EventTarget + attribute @@toStringTag getter error getter onerror getter onsuccess @@ -567,6 +629,7 @@ setter onerror setter onsuccess interface IDBTransaction : EventTarget + attribute @@toStringTag getter db getter error getter mode @@ -581,17 +644,20 @@ setter oncomplete setter onerror interface IDBVersionChangeEvent : Event + attribute @@toStringTag getter dataLoss getter dataLossMessage getter newVersion getter oldVersion method constructor interface ImageBitmap + attribute @@toStringTag getter height getter width method close method constructor interface ImageData + attribute @@toStringTag getter data getter dataUnion getter height @@ -599,13 +665,16 @@ method constructor method getColorSettings interface InstallEvent : ExtendableEvent + attribute @@toStringTag method constructor method registerForeignFetch interface MessageChannel + attribute @@toStringTag getter port1 getter port2 method constructor interface MessageEvent : Event + attribute @@toStringTag getter data getter lastEventId getter origin @@ -615,6 +684,7 @@ method constructor method initMessageEvent interface MessagePort : EventTarget + attribute @@toStringTag getter onmessage getter onmessageerror method close @@ -624,6 +694,7 @@ setter onmessage setter onmessageerror interface NetworkInformation : EventTarget + attribute @@toStringTag getter downlink getter downlinkMax getter onchange @@ -636,6 +707,7 @@ interface Notification : EventTarget static getter maxActions static getter permission + attribute @@toStringTag getter actions getter badge getter body @@ -662,11 +734,13 @@ setter onerror setter onshow interface NotificationEvent : ExtendableEvent + attribute @@toStringTag getter action getter notification getter reply method constructor interface OffscreenCanvas : EventTarget + attribute @@toStringTag getter height getter width method constructor @@ -676,6 +750,7 @@ setter height setter width interface OffscreenCanvasRenderingContext2D + attribute @@toStringTag getter canvas getter fillStyle getter filter @@ -747,6 +822,7 @@ setter shadowOffsetY setter strokeStyle interface Path2D + attribute @@toStringTag method addPath method arc method arcTo @@ -759,6 +835,7 @@ method quadraticCurveTo method rect interface PaymentInstruments + attribute @@toStringTag method clear method constructor method delete @@ -767,45 +844,54 @@ method keys method set interface PaymentRequestEvent : ExtendableEvent + attribute @@toStringTag getter appRequest method constructor method respondWith interface PerformanceObserverEntryList + attribute @@toStringTag method constructor method getEntries method getEntriesByName method getEntriesByType interface PermissionStatus : EventTarget + attribute @@toStringTag getter onchange getter state method constructor setter onchange interface Permissions + attribute @@toStringTag method constructor method query method request method requestAll method revoke interface PromiseRejectionEvent : Event + attribute @@toStringTag getter promise getter reason method constructor interface PushEvent : ExtendableEvent + attribute @@toStringTag getter data method constructor interface PushManager static getter supportedContentEncodings + attribute @@toStringTag method constructor method getSubscription method permissionState method subscribe interface PushMessageData + attribute @@toStringTag method arrayBuffer method blob method constructor method json method text interface PushSubscription + attribute @@toStringTag getter endpoint getter expirationTime getter options @@ -814,6 +900,7 @@ method toJSON method unsubscribe interface PushSubscriptionOptions + attribute @@toStringTag getter applicationServerKey getter userVisibleOnly method constructor @@ -826,6 +913,7 @@ method pipeTo method tee interface Request + attribute @@toStringTag getter bodyUsed getter cache getter credentials @@ -847,6 +935,7 @@ interface Response static method error static method redirect + attribute @@toStringTag getter body getter bodyUsed getter headers @@ -864,8 +953,10 @@ method json method text interface ServiceWorkerGlobalScope : WorkerGlobalScope + attribute @@toStringTag method constructor interface ServiceWorkerRegistration : EventTarget + attribute @@toStringTag getter active getter backgroundFetch getter installing @@ -882,14 +973,17 @@ method update setter onupdatefound interface SharedArrayBuffer + attribute @@toStringTag getter byteLength method constructor method slice interface StorageManager + attribute @@toStringTag method constructor method estimate method persisted interface SubtleCrypto + attribute @@toStringTag method constructor method decrypt method deriveBits @@ -904,27 +998,33 @@ method verify method wrapKey interface SyncEvent : ExtendableEvent + attribute @@toStringTag getter lastChance getter tag method constructor interface SyncManager + attribute @@toStringTag method constructor method getTags method register interface TextDecoder + attribute @@toStringTag getter encoding getter fatal getter ignoreBOM method constructor method decode interface TextDetector + attribute @@toStringTag method constructor method detect interface TextEncoder + attribute @@toStringTag getter encoding method constructor method encode interface URL + attribute @@toStringTag getter hash getter host getter hostname @@ -950,6 +1050,8 @@ setter search setter username interface URLSearchParams + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -963,6 +1065,7 @@ method toString method values interface WebGL2RenderingContext + attribute @@toStringTag attribute ACTIVE_ATTRIBUTES attribute ACTIVE_TEXTURE attribute ACTIVE_UNIFORMS @@ -1752,6 +1855,7 @@ method viewport method waitSync interface WebGLRenderingContext + attribute @@toStringTag attribute ACTIVE_ATTRIBUTES attribute ACTIVE_TEXTURE attribute ACTIVE_UNIFORMS @@ -2190,6 +2294,7 @@ method vertexAttribPointer method viewport interface WebSocket : EventTarget + attribute @@toStringTag attribute CLOSED attribute CLOSING attribute CONNECTING @@ -2213,12 +2318,14 @@ setter onmessage setter onopen interface WindowClient : Client + attribute @@toStringTag getter focused getter visibilityState method constructor method focus method navigate interface WorkerGlobalScope : EventTarget + attribute @@toStringTag getter addressSpace getter caches getter crypto @@ -2247,6 +2354,7 @@ setter onunhandledrejection setter origin interface WorkerLocation + attribute @@toStringTag getter hash getter host getter hostname @@ -2259,6 +2367,7 @@ method constructor method toString interface WorkerNavigator + attribute @@toStringTag getter appCodeName getter appName getter appVersion @@ -2277,7 +2386,7 @@ method abort method constructor method getWriter -global object +[GLOBAL OBJECT] attribute Atomics attribute console attribute internals
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt index 28ed8cb4..aa0de85 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface BackgroundFetchFetch [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt index 0cb0a79..fd00cf7 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE WARNING: line 95: 'webkitURL' is deprecated. Please use 'URL' instead. +CONSOLE WARNING: line 70: 'webkitURL' is deprecated. Please use 'URL' instead. This test documents all interface attributes and methods on the global window object and element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt index aa5f849..5460e0e 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface BackgroundFetchFetch [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index a42ccf5..73565e0 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1,9 +1,12 @@ +[INTERFACES] interface Blob + attribute @@toStringTag getter size getter type method constructor method slice interface BroadcastChannel : EventTarget + attribute @@toStringTag getter name getter onmessage getter onmessageerror @@ -16,6 +19,7 @@ method constructor method size interface Cache + attribute @@toStringTag method add method addAll method constructor @@ -25,6 +29,7 @@ method matchAll method put interface CacheStorage + attribute @@toStringTag method constructor method delete method has @@ -32,6 +37,7 @@ method match method open interface Client + attribute @@toStringTag getter frameType getter id getter type @@ -39,12 +45,14 @@ method constructor method postMessage interface Clients + attribute @@toStringTag method claim method constructor method get method matchAll method openWindow interface CloseEvent : Event + attribute @@toStringTag getter code getter reason getter wasClean @@ -53,20 +61,24 @@ method constructor method size interface Crypto + attribute @@toStringTag getter subtle method constructor method getRandomValues interface CryptoKey + attribute @@toStringTag getter algorithm getter extractable getter type getter usages method constructor interface CustomEvent : Event + attribute @@toStringTag getter detail method constructor method initCustomEvent interface DOMException + attribute @@toStringTag attribute ABORT_ERR attribute DATA_CLONE_ERR attribute DOMSTRING_SIZE_ERR @@ -98,11 +110,14 @@ method constructor method toString interface DOMStringList + attribute @@toStringTag getter length + method @@iterator method constructor method contains method item interface DataView + attribute @@toStringTag getter buffer getter byteLength getter byteOffset @@ -124,6 +139,7 @@ method setUint32 method setUint8 interface Event + attribute @@toStringTag attribute AT_TARGET attribute BUBBLING_PHASE attribute CAPTURING_PHASE @@ -150,6 +166,7 @@ setter cancelBubble setter returnValue interface EventSource : EventTarget + attribute @@toStringTag attribute CLOSED attribute CONNECTING attribute OPEN @@ -165,14 +182,17 @@ setter onmessage setter onopen interface EventTarget + attribute @@toStringTag method addEventListener method constructor method dispatchEvent method removeEventListener interface ExtendableEvent : Event + attribute @@toStringTag method constructor method waitUntil interface ExtendableMessageEvent : ExtendableEvent + attribute @@toStringTag getter data getter lastEventId getter origin @@ -180,6 +200,7 @@ getter source method constructor interface FetchEvent : ExtendableEvent + attribute @@toStringTag getter clientId getter isReload getter preloadResponse @@ -187,16 +208,20 @@ method constructor method respondWith interface File : Blob + attribute @@toStringTag getter lastModified getter lastModifiedDate getter name getter webkitRelativePath method constructor interface FileList + attribute @@toStringTag getter length + method @@iterator method constructor method item interface FileReader : EventTarget + attribute @@toStringTag attribute DONE attribute EMPTY attribute LOADING @@ -222,6 +247,8 @@ setter onloadstart setter onprogress interface FormData + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -234,6 +261,8 @@ method set method values interface Headers + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -245,6 +274,7 @@ method set method values interface IDBCursor + attribute @@toStringTag getter direction getter key getter primaryKey @@ -256,9 +286,11 @@ method delete method update interface IDBCursorWithValue : IDBCursor + attribute @@toStringTag getter value method constructor interface IDBDatabase : EventTarget + attribute @@toStringTag getter name getter objectStoreNames getter onabort @@ -276,11 +308,13 @@ setter onerror setter onversionchange interface IDBFactory + attribute @@toStringTag method cmp method constructor method deleteDatabase method open interface IDBIndex + attribute @@toStringTag getter keyPath getter multiEntry getter name @@ -300,6 +334,7 @@ static method lowerBound static method only static method upperBound + attribute @@toStringTag getter lower getter lowerOpen getter upper @@ -307,6 +342,7 @@ method constructor method includes interface IDBObjectStore + attribute @@toStringTag getter autoIncrement getter indexNames getter keyPath @@ -329,12 +365,14 @@ method put setter name interface IDBOpenDBRequest : IDBRequest + attribute @@toStringTag getter onblocked getter onupgradeneeded method constructor setter onblocked setter onupgradeneeded interface IDBRequest : EventTarget + attribute @@toStringTag getter error getter onerror getter onsuccess @@ -346,6 +384,7 @@ setter onerror setter onsuccess interface IDBTransaction : EventTarget + attribute @@toStringTag getter db getter error getter mode @@ -360,28 +399,34 @@ setter oncomplete setter onerror interface IDBVersionChangeEvent : Event + attribute @@toStringTag getter dataLoss getter dataLossMessage getter newVersion getter oldVersion method constructor interface ImageBitmap + attribute @@toStringTag getter height getter width method close method constructor interface ImageData + attribute @@toStringTag getter data getter height getter width method constructor interface InstallEvent : ExtendableEvent + attribute @@toStringTag method constructor interface MessageChannel + attribute @@toStringTag getter port1 getter port2 method constructor interface MessageEvent : Event + attribute @@toStringTag getter data getter lastEventId getter origin @@ -390,6 +435,7 @@ method constructor method initMessageEvent interface MessagePort : EventTarget + attribute @@toStringTag getter onmessage getter onmessageerror method close @@ -399,6 +445,7 @@ setter onmessage setter onmessageerror interface NavigationPreloadManager + attribute @@toStringTag method constructor method disable method enable @@ -407,6 +454,7 @@ interface Notification : EventTarget static getter maxActions static getter permission + attribute @@toStringTag getter actions getter badge getter body @@ -433,42 +481,51 @@ setter onerror setter onshow interface NotificationEvent : ExtendableEvent + attribute @@toStringTag getter action getter notification method constructor interface PerformanceObserverEntryList + attribute @@toStringTag method constructor method getEntries method getEntriesByName method getEntriesByType interface PermissionStatus : EventTarget + attribute @@toStringTag getter onchange getter state method constructor setter onchange interface Permissions + attribute @@toStringTag method constructor method query interface PromiseRejectionEvent : Event + attribute @@toStringTag getter promise getter reason method constructor interface PushEvent : ExtendableEvent + attribute @@toStringTag getter data method constructor interface PushManager static getter supportedContentEncodings + attribute @@toStringTag method constructor method getSubscription method permissionState method subscribe interface PushMessageData + attribute @@toStringTag method arrayBuffer method blob method constructor method json method text interface PushSubscription + attribute @@toStringTag getter endpoint getter expirationTime getter options @@ -477,6 +534,7 @@ method toJSON method unsubscribe interface PushSubscriptionOptions + attribute @@toStringTag getter applicationServerKey getter userVisibleOnly method constructor @@ -489,6 +547,7 @@ method pipeTo method tee interface Request + attribute @@toStringTag getter bodyUsed getter credentials getter headers @@ -509,6 +568,7 @@ interface Response static method error static method redirect + attribute @@toStringTag getter body getter bodyUsed getter headers @@ -526,8 +586,10 @@ method json method text interface ServiceWorkerGlobalScope : WorkerGlobalScope + attribute @@toStringTag method constructor interface ServiceWorkerRegistration : EventTarget + attribute @@toStringTag getter active getter installing getter navigationPreload @@ -543,13 +605,16 @@ method update setter onupdatefound interface SharedArrayBuffer + attribute @@toStringTag getter byteLength method constructor method slice interface StorageManager + attribute @@toStringTag method constructor method persisted interface SubtleCrypto + attribute @@toStringTag method constructor method decrypt method deriveBits @@ -564,24 +629,29 @@ method verify method wrapKey interface SyncEvent : ExtendableEvent + attribute @@toStringTag getter lastChance getter tag method constructor interface SyncManager + attribute @@toStringTag method constructor method getTags method register interface TextDecoder + attribute @@toStringTag getter encoding getter fatal getter ignoreBOM method constructor method decode interface TextEncoder + attribute @@toStringTag getter encoding method constructor method encode interface URL + attribute @@toStringTag getter hash getter host getter hostname @@ -607,6 +677,8 @@ setter search setter username interface URLSearchParams + attribute @@toStringTag + method @@iterator method append method constructor method delete @@ -620,6 +692,7 @@ method toString method values interface WebSocket : EventTarget + attribute @@toStringTag attribute CLOSED attribute CLOSING attribute CONNECTING @@ -643,12 +716,14 @@ setter onmessage setter onopen interface WindowClient : Client + attribute @@toStringTag getter focused getter visibilityState method constructor method focus method navigate interface WorkerGlobalScope : EventTarget + attribute @@toStringTag getter caches getter crypto getter indexedDB @@ -676,6 +751,7 @@ setter onunhandledrejection setter origin interface WorkerLocation + attribute @@toStringTag getter hash getter host getter hostname @@ -688,6 +764,7 @@ method constructor method toString interface WorkerNavigator + attribute @@toStringTag getter appCodeName getter appName getter appVersion @@ -704,7 +781,7 @@ method abort method constructor method getWriter -global object +[GLOBAL OBJECT] attribute Atomics attribute console attribute internals
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt index 776d180..98f85e1 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface Blob [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt index c0e6b81..6652a6a 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface Blob [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt index 88adf7f..2df7cb1 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface ByteLengthQueuingStrategy [Worker] method constructor
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker.html b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker.html index 8bd191e0..d5106c1 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker.html +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker.html
@@ -3,7 +3,7 @@ <script> description("This test documents all interface attributes and methods on CompositorWorkerGlobalScope."); if ('CompositorWorker' in window) - worker = startWorker("resources/global-interface-listing.js", "compositor"); + worker = startWorker("resources/global-interface-listing-worker.js", "compositor"); else debug("No CompositorWorker available."); </script>
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt index 32e27189..4f9c967a 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface BackgroundFetchFetch [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker.html b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker.html index f145464..ebe9125 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker.html +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker.html
@@ -2,5 +2,5 @@ <script src="../resources/js-test.js"></script> <script> description("This test documents all interface attributes and methods on DedicatedWorkerGlobalScope."); -worker = startWorker("resources/global-interface-listing.js"); +worker = startWorker("resources/global-interface-listing-worker.js"); </script>
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 88890ad3e..a88cabb 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE WARNING: line 95: 'webkitURL' is deprecated. Please use 'URL' instead. +CONSOLE WARNING: line 70: 'webkitURL' is deprecated. Please use 'URL' instead. This test documents all interface attributes and methods on the global window object and element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt index 38ba39b..0e2f252 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -Starting worker: resources/global-interface-listing.js +Starting worker: resources/global-interface-listing-worker.js [Worker] [INTERFACES] [Worker] interface BackgroundFetchFetch [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker.html b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker.html index 13e97d8..ebb57a2 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker.html +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker.html
@@ -2,5 +2,5 @@ <script src="../resources/js-test.js"></script> <script> description("This test documents all interface attributes and methods on SharedWorkerGlobalScope."); -worker = startWorker("resources/global-interface-listing.js", "shared"); +worker = startWorker("resources/global-interface-listing-worker.js", "shared"); </script>
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing.html b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing.html index eb3f372..ec67dfc 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing.html +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing.html
@@ -4,7 +4,8 @@ var propertyNamesInGlobal = Object.getOwnPropertyNames(this); </script> <script src="../resources/js-test.js"></script> -<script src="resources/global-interface-listing.js"></script> +<script src="../resources/global-interface-listing.js"></script> <script> description("This test documents all interface attributes and methods on the global window object and element instances."); +globalInterfaceListing(this, propertyNamesInGlobal, debug); </script>
diff --git a/third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing-worker.js b/third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing-worker.js new file mode 100644 index 0000000..8819fb8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/webexposed/resources/global-interface-listing-worker.js
@@ -0,0 +1,36 @@ +// Avoid polluting the global scope. +(function(globalObject) { + + // Save the list of property names of the global object before loading other scripts. + var propertyNamesInGlobal = Object.getOwnPropertyNames(globalObject); + + importScripts('../../resources/js-test.js'); + importScripts('../../resources/global-interface-listing.js'); + + if (!self.postMessage) { + // Shared worker. Make postMessage send to the newest client, which in + // our tests is the only client. + + // Store messages for sending until we have somewhere to send them. + self.postMessage = function(message) { + if (typeof self.pendingMessages === "undefined") + self.pendingMessages = []; + self.pendingMessages.push(message); + }; + self.onconnect = function(event) { + self.postMessage = function(message) { + event.ports[0].postMessage(message); + }; + // Offload any stored messages now that someone has connected to us. + if (typeof self.pendingMessages === "undefined") + return; + while (self.pendingMessages.length) + event.ports[0].postMessage(self.pendingMessages.shift()); + }; + } + + globalInterfaceListing(globalObject, propertyNamesInGlobal, debug); + + finishJSTest(); + +})(this);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index a021ef7..a9f556a 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1651,9 +1651,15 @@ case CSSPropertyWebkitLogicalHeight: return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_); case CSSPropertyScrollSnapDestination: + // TODO(crbug.com/724912): Retire scroll-snap-destination + return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, + Optional<UseCounter::Feature>()); case CSSPropertyObjectPosition: + return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionObjectPosition); case CSSPropertyPerspectiveOrigin: - return ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid); + return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionPerspectiveOrigin); case CSSPropertyWebkitHyphenateCharacter: case CSSPropertyWebkitLocale: return ConsumeLocale(range_); @@ -2614,7 +2620,8 @@ do { CSSValue* position_x = nullptr; CSSValue* position_y = nullptr; - if (!ConsumePosition(range, context->Mode(), unitless, position_x, + if (!ConsumePosition(range, *context, unitless, + UseCounter::kThreeValuedPositionBackground, position_x, position_y)) return false; AddBackgroundValue(result_x, position_x); @@ -2695,7 +2702,8 @@ ConsumeRepeatStyleComponent(range_, value, value_y, implicit); } else if (property == CSSPropertyBackgroundPositionX || property == CSSPropertyWebkitMaskPositionX) { - if (!ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid, + if (!ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionBackground, value, value_y)) continue; } else if (property == CSSPropertyBackgroundSize ||
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp index 47144acf..9b495d1c 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -717,13 +717,14 @@ } bool ConsumePosition(CSSParserTokenRange& range, - CSSParserMode css_parser_mode, + const CSSParserContext& context, UnitlessQuirk unitless, + WTF::Optional<UseCounter::Feature> threeValuePosition, CSSValue*& result_x, CSSValue*& result_y) { bool horizontal_edge = false; bool vertical_edge = false; - CSSValue* value1 = ConsumePositionComponent(range, css_parser_mode, unitless, + CSSValue* value1 = ConsumePositionComponent(range, context.Mode(), unitless, horizontal_edge, vertical_edge); if (!value1) return false; @@ -731,20 +732,21 @@ horizontal_edge = true; CSSParserTokenRange range_after_first_consume = range; - CSSValue* value2 = ConsumePositionComponent(range, css_parser_mode, unitless, + CSSValue* value2 = ConsumePositionComponent(range, context.Mode(), unitless, horizontal_edge, vertical_edge); if (!value2) { PositionFromOneValue(value1, result_x, result_y); return true; } + CSSParserTokenRange range_after_second_consume = range; CSSValue* value3 = nullptr; if (value1->IsIdentifierValue() && value2->IsIdentifierValue() != (range.Peek().GetType() == kIdentToken) && (value2->IsIdentifierValue() ? ToCSSIdentifierValue(value2)->GetValueID() : ToCSSIdentifierValue(value1)->GetValueID()) != CSSValueCenter) - value3 = ConsumePositionComponent(range, css_parser_mode, unitless, + value3 = ConsumePositionComponent(range, context.Mode(), unitless, horizontal_edge, vertical_edge); if (!value3) { if (vertical_edge && !value2->IsIdentifierValue()) { @@ -760,8 +762,24 @@ if (value3->IsIdentifierValue() && ToCSSIdentifierValue(value3)->GetValueID() != CSSValueCenter && range.Peek().GetType() != kIdentToken) - value4 = ConsumePositionComponent(range, css_parser_mode, unitless, + value4 = ConsumePositionComponent(range, context.Mode(), unitless, horizontal_edge, vertical_edge); + + if (!value4) { + if (!threeValuePosition) { + // [top | bottom] <length-percentage> is not permitted + if (vertical_edge && !value2->IsIdentifierValue()) { + range = range_after_first_consume; + PositionFromOneValue(value1, result_x, result_y); + return true; + } + range = range_after_second_consume; + PositionFromTwoValues(value1, value2, result_x, result_y); + return true; + } + context.Count(*threeValuePosition); + } + CSSValue* values[5]; values[0] = value1; values[1] = value2; @@ -772,12 +790,15 @@ return true; } -CSSValuePair* ConsumePosition(CSSParserTokenRange& range, - CSSParserMode css_parser_mode, - UnitlessQuirk unitless) { +CSSValuePair* ConsumePosition( + CSSParserTokenRange& range, + const CSSParserContext& context, + UnitlessQuirk unitless, + WTF::Optional<UseCounter::Feature> threeValuePosition) { CSSValue* result_x = nullptr; CSSValue* result_y = nullptr; - if (ConsumePosition(range, css_parser_mode, unitless, result_x, result_y)) + if (ConsumePosition(range, context, unitless, threeValuePosition, result_x, + result_y)) return CSSValuePair::Create(result_x, result_y, CSSValuePair::kKeepIdenticalValues); return nullptr; @@ -1050,7 +1071,7 @@ } static CSSValue* ConsumeRadialGradient(CSSParserTokenRange& args, - CSSParserMode css_parser_mode, + const CSSParserContext& context, CSSGradientRepeat repeating) { const CSSIdentifierValue* shape = nullptr; const CSSIdentifierValue* size_keyword = nullptr; @@ -1078,13 +1099,13 @@ } } else { CSSPrimitiveValue* center = - ConsumeLengthOrPercent(args, css_parser_mode, kValueRangeAll); + ConsumeLengthOrPercent(args, context.Mode(), kValueRangeAll); if (!center) break; if (horizontal_size) return nullptr; horizontal_size = center; - center = ConsumeLengthOrPercent(args, css_parser_mode, kValueRangeAll); + center = ConsumeLengthOrPercent(args, context.Mode(), kValueRangeAll); if (center) { vertical_size = center; ++i; @@ -1116,7 +1137,8 @@ CSSValue* center_y = nullptr; if (args.Peek().Id() == CSSValueAt) { args.ConsumeIncludingWhitespace(); - ConsumePosition(args, css_parser_mode, UnitlessQuirk::kForbid, center_x, + ConsumePosition(args, context, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionGradient, center_x, center_y); if (!(center_x && center_y)) return nullptr; @@ -1131,7 +1153,7 @@ CSSGradientValue* result = CSSRadialGradientValue::Create( center_x, center_y, shape, size_keyword, horizontal_size, vertical_size, repeating, kCSSRadialGradient); - return ConsumeGradientColorStops(args, css_parser_mode, result, + return ConsumeGradientColorStops(args, context.Mode(), result, ConsumeLengthOrPercent) ? result : nullptr; @@ -1175,7 +1197,7 @@ } static CSSValue* ConsumeConicGradient(CSSParserTokenRange& args, - CSSParserMode css_parser_mode, + const CSSParserContext& context, CSSGradientRepeat repeating) { if (!RuntimeEnabledFeatures::conicGradientEnabled()) return nullptr; @@ -1189,8 +1211,9 @@ CSSValue* center_x = nullptr; CSSValue* center_y = nullptr; if (ConsumeIdent<CSSValueAt>(args)) { - if (!ConsumePosition(args, css_parser_mode, UnitlessQuirk::kForbid, - center_x, center_y)) + if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionGradient, center_x, + center_y)) return nullptr; } @@ -1202,7 +1225,7 @@ CSSGradientValue* result = CSSConicGradientValue::Create(center_x, center_y, from_angle, repeating); - return ConsumeGradientColorStops(args, css_parser_mode, result, + return ConsumeGradientColorStops(args, context.Mode(), result, ConsumeAngleOrPercent) ? result : nullptr; @@ -1291,9 +1314,9 @@ CSSParserTokenRange args = ConsumeFunction(range_copy); CSSValue* result = nullptr; if (id == CSSValueRadialGradient) { - result = ConsumeRadialGradient(args, context->Mode(), kNonRepeating); + result = ConsumeRadialGradient(args, *context, kNonRepeating); } else if (id == CSSValueRepeatingRadialGradient) { - result = ConsumeRadialGradient(args, context->Mode(), kRepeating); + result = ConsumeRadialGradient(args, *context, kRepeating); } else if (id == CSSValueWebkitLinearGradient) { context->Count(UseCounter::kDeprecatedWebKitLinearGradient); result = ConsumeLinearGradient(args, context->Mode(), kNonRepeating, @@ -1319,9 +1342,9 @@ context->Count(UseCounter::kDeprecatedWebKitRepeatingRadialGradient); result = ConsumeDeprecatedRadialGradient(args, context->Mode(), kRepeating); } else if (id == CSSValueConicGradient) { - result = ConsumeConicGradient(args, context->Mode(), kNonRepeating); + result = ConsumeConicGradient(args, *context, kNonRepeating); } else if (id == CSSValueRepeatingConicGradient) { - result = ConsumeConicGradient(args, context->Mode(), kRepeating); + result = ConsumeConicGradient(args, *context, kRepeating); } else if (id == CSSValueWebkitCrossFade) { result = ConsumeCrossFade(args, context); } else if (id == CSSValuePaint) {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h index e1f2a5f..7c3259b 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h
@@ -11,8 +11,10 @@ #include "core/css/CSSValueList.h" #include "core/css/parser/CSSParserMode.h" #include "core/css/parser/CSSParserTokenRange.h" +#include "core/frame/UseCounter.h" #include "platform/Length.h" // For ValueRange #include "platform/heap/Handle.h" +#include "platform/wtf/Optional.h" namespace blink { @@ -77,12 +79,15 @@ CSSValue* ConsumeLineWidth(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk); -CSSValuePair* ConsumePosition(CSSParserTokenRange&, - CSSParserMode, - UnitlessQuirk); +CSSValuePair* ConsumePosition( + CSSParserTokenRange&, + const CSSParserContext&, + UnitlessQuirk, + WTF::Optional<UseCounter::Feature> threeValuePosition); bool ConsumePosition(CSSParserTokenRange&, - CSSParserMode, + const CSSParserContext&, UnitlessQuirk, + WTF::Optional<UseCounter::Feature> threeValuePosition, CSSValue*& result_x, CSSValue*& result_y); bool ConsumeOneOrTwoValuedPosition(CSSParserTokenRange&,
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp index cdf9b4a6..00374dc 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp
@@ -11,15 +11,17 @@ namespace blink { +using namespace CSSPropertyParserHelpers; + const CSSValue* CSSPropertyAPIOffsetAnchor::parseSingleValue( CSSParserTokenRange& range, const CSSParserContext& context, CSSPropertyID) { CSSValueID id = range.Peek().Id(); if (id == CSSValueAuto) - return CSSPropertyParserHelpers::ConsumeIdent(range); - return ConsumePosition(range, context.Mode(), - CSSPropertyParserHelpers::UnitlessQuirk::kForbid); + return ConsumeIdent(range); + return ConsumePosition(range, context, UnitlessQuirk::kForbid, + Optional<UseCounter::Feature>()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp index f3a59be..6aa6214 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp
@@ -11,15 +11,17 @@ namespace blink { +using namespace CSSPropertyParserHelpers; + const CSSValue* CSSPropertyAPIOffsetPosition::parseSingleValue( CSSParserTokenRange& range, const CSSParserContext& context, CSSPropertyID) { CSSValueID id = range.Peek().Id(); if (id == CSSValueAuto) - return CSSPropertyParserHelpers::ConsumeIdent(range); - CSSValue* value = CSSPropertyParserHelpers::ConsumePosition( - range, context.Mode(), CSSPropertyParserHelpers::UnitlessQuirk::kForbid); + return ConsumeIdent(range); + CSSValue* value = ConsumePosition(range, context, UnitlessQuirk::kForbid, + Optional<UseCounter::Feature>()); // Count when we receive a valid position other than 'auto'. if (value && value->IsValuePair())
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp index 9be720b..45e93d5 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp
@@ -9,19 +9,22 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +// TODO(crbug.com/724912): Retire scroll-snap-coordinate + namespace blink { +using namespace CSSPropertyParserHelpers; + static CSSValueList* ConsumePositionList(CSSParserTokenRange& range, - CSSParserMode css_parser_mode) { + const CSSParserContext& context) { CSSValueList* positions = CSSValueList::CreateCommaSeparated(); do { - CSSValue* position = - ConsumePosition(range, css_parser_mode, - CSSPropertyParserHelpers::UnitlessQuirk::kForbid); + CSSValue* position = ConsumePosition(range, context, UnitlessQuirk::kForbid, + Optional<UseCounter::Feature>()); if (!position) return nullptr; positions->Append(*position); - } while (CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(range)); + } while (ConsumeCommaIncludingWhitespace(range)); return positions; } @@ -30,8 +33,8 @@ const CSSParserContext& context, CSSPropertyID) { if (range.Peek().Id() == CSSValueNone) - return CSSPropertyParserHelpers::ConsumeIdent(range); - return ConsumePositionList(range, context.Mode()); + return ConsumeIdent(range); + return ConsumePositionList(range, context); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp index 393a62b..3c3d156 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp
@@ -34,7 +34,8 @@ if (ConsumeIdent<CSSValueAt>(args)) { CSSValue* center_x = nullptr; CSSValue* center_y = nullptr; - if (!ConsumePosition(args, context.Mode(), UnitlessQuirk::kForbid, center_x, + if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionBasicShape, center_x, center_y)) return nullptr; shape->SetCenterX(center_x); @@ -57,7 +58,8 @@ if (ConsumeIdent<CSSValueAt>(args)) { CSSValue* center_x = nullptr; CSSValue* center_y = nullptr; - if (!ConsumePosition(args, context.Mode(), UnitlessQuirk::kForbid, center_x, + if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, + UseCounter::kThreeValuedPositionBasicShape, center_x, center_y)) return nullptr; shape->SetCenterX(center_x);
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 3677190d..079eaaa 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5209,24 +5209,7 @@ } KURL Document::CompleteURL(const String& url) const { - KURL completed = CompleteURLWithOverride(url, base_url_); - - if (completed.WhitespaceRemoved()) { - if (completed.ProtocolIsInHTTPFamily()) { - UseCounter::Count(*this, - UseCounter::kDocumentCompleteURLHTTPContainingNewline); - bool less_than = url.Contains('<'); - if (less_than) { - UseCounter::Count( - *this, - UseCounter::kDocumentCompleteURLHTTPContainingNewlineAndLessThan); - } - } else { - UseCounter::Count( - *this, UseCounter::kDocumentCompleteURLNonHTTPContainingNewline); - } - } - return completed; + return CompleteURLWithOverride(url, base_url_); } KURL Document::CompleteURLWithOverride(const String& url,
diff --git a/third_party/WebKit/Source/core/events/MouseEvent.h b/third_party/WebKit/Source/core/events/MouseEvent.h index 7d948b1..8cfa9b3 100644 --- a/third_party/WebKit/Source/core/events/MouseEvent.h +++ b/third_party/WebKit/Source/core/events/MouseEvent.h
@@ -220,6 +220,8 @@ short RawButton() const { return button_; } + void ReceivedTarget() override; + private: friend class MouseEventDispatchMediator; void InitMouseEventInternal(const AtomicString& type, @@ -239,7 +241,6 @@ void InitCoordinates(const double client_x, const double client_y); void InitCoordinatesFromRootFrame(int window_x, int window_y); - void ReceivedTarget() final; void ComputePageLocation(); void ComputeRelativePosition();
diff --git a/third_party/WebKit/Source/core/events/PointerEvent.cpp b/third_party/WebKit/Source/core/events/PointerEvent.cpp index 0659c50..42d4a76 100644 --- a/third_party/WebKit/Source/core/events/PointerEvent.cpp +++ b/third_party/WebKit/Source/core/events/PointerEvent.cpp
@@ -21,7 +21,8 @@ tilt_y_(0), tangential_pressure_(0), twist_(0), - is_primary_(false) { + is_primary_(false), + coalesced_events_targets_dirty_(false) { if (initializer.hasPointerId()) pointer_id_ = initializer.pointerId(); if (initializer.hasWidth()) @@ -60,7 +61,17 @@ return PointerEventDispatchMediator::Create(this); } -HeapVector<Member<PointerEvent>> PointerEvent::getCoalescedEvents() const { +void PointerEvent::ReceivedTarget() { + coalesced_events_targets_dirty_ = true; + MouseEvent::ReceivedTarget(); +} + +HeapVector<Member<PointerEvent>> PointerEvent::getCoalescedEvents() { + if (coalesced_events_targets_dirty_) { + for (auto coalesced_event : coalesced_events_) + coalesced_event->SetTarget(target()); + coalesced_events_targets_dirty_ = false; + } return coalesced_events_; }
diff --git a/third_party/WebKit/Source/core/events/PointerEvent.h b/third_party/WebKit/Source/core/events/PointerEvent.h index 971f749..1b774cd 100644 --- a/third_party/WebKit/Source/core/events/PointerEvent.h +++ b/third_party/WebKit/Source/core/events/PointerEvent.h
@@ -40,8 +40,9 @@ bool IsPointerEvent() const override; EventDispatchMediator* CreateMediator() override; + void ReceivedTarget() override; - HeapVector<Member<PointerEvent>> getCoalescedEvents() const; + HeapVector<Member<PointerEvent>> getCoalescedEvents(); DECLARE_VIRTUAL_TRACE(); @@ -61,6 +62,8 @@ String pointer_type_; bool is_primary_; + bool coalesced_events_targets_dirty_; + HeapVector<Member<PointerEvent>> coalesced_events_; };
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index 8d7a58d..63c8068 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1380,9 +1380,6 @@ kV8AssigmentExpressionLHSIsCallInStrict = 1765, kV8PromiseConstructorReturnedUndefined = 1766, kFormSubmittedWithUnclosedFormControl = 1767, - kDocumentCompleteURLHTTPContainingNewline = 1768, - kDocumentCompleteURLHTTPContainingNewlineAndLessThan = 1770, - kDocumentCompleteURLNonHTTPContainingNewline = 1771, kScrollbarUseVerticalScrollbarButton = 1777, kScrollbarUseVerticalScrollbarThumb = 1778, kScrollbarUseVerticalScrollbarTrack = 1779, @@ -1519,7 +1516,6 @@ kWebkitCSSMatrixSetMatrixValue = 1912, kWebkitCSSMatrixConstructFromString = 1913, kCanRequestURLHTTPContainingNewline = 1914, - kCanRequestURLNonHTTPContainingNewline = 1915, kGetGamepads = 1916, kV8SVGPathElement_GetPathSegAtLength_Method = 1917, kMediaStreamConstraintsAudio = 1918, @@ -1608,6 +1604,11 @@ kRequestFullscreenForDialogElement = 1998, kRequestFullscreenForDialogElementInTopLayer = 1999, kShowModalForElementInFullscreenStack = 2000, + kThreeValuedPositionBackground = 2001, + kThreeValuedPositionBasicShape = 2002, + kThreeValuedPositionGradient = 2003, + kThreeValuedPositionObjectPosition = 2004, + kThreeValuedPositionPerspectiveOrigin = 2005, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp index bfe8aaf09..1617f67 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -2526,8 +2526,11 @@ for (InlineBox* box = ltr ? root->FirstChild() : root->LastChild(); box; box = ltr ? box->NextOnLine() : box->PrevOnLine()) { if (!box->GetLineLayoutItem().IsAtomicInlineLevel() || - !box->GetLineLayoutItem().IsLayoutBlockFlow()) + !box->GetLineLayoutItem().IsLayoutBlockFlow()) { + if (box->GetLineLayoutItem().IsText()) + logical_left_offset += box->LogicalWidth(); continue; + } RootInlineBox* first_root_box = LineLayoutBlockFlow(box->GetLineLayoutItem()).FirstRootBox();
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp index f955002..a3d2251 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1234,12 +1234,6 @@ return; for (auto* child : *positioned_descendants) { - if (IsOrthogonalChild(*child)) { - // FIXME: Properly support orthogonal writing mode. - LayoutPositionedObject(child, relayout_children, info); - continue; - } - LayoutUnit column_offset = LayoutUnit(); LayoutUnit column_breadth = LayoutUnit(); OffsetAndBreadthForPositionedChild(*child, kForColumns, column_offset, @@ -1260,8 +1254,13 @@ LayoutPositionedObject(child, relayout_children, info); - child->SetLogicalLocation(LayoutPoint(child->LogicalLeft() + column_offset, - child->LogicalTop() + row_offset)); + bool is_orthogonal_child = IsOrthogonalChild(*child); + LayoutUnit logical_left = + child->LogicalLeft() + + (is_orthogonal_child ? row_offset : column_offset); + LayoutUnit logical_top = child->LogicalTop() + + (is_orthogonal_child ? column_offset : row_offset); + child->SetLogicalLocation(LayoutPoint(logical_left, logical_top)); } } @@ -1270,7 +1269,6 @@ GridTrackSizingDirection direction, LayoutUnit& offset, LayoutUnit& breadth) { - DCHECK(!IsOrthogonalChild(child)); bool is_for_columns = direction == kForColumns; GridSpan positions = GridPositionsResolver::ResolveGridPositionsFromStyle(
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp index 2908f01..8b986ed 100644 --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -350,54 +350,6 @@ return FloatRect(); } -void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects, - unsigned start, - unsigned end) const { - // Work around signed/unsigned issues. This function takes unsigneds, and is - // often passed UINT_MAX to mean "all the way to the end". InlineTextBox - // coordinates are unsigneds, so changing this function to take ints causes - // various internal mismatches. But selectionRect takes ints, and passing - // UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take - // unsigneds, but that would cause many ripple effects, so for now we'll just - // clamp our unsigned parameters to INT_MAX. - DCHECK(end == UINT_MAX || end <= INT_MAX); - DCHECK_LE(start, static_cast<unsigned>(INT_MAX)); - start = std::min(start, static_cast<unsigned>(INT_MAX)); - end = std::min(end, static_cast<unsigned>(INT_MAX)); - - // This function is always called in sequence that this check should work. - bool has_checked_box_in_range = !rects.IsEmpty(); - - for (InlineTextBox* box = FirstTextBox(); box; box = box->NextTextBox()) { - // Note: box->end() returns the index of the last character, not the index - // past it - if (start <= box->Start() && box->end() < end) { - FloatRect r(box->FrameRect()); - if (!has_checked_box_in_range) { - has_checked_box_in_range = true; - rects.clear(); - } - rects.push_back(LocalToAbsoluteQuad(r).EnclosingBoundingBox()); - } else if ((box->Start() <= start && start <= box->end()) || - (box->Start() < end && end <= box->end())) { - FloatRect rect = LocalQuadForTextBox(box, start, end); - if (!rect.IsZero()) { - if (!has_checked_box_in_range) { - has_checked_box_in_range = true; - rects.clear(); - } - rects.push_back(LocalToAbsoluteQuad(rect).EnclosingBoundingBox()); - } - } else if (!has_checked_box_in_range) { - // FIXME: This code is wrong. It's converting local to absolute twice. - // http://webkit.org/b/65722 - FloatRect rect = LocalQuadForTextBox(box, start, end); - if (!rect.IsZero()) - rects.push_back(LocalToAbsoluteQuad(rect).EnclosingBoundingBox()); - } - } -} - static IntRect EllipsisRectForBox(InlineTextBox* box, unsigned start_pos, unsigned end_pos) {
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.h b/third_party/WebKit/Source/core/layout/LayoutText.h index 5822287..e5b27c3e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutText.h +++ b/third_party/WebKit/Source/core/layout/LayoutText.h
@@ -99,9 +99,6 @@ void AbsoluteRects(Vector<IntRect>&, const LayoutPoint& accumulated_offset) const final; - void AbsoluteRectsForRange(Vector<IntRect>&, - unsigned start_offset = 0, - unsigned end_offset = INT_MAX) const; void AbsoluteQuads(Vector<FloatQuad>&, MapCoordinatesFlags mode = 0) const final;
diff --git a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp index c469bed..350cb97 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
@@ -402,27 +402,14 @@ if (ltr_ellipsis_within_box || rtl_ellipsis_within_box) { found_box = true; - // The inline box may have different directionality than it's parent. Since - // truncation behavior depends both on both the parent and the inline - // block's directionality, we must keep track of these separately. - bool ltr = IsLeftToRightDirection(); - if (ltr != flow_is_ltr) { - // Width in pixels of the visible portion of the box, excluding the - // ellipsis. - LayoutUnit visible_box_width = - visible_right_edge - visible_left_edge - ellipsis_width; - ellipsis_x = flow_is_ltr ? adjusted_logical_left + visible_box_width - : LogicalRight() - visible_box_width; - } - // OffsetForPosition() expects the position relative to the root box. - if (ltr == flow_is_ltr && !flow_is_ltr && logical_left_offset < 0) - ellipsis_x -= logical_left_offset; + ellipsis_x -= logical_left_offset; // We measure the text using the second half of the previous character and // the first half of the current one when the text is rtl. This gives a // more accurate position in rtl text. // TODO(crbug.com/722043: This doesn't always give the best results. + bool ltr = IsLeftToRightDirection(); int offset = OffsetForPosition(ellipsis_x, !ltr); // Full truncation is only necessary when we're flowing left-to-right. if (flow_is_ltr && offset == 0 && ltr == flow_is_ltr) {
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp index 748ae933..6913d5e 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp
@@ -290,20 +290,16 @@ } // Check for mixed content. We do this second-to-last so that when folks block - // mixed content with a CSP policy, they don't get a warning. They'll still - // get a warning in the console about CSP blocking the load. + // mixed content via CSP, they don't get a mixed content warning, but a CSP + // warning instead. if (ShouldBlockFetchByMixedContentCheck(resource_request, url, reporting_policy)) return ResourceRequestBlockedReason::kMixedContent; - if (url.WhitespaceRemoved()) { + if (url.PotentiallyDanglingMarkup() && url.ProtocolIsInHTTPFamily()) { CountDeprecation(UseCounter::kCanRequestURLHTTPContainingNewline); - if (url.ProtocolIsInHTTPFamily()) { - if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled()) - return ResourceRequestBlockedReason::kOther; - } else { - CountUsage(UseCounter::kCanRequestURLNonHTTPContainingNewline); - } + if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled()) + return ResourceRequestBlockedReason::kOther; } // Let the client have the final say into whether or not the load should
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 88a3709..59606c6a 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1300,16 +1300,12 @@ return kNavigationPolicyCurrentTab; // Check for non-escaped new lines in the url. - if (request.Url().WhitespaceRemoved()) { + if (request.Url().PotentiallyDanglingMarkup() && + request.Url().ProtocolIsInHTTPFamily()) { Deprecation::CountDeprecation( frame_, UseCounter::kCanRequestURLHTTPContainingNewline); - if (request.Url().ProtocolIsInHTTPFamily()) { - if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled()) - return kNavigationPolicyIgnore; - } else { - UseCounter::Count(frame_, - UseCounter::kCanRequestURLNonHTTPContainingNewline); - } + if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled()) + return kNavigationPolicyIgnore; } Settings* settings = frame_->GetSettings();
diff --git a/third_party/WebKit/Source/platform/weborigin/KURL.h b/third_party/WebKit/Source/platform/weborigin/KURL.h index 5479c8e..156659b 100644 --- a/third_party/WebKit/Source/platform/weborigin/KURL.h +++ b/third_party/WebKit/Source/platform/weborigin/KURL.h
@@ -192,7 +192,9 @@ bool IsSafeToSendToAnotherThread() const; - bool WhitespaceRemoved() const { return parsed_.whitespace_removed; } + bool PotentiallyDanglingMarkup() const { + return parsed_.potentially_dangling_markup; + } private: void Init(const KURL& base,
diff --git a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp index 306e485..be834d4 100644 --- a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp +++ b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
@@ -328,8 +328,6 @@ const KURL input(kParsedURLString, test.input); const KURL expected(kParsedURLString, test.expected); EXPECT_EQ(input, expected); - EXPECT_TRUE(input.WhitespaceRemoved()); - EXPECT_FALSE(expected.WhitespaceRemoved()); } } @@ -337,18 +335,12 @@ struct { const char* base; const char* relative; - bool whitespace_removed; } cases[] = { - {"http://example.com/", "/path", false}, - {"http://example.com/", "\n/path", true}, - {"http://example.com/", "\r/path", true}, - {"http://example.com/", "\t/path", true}, - {"http://example.com/", "/pa\nth", true}, - {"http://example.com/", "/pa\rth", true}, - {"http://example.com/", "/pa\tth", true}, - {"http://example.com/", "/path\n", true}, - {"http://example.com/", "/path\r", true}, - {"http://example.com/", "/path\t", true}, + {"http://example.com/", "/path"}, {"http://example.com/", "\n/path"}, + {"http://example.com/", "\r/path"}, {"http://example.com/", "\t/path"}, + {"http://example.com/", "/pa\nth"}, {"http://example.com/", "/pa\rth"}, + {"http://example.com/", "/pa\tth"}, {"http://example.com/", "/path\n"}, + {"http://example.com/", "/path\r"}, {"http://example.com/", "/path\t"}, }; for (const auto& test : cases) { @@ -357,7 +349,96 @@ const KURL expected(kParsedURLString, "http://example.com/path"); const KURL actual(base, test.relative); EXPECT_EQ(actual, expected); - EXPECT_EQ(test.whitespace_removed, actual.WhitespaceRemoved()); + } +} + +TEST(KURLTest, AbsolutePotentiallyDanglingMarkup) { + struct { + const char* input; + const char* expected; + const bool potentially_dangling_markup; + } cases[] = { + // Just removable whitespace isn't enough: + {"ht\ntps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"ht\ttps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"ht\rtps://example.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://exa\nmple.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://exa\tmple.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://exa\rmple.com/yay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/y\nay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/y\tay?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/y\ray?boo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?b\noo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?b\too#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?b\roo#foo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?boo#f\noo", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?boo#f\too", "https://example.com/yay?boo#foo", + false}, + {"https://example.com/yay?boo#f\roo", "https://example.com/yay?boo#foo", + false}, + + // Likewise, just a brace won't cut it: + {"https://example.com/y<ay?boo#foo", "https://example.com/y%3Cay?boo#foo", + false}, + {"https://example.com/yay?b<oo#foo", "https://example.com/yay?b%3Coo#foo", + false}, + {"https://example.com/yay?boo#f<oo", "https://example.com/yay?boo#f<oo", + false}, + + // Both, however: + {"ht\ntps://example.com/y<ay?boo#foo", + "https://example.com/y%3Cay?boo#foo", true}, + {"https://e\nxample.com/y<ay?boo#foo", + "https://example.com/y%3Cay?boo#foo", true}, + {"https://example.com/y<\nay?boo#foo", + "https://example.com/y%3Cay?boo#foo", true}, + {"https://example.com/y<ay?b\noo#foo", + "https://example.com/y%3Cay?boo#foo", true}, + {"https://example.com/y<ay?boo#f\noo", + "https://example.com/y%3Cay?boo#foo", true}, + {"ht\ntps://example.com/yay?b<oo#foo", + "https://example.com/yay?b%3Coo#foo", true}, + {"https://e\nxample.com/yay?b<oo#foo", + "https://example.com/yay?b%3Coo#foo", true}, + {"https://example.com/y\nay?b<oo#foo", + "https://example.com/yay?b%3Coo#foo", true}, + {"https://example.com/yay?b<\noo#foo", + "https://example.com/yay?b%3Coo#foo", true}, + {"https://example.com/yay?b<oo#f\noo", + "https://example.com/yay?b%3Coo#foo", true}, + {"ht\ntps://example.com/yay?boo#f<oo", "https://example.com/yay?boo#f<oo", + true}, + {"https://e\nxample.com/yay?boo#f<oo", "https://example.com/yay?boo#f<oo", + true}, + {"https://example.com/y\nay?boo#f<oo", "https://example.com/yay?boo#f<oo", + true}, + {"https://example.com/yay?b\noo#f<oo", "https://example.com/yay?boo#f<oo", + true}, + {"https://example.com/yay?boo#f<\noo", "https://example.com/yay?boo#f<oo", + true}, + }; + + for (const auto& test : cases) { + SCOPED_TRACE(::testing::Message() << test.input << ", " << test.expected); + const KURL input(KURL(), test.input); + const KURL expected(KURL(), test.expected); + EXPECT_EQ(input, expected) << input.GetString() << expected.GetString(); + EXPECT_EQ(test.potentially_dangling_markup, + input.PotentiallyDanglingMarkup()); + EXPECT_FALSE(expected.PotentiallyDanglingMarkup()); } }
diff --git a/third_party/expat/BUILD.gn b/third_party/expat/BUILD.gn index a2c2d0c..1ae296d 100644 --- a/third_party/expat/BUILD.gn +++ b/third_party/expat/BUILD.gn
@@ -33,6 +33,11 @@ public_configs = [ ":expat_config" ] + # TODO(thakis): Remove this once clang no longer crashes when building + # libexpat with -Oz. + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + defines = [ "_LIB" ] if (is_win) { defines += [ "COMPILED_FROM_DSP" ]
diff --git a/tools/binary_size/diagnose_bloat.py b/tools/binary_size/diagnose_bloat.py index 0bf0e05..8642085 100755 --- a/tools/binary_size/diagnose_bloat.py +++ b/tools/binary_size/diagnose_bloat.py
@@ -612,6 +612,13 @@ def _DownloadAndArchive(gsutil_path, archive, dl_dir, build, supersize_path): + proc = subprocess.Popen([gsutil_path, 'version'], stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + output, _ = proc.communicate() + if proc.returncode: + _Die('gsutil error. Please file a bug in Tools>BinarySize. Output:\n%s', + output) + dl_dst = os.path.join(dl_dir, archive.rev) logging.info('Downloading build artifacts for %s', archive.rev) # gsutil writes stdout and stderr to stderr, so pipe stdout and stderr to
diff --git a/tools/chrome_proxy/webdriver/lite_page.py b/tools/chrome_proxy/webdriver/lite_page.py index 101d563..ff766d0 100644 --- a/tools/chrome_proxy/webdriver/lite_page.py +++ b/tools/chrome_proxy/webdriver/lite_page.py
@@ -14,9 +14,6 @@ # experiment is being used. def testLitePage(self): # If it was attempted to run with another experiment, skip this test. - if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' - in common.ParseFlags().browser_args): - self.skipTest('This test cannot be run with other experiments.') with TestDriver() as test_driver: test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') @@ -32,8 +29,11 @@ continue if response.url.startswith('data:'): continue - self.assertIn('exp=ignore_preview_blacklist', - response.request_headers['chrome-proxy']) + if not common.ParseFlags().browser_args or ( + '--data-reduction-proxy-experiment' not in + common.ParseFlags().browser_args): + self.assertIn('exp=ignore_preview_blacklist', + response.request_headers['chrome-proxy']) if (self.checkLitePageResponse(response)): lite_page_responses = lite_page_responses + 1 @@ -44,9 +44,6 @@ # of the page and is able to load all resources. def testLitePageBTF(self): # If it was attempted to run with another experiment, skip this test. - if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' - in common.ParseFlags().browser_args): - self.skipTest('This test cannot be run with other experiments.') with TestDriver() as test_driver: test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') @@ -64,8 +61,11 @@ continue if response.url.startswith('data:'): continue - self.assertIn('exp=ignore_preview_blacklist', - response.request_headers['chrome-proxy']) + if not common.ParseFlags().browser_args or ( + '--data-reduction-proxy-experiment' not in + common.ParseFlags().browser_args): + self.assertIn('exp=ignore_preview_blacklist', + response.request_headers['chrome-proxy']) if (self.checkLitePageResponse(response)): lite_page_responses = lite_page_responses + 1 self.assertEqual(1, lite_page_responses)
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp index 08572bc..bd0ec38 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp +++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -35,6 +35,8 @@ options_.dump_graph = true; } else if (arg == "warn-unneeded-finalizer") { options_.warn_unneeded_finalizer = true; + } else if (arg == "enable-weak-members-in-unmanaged-classes") { + options_.enable_weak_members_in_unmanaged_classes = true; } else if (arg == "use-chromium-style-naming") { // TODO(dcheng): Remove this once the build no longer passes this flag. } else {
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp index a770f82..e45ccf8 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp +++ b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp
@@ -195,7 +195,7 @@ } { - CheckFieldsVisitor visitor; + CheckFieldsVisitor visitor(options_); if (visitor.ContainsInvalidFields(info)) reporter_.ClassContainsInvalidFields(info, visitor.invalid_fields()); }
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h index 7aee25f..4af8950 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h +++ b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h
@@ -16,6 +16,20 @@ // GarbageCollectedFinalized<> when just GarbageCollected<> will do. bool warn_unneeded_finalizer = false; + // Member<T> fields are only permitted in managed classes, + // something CheckFieldsVisitor verifies, issuing errors if + // found in unmanaged classes. WeakMember<T> should be treated + // the exact same, but CheckFieldsVisitor was missing the case + // for handling the weak member variant until crbug.com/724418. + // + // We've default-enabled the checking for those also now, but do + // offer an opt-out option should enabling the check lead to + // unexpected (but wanted, really) compilation errors while + // rolling out an updated GC plugin version. + // + // TODO(sof): remove this option once safely rolled out. + bool enable_weak_members_in_unmanaged_classes = false; + std::set<std::string> ignored_classes; std::set<std::string> checked_namespaces; std::vector<std::string> ignored_directories;
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp index 05419da..735ec0e8 100644 --- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp +++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
@@ -6,13 +6,10 @@ #include <cassert> -#include "BlinkGCPluginOptions.h" #include "RecordInfo.h" -CheckFieldsVisitor::CheckFieldsVisitor() - : current_(0), - stack_allocated_host_(false) { -} +CheckFieldsVisitor::CheckFieldsVisitor(const BlinkGCPluginOptions& options) + : options_(options), current_(0), stack_allocated_host_(false) {} CheckFieldsVisitor::Errors& CheckFieldsVisitor::invalid_fields() { return invalid_fields_; @@ -34,7 +31,7 @@ return !invalid_fields_.empty(); } -void CheckFieldsVisitor::AtMember(Member* edge) { +void CheckFieldsVisitor::AtMember(Member*) { if (managed_host_) return; // A member is allowed to appear in the context of a root. @@ -47,6 +44,14 @@ invalid_fields_.push_back(std::make_pair(current_, kMemberInUnmanaged)); } +void CheckFieldsVisitor::AtWeakMember(WeakMember*) { + // TODO(sof): remove this once crbug.com/724418's change + // has safely been rolled out. + if (options_.enable_weak_members_in_unmanaged_classes) + return; + AtMember(nullptr); +} + void CheckFieldsVisitor::AtIterator(Iterator* edge) { if (!managed_host_) return;
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h index c6ddd5e..c47f1d4 100644 --- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h +++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h
@@ -7,6 +7,7 @@ #include <vector> +#include "BlinkGCPluginOptions.h" #include "Edge.h" class FieldPoint; @@ -34,20 +35,23 @@ using Errors = std::vector<std::pair<FieldPoint*, Error>>; - CheckFieldsVisitor(); + explicit CheckFieldsVisitor(const BlinkGCPluginOptions&); Errors& invalid_fields(); bool ContainsInvalidFields(RecordInfo* info); - void AtMember(Member* edge) override; - void AtValue(Value* edge) override; - void AtCollection(Collection* edge) override; + void AtMember(Member*) override; + void AtWeakMember(WeakMember*) override; + void AtValue(Value*) override; + void AtCollection(Collection*) override; void AtIterator(Iterator*) override; private: Error InvalidSmartPtr(Edge* ptr); + const BlinkGCPluginOptions& options_; + FieldPoint* current_; bool stack_allocated_host_; bool managed_host_;
diff --git a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.cpp b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.cpp index f182eb11..ed5aa14 100644 --- a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.cpp +++ b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.cpp
@@ -9,6 +9,7 @@ void OffHeapObject::Trace(Visitor* visitor) { visitor->Trace(m_obj); + visitor->Trace(m_weak); } void PartObject::Trace(Visitor* visitor)
diff --git a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.h b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.h index 89357a3..170a8890 100644 --- a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.h +++ b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.h
@@ -16,6 +16,7 @@ void Trace(Visitor*); private: Member<HeapObject> m_obj; // Must not contain Member. + WeakMember<HeapObject> m_weak; // Must not contain WeakMember. Persistent<HeapVector<Member<HeapObject> > > m_objs; // OK };
diff --git a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.txt b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.txt index 9d5f2388..090778a8 100644 --- a/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.txt +++ b/tools/clang/blink_gc_plugin/tests/member_in_offheap_class.txt
@@ -5,13 +5,16 @@ ./member_in_offheap_class.h:18:5: note: [blink-gc] Member field 'm_obj' in unmanaged class declared here: Member<HeapObject> m_obj; // Must not contain Member. ^ -./member_in_offheap_class.h:22:1: warning: [blink-gc] Class 'StackObject' contains invalid fields. +./member_in_offheap_class.h:19:5: note: [blink-gc] Member field 'm_weak' in unmanaged class declared here: + WeakMember<HeapObject> m_weak; // Must not contain WeakMember. + ^ +./member_in_offheap_class.h:23:1: warning: [blink-gc] Class 'StackObject' contains invalid fields. class StackObject { ^ -./member_in_offheap_class.h:26:5: note: [blink-gc] Member field 'm_memberOff' to non-GC managed class declared here: +./member_in_offheap_class.h:27:5: note: [blink-gc] Member field 'm_memberOff' to non-GC managed class declared here: Member<OffHeapObject> m_memberOff; // NOT OK ^ -./member_in_offheap_class.h:27:5: note: [blink-gc] Member field 'm_heapVectorMemberOff' to non-GC managed class declared here: +./member_in_offheap_class.h:28:5: note: [blink-gc] Member field 'm_heapVectorMemberOff' to non-GC managed class declared here: HeapVector<Member<OffHeapObject>> m_heapVectorMemberOff; // NOT OK ^ 2 warnings generated.
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 5f5dc6a..57b624c 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -15016,6 +15016,11 @@ <int value="1998" label="RequestFullscreenForDialogElement"/> <int value="1999" label="RequestFullscreenForDialogElementInTopLayer"/> <int value="2000" label="ShowModalForElementInFullscreenStack"/> + <int value="2001" label="ThreeValuedPositionBackground"/> + <int value="2002" label="ThreeValuedPositionBasicShape"/> + <int value="2003" label="ThreeValuedPositionGradient"/> + <int value="2004" label="ThreeValuedPositionObjectPosition"/> + <int value="2005" label="ThreeValuedPositionPerspectiveOrigin"/> </enum> <enum name="FeedbackSource" type="int"> @@ -21552,6 +21557,7 @@ <int value="-1077752943" label="enable-password-generation"/> <int value="-1075156797" label="enable-brotli"/> <int value="-1075089382" label="enable-physical-web"/> + <int value="-1074107607" label="data-reduction-proxy-experiment"/> <int value="-1073479583" label="ShowArcFilesApp:disabled"/> <int value="-1067635248" label="SpeculativeResourcePrefetching:disabled"/> <int value="-1064733740" label="ui-show-composited-layer-borders"/> @@ -24517,6 +24523,14 @@ <int value="4" label="Persistent sparse histogram active sample overflowed and became negative."/> + <int value="5" + label="Persistent sparse histogram accumulated a negative count."/> + <int value="6" + label="Persistent sparse histogram accumulated a negative count that + caused a negative value."/> + <int value="7" + label="Persistent sparse histogram active sample overflowed during + accumulation and became negative."/> </enum> <enum name="NetCacheState" type="int">
diff --git a/tools/roll_angle.py b/tools/roll_angle.py index b45b48c..83a5cdea 100755 --- a/tools/roll_angle.py +++ b/tools/roll_angle.py
@@ -81,7 +81,6 @@ local_scope = {} var = GClientKeywords.VarImpl({}, local_scope) global_scope = { - 'From': GClientKeywords.FromImpl, 'Var': var.Lookup, 'deps_os': {}, }
diff --git a/tools/roll_swiftshader.py b/tools/roll_swiftshader.py index d24a43a..8e23b82e 100755 --- a/tools/roll_swiftshader.py +++ b/tools/roll_swiftshader.py
@@ -87,7 +87,6 @@ local_scope = {} var = GClientKeywords.VarImpl({}, local_scope) global_scope = { - 'From': GClientKeywords.FromImpl, 'Var': var.Lookup, 'deps_os': {}, }
diff --git a/tools/roll_webgl_conformance.py b/tools/roll_webgl_conformance.py index 7f0bd95..da9a1bda 100755 --- a/tools/roll_webgl_conformance.py +++ b/tools/roll_webgl_conformance.py
@@ -83,7 +83,6 @@ local_scope = {} var = GClientKeywords.VarImpl({}, local_scope) global_scope = { - 'From': GClientKeywords.FromImpl, 'Var': var.Lookup, 'deps_os': {}, }
diff --git a/tools/roll_webrtc.py b/tools/roll_webrtc.py index 7b3386e6..543075f 100755 --- a/tools/roll_webrtc.py +++ b/tools/roll_webrtc.py
@@ -96,7 +96,6 @@ local_scope = {} var = GClientKeywords.VarImpl({}, local_scope) global_scope = { -# 'From': GClientKeywords.FromImpl, 'Var': var.Lookup, 'deps_os': {}, }
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc index 2d9389e5..3935dd5b 100644 --- a/ui/android/delegated_frame_host_android.cc +++ b/ui/android/delegated_frame_host_android.cc
@@ -85,7 +85,10 @@ cc::SurfaceId(frame_sink_id_, local_surface_id), 1.f, frame_size); has_transparent_background_ = root_pass->has_transparent_background; - support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); + DCHECK(result); + content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, !has_transparent_background_); view_->GetLayer()->AddChild(content_layer_);
diff --git a/ui/aura/local/compositor_frame_sink_local.cc b/ui/aura/local/compositor_frame_sink_local.cc index 2aa89b2..a92bca4 100644 --- a/ui/aura/local/compositor_frame_sink_local.cc +++ b/ui/aura/local/compositor_frame_sink_local.cc
@@ -66,20 +66,21 @@ frame.metadata.begin_frame_ack.sequence_number); cc::LocalSurfaceId old_local_surface_id = local_surface_id_; - if (!frame.render_pass_list.empty()) { - const auto& frame_size = frame.render_pass_list.back()->output_rect.size(); - if (frame_size != last_submitted_frame_size_ || - !local_surface_id_.is_valid()) { - last_submitted_frame_size_ = frame_size; - local_surface_id_ = id_allocator_.GenerateId(); - } + const auto& frame_size = frame.render_pass_list.back()->output_rect.size(); + if (frame_size != surface_size_ || + frame.metadata.device_scale_factor != device_scale_factor_ || + !local_surface_id_.is_valid()) { + surface_size_ = frame_size; + device_scale_factor_ = frame.metadata.device_scale_factor; + local_surface_id_ = id_allocator_.GenerateId(); } - support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); + bool result = + support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); + DCHECK(result); if (local_surface_id_ != old_local_surface_id) { surface_changed_callback_.Run( - cc::SurfaceId(frame_sink_id_, local_surface_id_), - last_submitted_frame_size_); + cc::SurfaceId(frame_sink_id_, local_surface_id_), surface_size_); } }
diff --git a/ui/aura/local/compositor_frame_sink_local.h b/ui/aura/local/compositor_frame_sink_local.h index 0be946a4..77e3c29a 100644 --- a/ui/aura/local/compositor_frame_sink_local.h +++ b/ui/aura/local/compositor_frame_sink_local.h
@@ -60,7 +60,8 @@ const cc::FrameSinkId frame_sink_id_; cc::SurfaceManager* const surface_manager_; std::unique_ptr<cc::CompositorFrameSinkSupport> support_; - gfx::Size last_submitted_frame_size_; + gfx::Size surface_size_; + float device_scale_factor_ = 0; cc::LocalSurfaceIdAllocator id_allocator_; cc::LocalSurfaceId local_surface_id_; std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
diff --git a/ui/webui/resources/js/cr/ui/alert_overlay.js b/ui/webui/resources/js/cr/ui/alert_overlay.js index f3962d1..4d2ff81 100644 --- a/ui/webui/resources/js/cr/ui/alert_overlay.js +++ b/ui/webui/resources/js/cr/ui/alert_overlay.js
@@ -35,7 +35,7 @@ okButton.clickCallback = null; cancelButton.clickCallback = null; }); - }; + } /** * Updates the alert overlay with the given message, button titles, and @@ -72,7 +72,7 @@ cancelButton.textContent = opt_cancelTitle; cancelButton.hidden = !opt_cancelTitle; cancelButton.clickCallback = opt_cancelCallback; - }; + } // Export return {initialize: initialize, setValues: setValues};
diff --git a/ui/webui/resources/js/webui_resource_test.js b/ui/webui/resources/js/webui_resource_test.js index 55ce865..b4fadbd 100644 --- a/ui/webui/resources/js/webui_resource_test.js +++ b/ui/webui/resources/js/webui_resource_test.js
@@ -198,7 +198,7 @@ domAutomationController.setAutomationId(1); domAutomationController.send('PENDING'); } - }; + } exports.runTests = runTests; })(this);
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index d3a59de..a20472d 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc
@@ -645,12 +645,26 @@ // Constructor. GURL url_1(" \t ht\ntp://\twww.goo\rgle.com/as\ndf \n "); EXPECT_EQ("http://www.google.com/asdf", url_1.spec()); - EXPECT_TRUE(url_1.parsed_for_possibly_invalid_spec().whitespace_removed); + EXPECT_FALSE( + url_1.parsed_for_possibly_invalid_spec().potentially_dangling_markup); // Relative path resolver. GURL url_2 = url_1.Resolve(" \n /fo\to\r "); EXPECT_EQ("http://www.google.com/foo", url_2.spec()); - EXPECT_TRUE(url_2.parsed_for_possibly_invalid_spec().whitespace_removed); + EXPECT_FALSE( + url_2.parsed_for_possibly_invalid_spec().potentially_dangling_markup); + + // Constructor. + GURL url_3(" \t ht\ntp://\twww.goo\rgle.com/as\ndf< \n "); + EXPECT_EQ("http://www.google.com/asdf%3C", url_3.spec()); + EXPECT_TRUE( + url_3.parsed_for_possibly_invalid_spec().potentially_dangling_markup); + + // Relative path resolver. + GURL url_4 = url_1.Resolve(" \n /fo\to<\r "); + EXPECT_EQ("http://www.google.com/foo%3C", url_4.spec()); + EXPECT_TRUE( + url_4.parsed_for_possibly_invalid_spec().potentially_dangling_markup); // Note that newlines are NOT stripped from ReplaceComponents. }
diff --git a/url/third_party/mozilla/url_parse.cc b/url/third_party/mozilla/url_parse.cc index 1c1f3dd..f70f9fb 100644 --- a/url/third_party/mozilla/url_parse.cc +++ b/url/third_party/mozilla/url_parse.cc
@@ -690,7 +690,7 @@ } // namespace -Parsed::Parsed() : whitespace_removed(false), inner_parsed_(NULL) {} +Parsed::Parsed() : potentially_dangling_markup(false), inner_parsed_(NULL) {} Parsed::Parsed(const Parsed& other) : scheme(other.scheme), @@ -701,7 +701,7 @@ path(other.path), query(other.query), ref(other.ref), - whitespace_removed(other.whitespace_removed), + potentially_dangling_markup(other.potentially_dangling_markup), inner_parsed_(NULL) { if (other.inner_parsed_) set_inner_parsed(*other.inner_parsed_); @@ -717,7 +717,7 @@ path = other.path; query = other.query; ref = other.ref; - whitespace_removed = other.whitespace_removed; + potentially_dangling_markup = other.potentially_dangling_markup; if (other.inner_parsed_) set_inner_parsed(*other.inner_parsed_); else
diff --git a/url/third_party/mozilla/url_parse.h b/url/third_party/mozilla/url_parse.h index 968578ba..6d40d3f 100644 --- a/url/third_party/mozilla/url_parse.h +++ b/url/third_party/mozilla/url_parse.h
@@ -177,8 +177,12 @@ // the string with the scheme stripped off. Component GetContent() const; - // True if whitespace was removed from the URL during parsing. - bool whitespace_removed; + // True if the URL's source contained a raw `<` character, and whitespace was + // removed from the URL during parsing + // + // TODO(mkwst): Link this to something in a spec if + // https://github.com/whatwg/url/pull/284 lands. + bool potentially_dangling_markup; // This is used for nested URL types, currently only filesystem. If you // parse a filesystem URL, the resulting Parsed will have a nested
diff --git a/url/url_canon.h b/url/url_canon.h index d093f359..887150b0 100644 --- a/url/url_canon.h +++ b/url/url_canon.h
@@ -231,14 +231,21 @@ // // Therefore, callers should not use the buffer, since it may actually be empty, // use the computed pointer and |*output_len| instead. -URL_EXPORT const char* RemoveURLWhitespace(const char* input, int input_len, +// +// If |input| contained both removable whitespace and a raw `<` character, +// |potentially_dangling_markup| will be set to `true`. Otherwise, it will be +// left untouched. +URL_EXPORT const char* RemoveURLWhitespace(const char* input, + int input_len, CanonOutputT<char>* buffer, - int* output_len); + int* output_len, + bool* potentially_dangling_markup); URL_EXPORT const base::char16* RemoveURLWhitespace( const base::char16* input, int input_len, CanonOutputT<base::char16>* buffer, - int* output_len); + int* output_len, + bool* potentially_dangling_markup); // IDN ------------------------------------------------------------------------
diff --git a/url/url_canon_etc.cc b/url/url_canon_etc.cc index 9dd40da1..31e9fb5 100644 --- a/url/url_canon_etc.cc +++ b/url/url_canon_etc.cc
@@ -22,10 +22,12 @@ // Backend for RemoveURLWhitespace (see declaration in url_canon.h). // It sucks that we have to do this, since this takes about 13% of the total URL // canonicalization time. -template<typename CHAR> -const CHAR* DoRemoveURLWhitespace(const CHAR* input, int input_len, +template <typename CHAR> +const CHAR* DoRemoveURLWhitespace(const CHAR* input, + int input_len, CanonOutputT<CHAR>* buffer, - int* output_len) { + int* output_len, + bool* potentially_dangling_markup) { // Fast verification that there's nothing that needs removal. This is the 99% // case, so we want it to be fast and don't care about impacting the speed // when we do find whitespace. @@ -46,8 +48,11 @@ // Remove the whitespace into the new buffer and return it. for (int i = 0; i < input_len; i++) { - if (!IsRemovableURLWhitespace(input[i])) + if (!IsRemovableURLWhitespace(input[i])) { + if (potentially_dangling_markup && input[i] == 0x3C) + *potentially_dangling_markup = true; buffer->push_back(input[i]); + } } *output_len = buffer->length(); return buffer->data(); @@ -274,17 +279,22 @@ } // namespace -const char* RemoveURLWhitespace(const char* input, int input_len, +const char* RemoveURLWhitespace(const char* input, + int input_len, CanonOutputT<char>* buffer, - int* output_len) { - return DoRemoveURLWhitespace(input, input_len, buffer, output_len); + int* output_len, + bool* potentially_dangling_markup) { + return DoRemoveURLWhitespace(input, input_len, buffer, output_len, + potentially_dangling_markup); } const base::char16* RemoveURLWhitespace(const base::char16* input, int input_len, CanonOutputT<base::char16>* buffer, - int* output_len) { - return DoRemoveURLWhitespace(input, input_len, buffer, output_len); + int* output_len, + bool* potentially_dangling_markup) { + return DoRemoveURLWhitespace(input, input_len, buffer, output_len, + potentially_dangling_markup); } char CanonicalSchemeChar(base::char16 ch) {
diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc index 2ee61db..659aca7f 100644 --- a/url/url_canon_relative.cc +++ b/url/url_canon_relative.cc
@@ -443,11 +443,11 @@ Parsed* out_parsed) { // |base_parsed| is the starting point for our output. Since we may have // removed whitespace from |relative_url| before entering this method, we'll - // carry over the |whitespace_removed| flag. - bool whitespace_removed = out_parsed->whitespace_removed; + // carry over the |potentially_dangling_markup| flag. + bool potentially_dangling_markup = out_parsed->potentially_dangling_markup; *out_parsed = base_parsed; - if (whitespace_removed) - out_parsed->whitespace_removed = true; + if (potentially_dangling_markup) + out_parsed->potentially_dangling_markup = true; // Sanity check: the input should have a host or we'll break badly below. // We can only resolve relative URLs with base URLs that have hosts and
diff --git a/url/url_util.cc b/url/url_util.cc index a17ec4d..c026453b 100644 --- a/url/url_util.cc +++ b/url/url_util.cc
@@ -185,8 +185,8 @@ // This matches the canonicalization done in DoCanonicalize function. RawCanonOutputT<CHAR> whitespace_buffer; int spec_len; - const CHAR* spec = RemoveURLWhitespace(str, str_len, - &whitespace_buffer, &spec_len); + const CHAR* spec = + RemoveURLWhitespace(str, str_len, &whitespace_buffer, &spec_len, nullptr); Component our_scheme; if (!ExtractScheme(spec, spec_len, &our_scheme)) { @@ -214,11 +214,8 @@ // Possibly this will result in copying to the new buffer. RawCanonOutputT<CHAR> whitespace_buffer; if (whitespace_policy == REMOVE_WHITESPACE) { - int original_len = spec_len; - spec = - RemoveURLWhitespace(spec, original_len, &whitespace_buffer, &spec_len); - if (spec_len != original_len) - output_parsed->whitespace_removed = true; + spec = RemoveURLWhitespace(spec, spec_len, &whitespace_buffer, &spec_len, + &output_parsed->potentially_dangling_markup); } Parsed parsed_input; @@ -296,11 +293,9 @@ // copying to the new buffer. RawCanonOutputT<CHAR> whitespace_buffer; int relative_length; - const CHAR* relative = RemoveURLWhitespace(in_relative, in_relative_length, - &whitespace_buffer, - &relative_length); - if (in_relative_length != relative_length) - output_parsed->whitespace_removed = true; + const CHAR* relative = RemoveURLWhitespace( + in_relative, in_relative_length, &whitespace_buffer, &relative_length, + &output_parsed->potentially_dangling_markup); bool base_is_authority_based = false; bool base_is_hierarchical = false;
diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc index 9c3606c..d6746cc0 100644 --- a/url/url_util_unittest.cc +++ b/url/url_util_unittest.cc
@@ -374,23 +374,32 @@ EXPECT_FALSE(resolved_parsed.ref.is_valid()); } -TEST(URLUtilTest, RelativeWhitespaceRemoved) { +TEST(URLUtilTest, PotentiallyDanglingMarkup) { struct ResolveRelativeCase { const char* base; const char* rel; - bool whitespace_removed; + bool potentially_dangling_markup; const char* out; } cases[] = { - {"https://example.com/", "/path", false, "https://example.com/path"}, - {"https://example.com/", "\n/path", true, "https://example.com/path"}, - {"https://example.com/", "\r/path", true, "https://example.com/path"}, - {"https://example.com/", "\t/path", true, "https://example.com/path"}, - {"https://example.com/", "/pa\nth", true, "https://example.com/path"}, - {"https://example.com/", "/pa\rth", true, "https://example.com/path"}, - {"https://example.com/", "/pa\tth", true, "https://example.com/path"}, - {"https://example.com/", "/path\n", true, "https://example.com/path"}, - {"https://example.com/", "/path\r", true, "https://example.com/path"}, - {"https://example.com/", "/path\r", true, "https://example.com/path"}, + {"https://example.com/", "/path<", false, "https://example.com/path%3C"}, + {"https://example.com/", "\n/path<", true, "https://example.com/path%3C"}, + {"https://example.com/", "\r/path<", true, "https://example.com/path%3C"}, + {"https://example.com/", "\t/path<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/pa\nth<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/pa\rth<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/pa\tth<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/path\n<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/path\r<", true, "https://example.com/path%3C"}, + {"https://example.com/", "/path\r<", true, "https://example.com/path%3C"}, + {"https://example.com/", "\n/<path", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "\r/<path", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "\t/<path", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<pa\nth", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<pa\rth", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<pa\tth", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<path\n", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<path\r", true, "https://example.com/%3Cpath"}, + {"https://example.com/", "/<path\r", true, "https://example.com/%3Cpath"}, }; for (const auto& test : cases) { @@ -407,7 +416,8 @@ ASSERT_TRUE(valid); output.Complete(); - EXPECT_EQ(test.whitespace_removed, resolved_parsed.whitespace_removed); + EXPECT_EQ(test.potentially_dangling_markup, + resolved_parsed.potentially_dangling_markup); EXPECT_EQ(test.out, resolved); } }