OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 virtual bool enterFullScreen() { return true; } | 807 virtual bool enterFullScreen() { return true; } |
808 virtual void exitFullScreen() { } | 808 virtual void exitFullScreen() { } |
809 }; | 809 }; |
810 | 810 |
811 | 811 |
812 TEST_F(WebViewTest, EnterFullscreenResetScrollAndScaleState) | 812 TEST_F(WebViewTest, EnterFullscreenResetScrollAndScaleState) |
813 { | 813 { |
814 EnterFullscreenWebViewClient client; | 814 EnterFullscreenWebViewClient client; |
815 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("hello_world.html")); | 815 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("hello_world.html")); |
816 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "he
llo_world.html", true, 0, &client); | 816 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "he
llo_world.html", true, 0, &client); |
817 webViewImpl->settings()->setFullScreenEnabled(true); | |
818 webViewImpl->resize(WebSize(640, 480)); | 817 webViewImpl->resize(WebSize(640, 480)); |
819 webViewImpl->layout(); | 818 webViewImpl->layout(); |
820 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); | 819 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); |
821 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().height); | 820 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().height); |
822 | 821 |
823 // Make the page scale and scroll with the given paremeters. | 822 // Make the page scale and scroll with the given paremeters. |
824 webViewImpl->setPageScaleFactor(2.0f, WebPoint(116, 84)); | 823 webViewImpl->setPageScaleFactor(2.0f, WebPoint(116, 84)); |
825 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); | 824 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); |
826 EXPECT_EQ(116, webViewImpl->mainFrame()->scrollOffset().width); | 825 EXPECT_EQ(116, webViewImpl->mainFrame()->scrollOffset().width); |
827 EXPECT_EQ(84, webViewImpl->mainFrame()->scrollOffset().height); | 826 EXPECT_EQ(84, webViewImpl->mainFrame()->scrollOffset().height); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 testSelectionRootBounds("select_range_iframe_textarea_overflow.html", 1.0f); | 1735 testSelectionRootBounds("select_range_iframe_textarea_overflow.html", 1.0f); |
1737 | 1736 |
1738 // Basic page with scale factor. | 1737 // Basic page with scale factor. |
1739 testSelectionRootBounds("select_range_basic.html", 0.0f); | 1738 testSelectionRootBounds("select_range_basic.html", 0.0f); |
1740 testSelectionRootBounds("select_range_basic.html", 0.1f); | 1739 testSelectionRootBounds("select_range_basic.html", 0.1f); |
1741 testSelectionRootBounds("select_range_basic.html", 1.5f); | 1740 testSelectionRootBounds("select_range_basic.html", 1.5f); |
1742 testSelectionRootBounds("select_range_basic.html", 2.0f); | 1741 testSelectionRootBounds("select_range_basic.html", 2.0f); |
1743 } | 1742 } |
1744 | 1743 |
1745 } // namespace | 1744 } // namespace |
OLD | NEW |