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 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 WebRect rect, caret; | 2544 WebRect rect, caret; |
2545 webViewHelper.webViewImpl()->selectionBounds(caret, rect); | 2545 webViewHelper.webViewImpl()->selectionBounds(caret, rect); |
2546 | 2546 |
2547 float scale; | 2547 float scale; |
2548 IntPoint scroll; | 2548 IntPoint scroll; |
2549 bool needAnimation; | 2549 bool needAnimation; |
2550 webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelp
er.webViewImpl()->focusedElement(), scale, scroll, needAnimation); | 2550 webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelp
er.webViewImpl()->focusedElement(), scale, scroll, needAnimation); |
2551 EXPECT_TRUE(needAnimation); | 2551 EXPECT_TRUE(needAnimation); |
2552 // The edit box should be left aligned with a margin for possible label. | 2552 // The edit box should be left aligned with a margin for possible label. |
2553 int hScroll = editBoxWithText.x - leftBoxRatio * viewportWidth / scale; | 2553 int hScroll = editBoxWithText.x - leftBoxRatio * viewportWidth / scale; |
2554 EXPECT_NEAR(hScroll, scroll.x(), 1); | 2554 EXPECT_NEAR(hScroll, scroll.x(), 5); |
2555 int vScroll = editBoxWithText.y - (viewportHeight / scale - editBoxWithText.
height) / 2; | 2555 int vScroll = editBoxWithText.y - (viewportHeight / scale - editBoxWithText.
height) / 2; |
2556 EXPECT_NEAR(vScroll, scroll.y(), 1); | 2556 EXPECT_NEAR(vScroll, scroll.y(), 1); |
2557 EXPECT_NEAR(minReadableCaretHeight / caret.height, scale, 0.1); | 2557 EXPECT_NEAR(minReadableCaretHeight / caret.height, scale, 0.1); |
2558 | 2558 |
2559 // The edit box is wider than the viewport when legible. | 2559 // The edit box is wider than the viewport when legible. |
2560 viewportWidth = 200; | 2560 viewportWidth = 200; |
2561 viewportHeight = 150; | 2561 viewportHeight = 150; |
2562 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); | 2562 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
2563 setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), 1); | 2563 setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), 1); |
2564 webViewHelper.webViewImpl()->selectionBounds(caret, rect); | 2564 webViewHelper.webViewImpl()->selectionBounds(caret, rect); |
(...skipping 3739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6304 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6304 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6305 | 6305 |
6306 // Neither should a page reload. | 6306 // Neither should a page reload. |
6307 localFrame->reload(); | 6307 localFrame->reload(); |
6308 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6308 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6309 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6309 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6310 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6310 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6311 } | 6311 } |
6312 | 6312 |
6313 } // namespace | 6313 } // namespace |
OLD | NEW |