| 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 7743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7754 registerMockedHttpURLLoad("fullscreen_div.html"); | 7754 registerMockedHttpURLLoad("fullscreen_div.html"); |
| 7755 FrameTestHelpers::WebViewHelper webViewHelper; | 7755 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7756 int viewportWidth = 640; | 7756 int viewportWidth = 640; |
| 7757 int viewportHeight = 480; | 7757 int viewportHeight = 480; |
| 7758 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7758 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7759 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7759 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7760 configureAndroid); | 7760 configureAndroid); |
| 7761 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7761 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7762 webViewImpl->updateAllLifecyclePhases(); | 7762 webViewImpl->updateAllLifecyclePhases(); |
| 7763 | 7763 |
| 7764 WebLayer* webScrollLayer = webViewImpl->mainFrameImpl() |
| 7765 ->frame() |
| 7766 ->view() |
| 7767 ->layoutViewportScrollableArea() |
| 7768 ->layerForScrolling() |
| 7769 ->platformLayer(); |
| 7770 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 7771 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
| 7772 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
| 7773 |
| 7764 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7774 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7765 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7775 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7766 Fullscreen::requestFullscreen(*document->documentElement()); | 7776 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7767 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | 7777 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7768 EXPECT_EQ(document->documentElement(), | 7778 EXPECT_EQ(document->documentElement(), |
| 7769 Fullscreen::fullscreenElementFrom(*document)); | 7779 Fullscreen::fullscreenElementFrom(*document)); |
| 7770 webViewImpl->didEnterFullscreen(); | 7780 webViewImpl->didEnterFullscreen(); |
| 7771 EXPECT_EQ(document->documentElement(), | 7781 EXPECT_EQ(document->documentElement(), |
| 7772 Fullscreen::currentFullScreenElementFrom(*document)); | 7782 Fullscreen::currentFullScreenElementFrom(*document)); |
| 7773 EXPECT_EQ(document->documentElement(), | 7783 EXPECT_EQ(document->documentElement(), |
| 7774 Fullscreen::fullscreenElementFrom(*document)); | 7784 Fullscreen::fullscreenElementFrom(*document)); |
| 7775 | 7785 |
| 7776 webViewImpl->updateAllLifecyclePhases(); | 7786 webViewImpl->updateAllLifecyclePhases(); |
| 7777 EXPECT_EQ(document->documentElement(), | 7787 EXPECT_EQ(document->documentElement(), |
| 7778 Fullscreen::currentFullScreenElementFrom(*document)); | 7788 Fullscreen::currentFullScreenElementFrom(*document)); |
| 7779 EXPECT_EQ(document->documentElement(), | 7789 EXPECT_EQ(document->documentElement(), |
| 7780 Fullscreen::fullscreenElementFrom(*document)); | 7790 Fullscreen::fullscreenElementFrom(*document)); |
| 7781 | 7791 |
| 7782 // Verify that the main frame is still scrollable. | 7792 // Verify that the main frame is still scrollable. |
| 7783 WebLayer* webScrollLayer = | 7793 webScrollLayer = webViewImpl->mainFrameImpl() |
| 7784 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7794 ->frame() |
| 7795 ->view() |
| 7796 ->layoutViewportScrollableArea() |
| 7797 ->layerForScrolling() |
| 7798 ->platformLayer(); |
| 7785 ASSERT_TRUE(webScrollLayer->scrollable()); | 7799 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 7786 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 7800 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
| 7787 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 7801 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
| 7788 | 7802 |
| 7789 // Verify the main frame still behaves correctly after a resize. | 7803 // Verify the main frame still behaves correctly after a resize. |
| 7790 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); | 7804 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); |
| 7791 ASSERT_TRUE(webScrollLayer->scrollable()); | 7805 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 7792 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 7806 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
| 7793 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 7807 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
| 7794 } | 7808 } |
| (...skipping 3462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11257 | 11271 |
| 11258 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11272 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11259 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11273 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11260 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11274 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11261 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11275 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11262 | 11276 |
| 11263 webViewHelper.reset(); | 11277 webViewHelper.reset(); |
| 11264 } | 11278 } |
| 11265 | 11279 |
| 11266 } // namespace blink | 11280 } // namespace blink |
| OLD | NEW |