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

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: Rename Have->Has add browsertest 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
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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kTouch, EventListenerProperties::kBlocking);
1500 layer_tree_host()->SetEventListenerProperties(
1501 EventListenerClass::kTouchEndOrCancel,
1502 EventListenerProperties::kBlockingAndPassive);
1500 layer_tree_host()->SetHaveScrollEventHandlers(true); 1503 layer_tree_host()->SetHaveScrollEventHandlers(true);
1501 1504
1502 PostSetNeedsCommitToMainThread(); 1505 PostSetNeedsCommitToMainThread();
1503 } 1506 }
1504 1507
1505 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { 1508 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
1506 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); 1509 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize());
1507 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); 1510 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color());
1508 EXPECT_EQ(EventListenerProperties::kPassive, 1511 EXPECT_EQ(EventListenerProperties::kPassive,
1509 impl->active_tree()->event_listener_properties( 1512 impl->active_tree()->event_listener_properties(
1510 EventListenerClass::kMouseWheel)); 1513 EventListenerClass::kMouseWheel));
1511 EXPECT_EQ(EventListenerProperties::kBlocking, 1514 EXPECT_EQ(EventListenerProperties::kBlocking,
1512 impl->active_tree()->event_listener_properties( 1515 impl->active_tree()->event_listener_properties(
1513 EventListenerClass::kTouch)); 1516 EventListenerClass::kTouch));
1517 EXPECT_EQ(EventListenerProperties::kBlockingAndPassive,
1518 impl->active_tree()->event_listener_properties(
1519 EventListenerClass::kTouchEndOrCancel));
1514 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); 1520 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers());
1515 1521
1516 EndTest(); 1522 EndTest();
1517 } 1523 }
1518 1524
1519 void AfterTest() override {} 1525 void AfterTest() override {}
1520 }; 1526 };
1521 1527
1522 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); 1528 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
1523 1529
(...skipping 4936 matching lines...) Expand 10 before | Expand all | Expand 10 after
6460 EndTest(); 6466 EndTest();
6461 } 6467 }
6462 6468
6463 void AfterTest() override {} 6469 void AfterTest() override {}
6464 }; 6470 };
6465 6471
6466 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6472 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6467 6473
6468 } // namespace 6474 } // namespace
6469 } // namespace cc 6475 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698