Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1895303007: Non passive touch end or touch cancel listeners should not block scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 class LayerTreeHostTestCommit : public LayerTreeHostTest { 1488 class LayerTreeHostTestCommit : public LayerTreeHostTest {
1489 public: 1489 public:
1490 LayerTreeHostTestCommit() {} 1490 LayerTreeHostTestCommit() {}
1491 1491
1492 void BeginTest() override { 1492 void BeginTest() override {
1493 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); 1493 layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
1494 layer_tree_host()->set_background_color(SK_ColorGRAY); 1494 layer_tree_host()->set_background_color(SK_ColorGRAY);
1495 layer_tree_host()->SetEventListenerProperties( 1495 layer_tree_host()->SetEventListenerProperties(
1496 EventListenerClass::kMouseWheel, EventListenerProperties::kPassive); 1496 EventListenerClass::kMouseWheel, EventListenerProperties::kPassive);
1497 layer_tree_host()->SetEventListenerProperties( 1497 layer_tree_host()->SetEventListenerProperties(
1498 EventListenerClass::kTouch, EventListenerProperties::kBlocking); 1498 EventListenerClass::kTouchStartOrMove,
1499 EventListenerProperties::kBlocking);
1500 layer_tree_host()->SetEventListenerProperties(
1501 EventListenerClass::kTouchEndOrCancel,
1502 EventListenerProperties::kBlockingAndPassive);
1499 layer_tree_host()->SetHaveScrollEventHandlers(true); 1503 layer_tree_host()->SetHaveScrollEventHandlers(true);
1500 1504
1501 PostSetNeedsCommitToMainThread(); 1505 PostSetNeedsCommitToMainThread();
1502 } 1506 }
1503 1507
1504 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { 1508 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
1505 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); 1509 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize());
1506 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); 1510 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color());
1507 EXPECT_EQ(EventListenerProperties::kPassive, 1511 EXPECT_EQ(EventListenerProperties::kPassive,
1508 impl->active_tree()->event_listener_properties( 1512 impl->active_tree()->event_listener_properties(
1509 EventListenerClass::kMouseWheel)); 1513 EventListenerClass::kMouseWheel));
1510 EXPECT_EQ(EventListenerProperties::kBlocking, 1514 EXPECT_EQ(EventListenerProperties::kBlocking,
1511 impl->active_tree()->event_listener_properties( 1515 impl->active_tree()->event_listener_properties(
1512 EventListenerClass::kTouch)); 1516 EventListenerClass::kTouchStartOrMove));
1517 EXPECT_EQ(EventListenerProperties::kBlockingAndPassive,
1518 impl->active_tree()->event_listener_properties(
1519 EventListenerClass::kTouchEndOrCancel));
1513 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); 1520 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers());
1514 1521
1515 EndTest(); 1522 EndTest();
1516 } 1523 }
1517 1524
1518 void AfterTest() override {} 1525 void AfterTest() override {}
1519 }; 1526 };
1520 1527
1521 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); 1528 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
1522 1529
(...skipping 5095 matching lines...) Expand 10 before | Expand all | Expand 10 after
6618 EndTest(); 6625 EndTest();
6619 } 6626 }
6620 6627
6621 void AfterTest() override {} 6628 void AfterTest() override {}
6622 }; 6629 };
6623 6630
6624 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6631 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6625 6632
6626 } // namespace 6633 } // namespace
6627 } // namespace cc 6634 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698