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, |
| 1340 EventListenerProperties::kBlocking | EventListenerProperties::kPassive); |
1337 layer_tree_host()->SetHaveScrollEventHandlers(true); | 1341 layer_tree_host()->SetHaveScrollEventHandlers(true); |
1338 | 1342 |
1339 PostSetNeedsCommitToMainThread(); | 1343 PostSetNeedsCommitToMainThread(); |
1340 } | 1344 } |
1341 | 1345 |
1342 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 1346 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
1343 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); | 1347 EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); |
1344 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); | 1348 EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); |
1345 EXPECT_TRUE(impl->active_tree()->have_wheel_event_handlers()); | 1349 EXPECT_EQ(EventListenerProperties::kPassive, |
| 1350 impl->active_tree()->event_listener_properties( |
| 1351 EventListenerClass::kMouseWheel)); |
| 1352 EXPECT_EQ( |
| 1353 EventListenerProperties::kBlocking | EventListenerProperties::kPassive, |
| 1354 impl->active_tree()->event_listener_properties( |
| 1355 EventListenerClass::kTouch)); |
1346 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); | 1356 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); |
1347 | 1357 |
1348 EndTest(); | 1358 EndTest(); |
1349 } | 1359 } |
1350 | 1360 |
1351 void AfterTest() override {} | 1361 void AfterTest() override {} |
1352 }; | 1362 }; |
1353 | 1363 |
1354 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); | 1364 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); |
1355 | 1365 |
(...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6596 EndTest(); | 6606 EndTest(); |
6597 } | 6607 } |
6598 | 6608 |
6599 void AfterTest() override {} | 6609 void AfterTest() override {} |
6600 }; | 6610 }; |
6601 | 6611 |
6602 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6612 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
6603 | 6613 |
6604 } // namespace | 6614 } // namespace |
6605 } // namespace cc | 6615 } // namespace cc |
OLD | NEW |