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