OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 6311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6322 // Show more, make sure the scroll actually gets clamped. Horizontal | 6322 // Show more, make sure the scroll actually gets clamped. Horizontal |
6323 // direction shouldn't be affected. | 6323 // direction shouldn't be affected. |
6324 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, 20.0f / topControlsHeight)
; | 6324 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, 20.0f / topControlsHeight)
; |
6325 webView->setMainFrameScrollOffset(WebPoint(100, 100)); | 6325 webView->setMainFrameScrollOffset(WebPoint(100, 100)); |
6326 EXPECT_POINT_EQ(IntPoint(50, 70), IntPoint(frameView->scrollOffset())); | 6326 EXPECT_POINT_EQ(IntPoint(50, 70), IntPoint(frameView->scrollOffset())); |
6327 | 6327 |
6328 // Hide until there's 10px showing. | 6328 // Hide until there's 10px showing. |
6329 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, -30.0f / topControlsHeight
); | 6329 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, -30.0f / topControlsHeight
); |
6330 EXPECT_POINT_EQ(IntPoint(50, 55), frameView->maximumScrollPosition()); | 6330 EXPECT_POINT_EQ(IntPoint(50, 55), frameView->maximumScrollPosition()); |
6331 | 6331 |
6332 // Simulate a RenderPart::resize. The frame is resized to accomodate | 6332 // Simulate a LayoutPart::resize. The frame is resized to accomodate |
6333 // the top controls and Blink's view of the top controls matches that of | 6333 // the top controls and Blink's view of the top controls matches that of |
6334 // the CC | 6334 // the CC |
6335 webView->setTopControlsHeight(40.0f, true); | 6335 webView->setTopControlsHeight(40.0f, true); |
6336 webView->resize(WebSize(100, 90)); | 6336 webView->resize(WebSize(100, 90)); |
6337 webView->layout(); | 6337 webView->layout(); |
6338 EXPECT_POINT_EQ(IntPoint(50, 30), frameView->maximumScrollPosition()); | 6338 EXPECT_POINT_EQ(IntPoint(50, 30), frameView->maximumScrollPosition()); |
6339 | 6339 |
6340 // Now simulate hiding. | 6340 // Now simulate hiding. |
6341 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, -10.0f / topControlsHeight
); | 6341 webView->applyViewportDeltas(WebSize(0, 0), 1.0f, -10.0f / topControlsHeight
); |
6342 EXPECT_POINT_EQ(IntPoint(50, 25), frameView->maximumScrollPosition()); | 6342 EXPECT_POINT_EQ(IntPoint(50, 25), frameView->maximumScrollPosition()); |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7186 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 7186 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
7187 | 7187 |
7188 // Neither should a page reload. | 7188 // Neither should a page reload. |
7189 localFrame->reload(); | 7189 localFrame->reload(); |
7190 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 7190 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
7191 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 7191 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
7192 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 7192 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
7193 } | 7193 } |
7194 | 7194 |
7195 } // namespace | 7195 } // namespace |
OLD | NEW |