OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 EXPECT_TRUE(constraint.is_anchored_top && constraint.is_anchored_left && | 367 EXPECT_TRUE(constraint.is_anchored_top && constraint.is_anchored_left && |
368 !constraint.is_anchored_right && | 368 !constraint.is_anchored_right && |
369 !constraint.is_anchored_bottom); | 369 !constraint.is_anchored_bottom); |
370 EXPECT_EQ(1.f, constraint.top_offset); | 370 EXPECT_EQ(1.f, constraint.top_offset); |
371 EXPECT_EQ(1.f, constraint.left_offset); | 371 EXPECT_EQ(1.f, constraint.left_offset); |
372 EXPECT_EQ(IntRect(100, 100, 10, 10), | 372 EXPECT_EQ(IntRect(100, 100, 10, 10), |
373 IntRect(constraint.scroll_container_relative_sticky_box_rect)); | 373 IntRect(constraint.scroll_container_relative_sticky_box_rect)); |
374 EXPECT_EQ( | 374 EXPECT_EQ( |
375 IntRect(100, 100, 200, 200), | 375 IntRect(100, 100, 200, 200), |
376 IntRect(constraint.scroll_container_relative_containing_block_rect)); | 376 IntRect(constraint.scroll_container_relative_containing_block_rect)); |
377 EXPECT_EQ(IntPoint(100, 100), | |
378 IntPoint(constraint.parent_relative_sticky_box_offset)); | |
379 } | 377 } |
380 { | 378 { |
381 Element* element = document->getElementById("div-tr"); | 379 Element* element = document->getElementById("div-tr"); |
382 ASSERT_TRUE(element); | 380 ASSERT_TRUE(element); |
383 WebLayer* layer = WebLayerFromElement(element); | 381 WebLayer* layer = WebLayerFromElement(element); |
384 ASSERT_TRUE(layer); | 382 ASSERT_TRUE(layer); |
385 WebLayerStickyPositionConstraint constraint = | 383 WebLayerStickyPositionConstraint constraint = |
386 layer->StickyPositionConstraint(); | 384 layer->StickyPositionConstraint(); |
387 ASSERT_TRUE(constraint.is_sticky); | 385 ASSERT_TRUE(constraint.is_sticky); |
388 EXPECT_TRUE(constraint.is_anchored_top && !constraint.is_anchored_left && | 386 EXPECT_TRUE(constraint.is_anchored_top && !constraint.is_anchored_left && |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 ASSERT_TRUE(layer); | 442 ASSERT_TRUE(layer); |
445 WebLayerStickyPositionConstraint constraint = | 443 WebLayerStickyPositionConstraint constraint = |
446 layer->StickyPositionConstraint(); | 444 layer->StickyPositionConstraint(); |
447 ASSERT_TRUE(constraint.is_sticky); | 445 ASSERT_TRUE(constraint.is_sticky); |
448 EXPECT_TRUE(constraint.is_anchored_top); | 446 EXPECT_TRUE(constraint.is_anchored_top); |
449 EXPECT_EQ(IntRect(100, 110, 10, 10), | 447 EXPECT_EQ(IntRect(100, 110, 10, 10), |
450 IntRect(constraint.scroll_container_relative_sticky_box_rect)); | 448 IntRect(constraint.scroll_container_relative_sticky_box_rect)); |
451 EXPECT_EQ( | 449 EXPECT_EQ( |
452 IntRect(100, 100, 200, 200), | 450 IntRect(100, 100, 200, 200), |
453 IntRect(constraint.scroll_container_relative_containing_block_rect)); | 451 IntRect(constraint.scroll_container_relative_containing_block_rect)); |
454 EXPECT_EQ(IntPoint(0, 10), | |
455 IntPoint(constraint.parent_relative_sticky_box_offset)); | |
456 } | 452 } |
457 } | 453 } |
458 | 454 |
459 TEST_P(ScrollingCoordinatorTest, touchEventHandler) { | 455 TEST_P(ScrollingCoordinatorTest, touchEventHandler) { |
460 RegisterMockedHttpURLLoad("touch-event-handler.html"); | 456 RegisterMockedHttpURLLoad("touch-event-handler.html"); |
461 NavigateTo(base_url_ + "touch-event-handler.html"); | 457 NavigateTo(base_url_ + "touch-event-handler.html"); |
462 ForceFullCompositingUpdate(); | 458 ForceFullCompositingUpdate(); |
463 | 459 |
464 ASSERT_EQ(WebEventListenerProperties::kBlocking, | 460 ASSERT_EQ(WebEventListenerProperties::kBlocking, |
465 GetWebLayerTreeView()->EventListenerProperties( | 461 GetWebLayerTreeView()->EventListenerProperties( |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 ForceFullCompositingUpdate(); | 1257 ForceFullCompositingUpdate(); |
1262 PaintLayerScrollableArea* scrollable_area2 = | 1258 PaintLayerScrollableArea* scrollable_area2 = |
1263 ToLayoutBoxModelObject(container2->GetLayoutObject()) | 1259 ToLayoutBoxModelObject(container2->GetLayoutObject()) |
1264 ->GetScrollableArea(); | 1260 ->GetScrollableArea(); |
1265 ASSERT_TRUE(scrollable_area2); | 1261 ASSERT_TRUE(scrollable_area2); |
1266 EXPECT_TRUE(scrollable_area2->GetNonCompositedMainThreadScrollingReasons() & | 1262 EXPECT_TRUE(scrollable_area2->GetNonCompositedMainThreadScrollingReasons() & |
1267 MainThreadScrollingReason::kHasBorderRadius); | 1263 MainThreadScrollingReason::kHasBorderRadius); |
1268 } | 1264 } |
1269 | 1265 |
1270 } // namespace blink | 1266 } // namespace blink |
OLD | NEW |