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

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

Issue 1884863003: Non passive touch end or touch cancel listeners should not block scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove API from ChromeClient 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 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 class LayerTreeHostTestCommit : public LayerTreeHostTest { 1489 class LayerTreeHostTestCommit : public LayerTreeHostTest {
1490 public: 1490 public:
1491 LayerTreeHostTestCommit() {} 1491 LayerTreeHostTestCommit() {}
1492 1492
1493 void BeginTest() override { 1493 void BeginTest() override {
1494 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); 1494 layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
1495 layer_tree_host()->set_background_color(SK_ColorGRAY); 1495 layer_tree_host()->set_background_color(SK_ColorGRAY);
1496 layer_tree_host()->SetEventListenerProperties( 1496 layer_tree_host()->SetEventListenerProperties(
1497 EventListenerClass::kMouseWheel, EventListenerProperties::kPassive); 1497 EventListenerClass::kMouseWheel, EventListenerProperties::kPassive);
1498 layer_tree_host()->SetEventListenerProperties( 1498 layer_tree_host()->SetEventListenerProperties(
1499 EventListenerClass::kTouch, EventListenerProperties::kBlocking); 1499 EventListenerClass::kTouchStartOrMove,
1500 EventListenerProperties::kBlocking);
1501 layer_tree_host()->SetEventListenerProperties(
1502 EventListenerClass::kTouchEndOrCancel,
1503 EventListenerProperties::kBlockingAndPassive);
1500 layer_tree_host()->SetHaveScrollEventHandlers(true); 1504 layer_tree_host()->SetHaveScrollEventHandlers(true);
1501 1505
1502 PostSetNeedsCommitToMainThread(); 1506 PostSetNeedsCommitToMainThread();
1503 } 1507 }
1504 1508
1505 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { 1509 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
1506 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); 1510 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize());
1507 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); 1511 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color());
1508 EXPECT_EQ(EventListenerProperties::kPassive, 1512 EXPECT_EQ(EventListenerProperties::kPassive,
1509 impl->active_tree()->event_listener_properties( 1513 impl->active_tree()->event_listener_properties(
1510 EventListenerClass::kMouseWheel)); 1514 EventListenerClass::kMouseWheel));
1511 EXPECT_EQ(EventListenerProperties::kBlocking, 1515 EXPECT_EQ(EventListenerProperties::kBlocking,
1512 impl->active_tree()->event_listener_properties( 1516 impl->active_tree()->event_listener_properties(
1513 EventListenerClass::kTouch)); 1517 EventListenerClass::kTouchStartOrMove));
1518 EXPECT_EQ(EventListenerProperties::kBlockingAndPassive,
1519 impl->active_tree()->event_listener_properties(
1520 EventListenerClass::kTouchEndOrCancel));
1514 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); 1521 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers());
1515 1522
1516 EndTest(); 1523 EndTest();
1517 } 1524 }
1518 1525
1519 void AfterTest() override {} 1526 void AfterTest() override {}
1520 }; 1527 };
1521 1528
1522 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); 1529 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
1523 1530
(...skipping 4936 matching lines...) Expand 10 before | Expand all | Expand 10 after
6460 EndTest(); 6467 EndTest();
6461 } 6468 }
6462 6469
6463 void AfterTest() override {} 6470 void AfterTest() override {}
6464 }; 6471 };
6465 6472
6466 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6473 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6467 6474
6468 } // namespace 6475 } // namespace
6469 } // namespace cc 6476 } // 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