OLD | NEW |
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 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1326 |
1327 // This test verifies that properties on the layer tree host are commited | 1327 // This test verifies that properties on the layer tree host are commited |
1328 // to the impl side. | 1328 // to the impl side. |
1329 class LayerTreeHostTestCommit : public LayerTreeHostTest { | 1329 class LayerTreeHostTestCommit : public LayerTreeHostTest { |
1330 public: | 1330 public: |
1331 LayerTreeHostTestCommit() {} | 1331 LayerTreeHostTestCommit() {} |
1332 | 1332 |
1333 void BeginTest() override { | 1333 void BeginTest() override { |
1334 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); | 1334 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); |
1335 layer_tree_host()->set_background_color(SK_ColorGRAY); | 1335 layer_tree_host()->set_background_color(SK_ColorGRAY); |
1336 layer_tree_host()->SetHaveWheelEventHandlers(true); | 1336 layer_tree_host()->SetEventListenerProperties( |
| 1337 EventListenerClass::kMouseWheel, EventListenerProperties::kPassive); |
| 1338 layer_tree_host()->SetEventListenerProperties( |
| 1339 EventListenerClass::kTouch, EventListenerProperties::kBlocking); |
1337 layer_tree_host()->SetHaveScrollEventHandlers(true); | 1340 layer_tree_host()->SetHaveScrollEventHandlers(true); |
1338 | 1341 |
1339 PostSetNeedsCommitToMainThread(); | 1342 PostSetNeedsCommitToMainThread(); |
1340 } | 1343 } |
1341 | 1344 |
1342 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 1345 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
1343 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); | 1346 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); |
1344 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); | 1347 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); |
1345 EXPECT_TRUE(impl->active_tree()->have_wheel_event_handlers()); | 1348 EXPECT_EQ(EventListenerProperties::kPassive, |
| 1349 impl->active_tree()->event_listener_properties( |
| 1350 EventListenerClass::kMouseWheel)); |
| 1351 EXPECT_EQ(EventListenerProperties::kBlocking, |
| 1352 impl->active_tree()->event_listener_properties( |
| 1353 EventListenerClass::kTouch)); |
1346 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); | 1354 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); |
1347 | 1355 |
1348 EndTest(); | 1356 EndTest(); |
1349 } | 1357 } |
1350 | 1358 |
1351 void AfterTest() override {} | 1359 void AfterTest() override {} |
1352 }; | 1360 }; |
1353 | 1361 |
1354 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); | 1362 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); |
1355 | 1363 |
(...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6596 EndTest(); | 6604 EndTest(); |
6597 } | 6605 } |
6598 | 6606 |
6599 void AfterTest() override {} | 6607 void AfterTest() override {} |
6600 }; | 6608 }; |
6601 | 6609 |
6602 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6610 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
6603 | 6611 |
6604 } // namespace | 6612 } // namespace |
6605 } // namespace cc | 6613 } // namespace cc |
OLD | NEW |