diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/views/view_targeter_unittest.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/views/view_targeter_unittest.cc')
-rw-r--r-- | chromium/ui/views/view_targeter_unittest.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/chromium/ui/views/view_targeter_unittest.cc b/chromium/ui/views/view_targeter_unittest.cc index edae0b1b093..f2994f9a157 100644 --- a/chromium/ui/views/view_targeter_unittest.cc +++ b/chromium/ui/views/view_targeter_unittest.cc @@ -128,11 +128,10 @@ TEST_F(ViewTargeterTest, ViewTargeterForKeyEvents) { widget.Init(std::move(init_params)); widget.Show(); - View* content = new View; View* child = new View; View* grandchild = new View; - widget.SetContentsView(content); + View* content = widget.SetContentsView(std::make_unique<View>()); content->AddChildView(child); child->AddChildView(grandchild); @@ -174,14 +173,14 @@ TEST_F(ViewTargeterTest, ViewTargeterForScrollEvents) { widget.Init(std::move(init_params)); // The coordinates used for SetBounds() are in the parent coordinate space. - View* content = new View; - content->SetBounds(0, 0, 100, 100); + auto owning_content = std::make_unique<View>(); + owning_content->SetBounds(0, 0, 100, 100); View* child = new View; child->SetBounds(50, 50, 20, 20); View* grandchild = new View; grandchild->SetBounds(0, 0, 5, 5); - widget.SetContentsView(content); + View* content = widget.SetContentsView(std::move(owning_content)); content->AddChildView(child); child->AddChildView(grandchild); @@ -245,14 +244,13 @@ TEST_F(ViewTargeterTest, ViewTargeterForGestureEvents) { widget.Init(std::move(init_params)); // The coordinates used for SetBounds() are in the parent coordinate space. - View* content = new View; - content->SetBounds(0, 0, 100, 100); View* child = new View; child->SetBounds(50, 50, 20, 20); View* grandchild = new View; grandchild->SetBounds(0, 0, 5, 5); - widget.SetContentsView(content); + View* content = widget.SetContentsView(std::make_unique<View>()); + content->SetBounds(0, 0, 100, 100); content->AddChildView(child); child->AddChildView(grandchild); @@ -355,9 +353,9 @@ TEST_F(ViewTargeterTest, TargetContentsAndRootView) { widget.Init(std::move(init_params)); // The coordinates used for SetBounds() are in the parent coordinate space. - View* content = new View; - content->SetBounds(0, 0, 100, 100); - widget.SetContentsView(content); + auto owning_content = std::make_unique<View>(); + owning_content->SetBounds(0, 0, 100, 100); + View* content = widget.SetContentsView(std::move(owning_content)); internal::RootView* root_view = static_cast<internal::RootView*>(widget.GetRootView()); @@ -437,8 +435,6 @@ TEST_F(ViewTargeterTest, GestureEventCoordinateConversion) { widget.Init(std::move(init_params)); // The coordinates used for SetBounds() are in the parent coordinate space. - View* content = new View; - content->SetBounds(0, 0, 100, 100); View* child = new View; child->SetBounds(50, 50, 20, 20); View* grandchild = new View; @@ -446,7 +442,8 @@ TEST_F(ViewTargeterTest, GestureEventCoordinateConversion) { View* great_grandchild = new View; great_grandchild->SetBounds(3, 3, 4, 4); - widget.SetContentsView(content); + View* content = widget.SetContentsView(std::make_unique<View>()); + content->SetBounds(0, 0, 100, 100); content->AddChildView(child); child->AddChildView(grandchild); grandchild->AddChildView(great_grandchild); |