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 5674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5685 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 5685 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); |
5686 webViewImpl->layout(); | 5686 webViewImpl->layout(); |
5687 | 5687 |
5688 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 5688 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
5689 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 5689 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
5690 Element* divFullscreen = document->getElementById("div1"); | 5690 Element* divFullscreen = document->getElementById("div1"); |
5691 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 5691 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
5692 webViewImpl->didEnterFullScreen(); | 5692 webViewImpl->didEnterFullScreen(); |
5693 webViewImpl->layout(); | 5693 webViewImpl->layout(); |
5694 | 5694 |
5695 // Verify that the main frame is not scrollable. | 5695 // Verify that the main frame bounds are empty. |
5696 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); | 5696 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); |
5697 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); | 5697 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); |
5698 ASSERT_FALSE(webScrollLayer->scrollable()); | 5698 ASSERT_EQ(WebSize(), webScrollLayer->bounds()); |
5699 | 5699 |
5700 // Verify that the main frame is scrollable upon exiting fullscreen. | 5700 // Verify that the main frame is scrollable upon exiting fullscreen. |
5701 webViewImpl->didExitFullScreen(); | 5701 webViewImpl->didExitFullScreen(); |
5702 webViewImpl->layout(); | 5702 webViewImpl->layout(); |
5703 ASSERT_FALSE(Fullscreen::isFullScreen(*document)); | 5703 ASSERT_FALSE(Fullscreen::isFullScreen(*document)); |
5704 webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); | 5704 webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); |
5705 ASSERT_TRUE(webScrollLayer->scrollable()); | 5705 ASSERT_NE(WebSize(), webScrollLayer->bounds()); |
5706 } | 5706 } |
5707 | 5707 |
5708 TEST_F(WebFrameTest, FullscreenMainFrameScrollable) | 5708 TEST_F(WebFrameTest, FullscreenMainFrameScrollable) |
5709 { | 5709 { |
5710 FakeCompositingWebViewClient client; | 5710 FakeCompositingWebViewClient client; |
5711 registerMockedHttpURLLoad("fullscreen_div.html"); | 5711 registerMockedHttpURLLoad("fullscreen_div.html"); |
5712 FrameTestHelpers::WebViewHelper webViewHelper; | 5712 FrameTestHelpers::WebViewHelper webViewHelper; |
5713 int viewportWidth = 640; | 5713 int viewportWidth = 640; |
5714 int viewportHeight = 480; | 5714 int viewportHeight = 480; |
5715 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); | 5715 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6173 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6173 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6174 | 6174 |
6175 // Neither should a page reload. | 6175 // Neither should a page reload. |
6176 localFrame->reload(); | 6176 localFrame->reload(); |
6177 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6177 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6178 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6178 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6180 } | 6180 } |
6181 | 6181 |
6182 } // namespace | 6182 } // namespace |
OLD | NEW |