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 6505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6516 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 6516 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); |
6517 webViewImpl->layout(); | 6517 webViewImpl->layout(); |
6518 | 6518 |
6519 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); | 6519 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); |
6520 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6520 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
6521 Element* divFullscreen = document->getElementById("div1"); | 6521 Element* divFullscreen = document->getElementById("div1"); |
6522 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr efixedRequest); | 6522 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr efixedRequest); |
6523 webViewImpl->didEnterFullScreen(); | 6523 webViewImpl->didEnterFullScreen(); |
6524 webViewImpl->layout(); | 6524 webViewImpl->layout(); |
6525 | 6525 |
6526 // Verify that the main frame is nonscrollable. | 6526 // Verify that the viewports are nonscrollable. |
6527 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); | 6527 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); |
6528 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor mLayer(); | 6528 FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameVi ew(); |
6529 ASSERT_FALSE(webScrollLayer->userScrollableHorizontal()); | 6529 WebLayer* layoutViewportScrollLayer = webViewImpl->compositor()->scrollLayer ()->platformLayer(); |
bokan
2015/08/18 12:35:49
It's probably slightly more clear to get this via
Hugo Holgersson
2015/08/20 21:12:56
Hmm, I got a compile error when I tried that.
Hugo Holgersson
2015/08/21 17:28:47
Let's keep this lookup unchanged for now.
| |
6530 ASSERT_FALSE(webScrollLayer->userScrollableVertical()); | 6530 WebLayer* visualViewportScrollLayer = frameView->page()->frameHost().visualV iewport().scrollLayer()->platformLayer(); |
6531 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal()); | |
6532 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableVertical()); | |
6533 ASSERT_FALSE(visualViewportScrollLayer->userScrollableHorizontal()); | |
6534 ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical()); | |
6531 | 6535 |
6532 // Verify that the main frame is scrollable upon exiting fullscreen. | 6536 // Verify that the viewports are scrollable upon exiting fullscreen. |
6533 webViewImpl->didExitFullScreen(); | 6537 webViewImpl->didExitFullScreen(); |
6534 webViewImpl->layout(); | 6538 webViewImpl->layout(); |
6535 ASSERT_FALSE(Fullscreen::isFullScreen(*document)); | 6539 ASSERT_FALSE(Fullscreen::isFullScreen(*document)); |
6536 webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); | 6540 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal()); |
6537 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 6541 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical()); |
6538 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 6542 ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal()); |
6543 ASSERT_TRUE(visualViewportScrollLayer->userScrollableVertical()); | |
6539 } | 6544 } |
6540 | 6545 |
6541 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) | 6546 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) |
6542 { | 6547 { |
6543 FakeCompositingWebViewClient client; | 6548 FakeCompositingWebViewClient client; |
6544 registerMockedHttpURLLoad("fullscreen_div.html"); | 6549 registerMockedHttpURLLoad("fullscreen_div.html"); |
6545 FrameTestHelpers::WebViewHelper webViewHelper(this); | 6550 FrameTestHelpers::WebViewHelper webViewHelper(this); |
6546 int viewportWidth = 640; | 6551 int viewportWidth = 640; |
6547 int viewportHeight = 480; | 6552 int viewportHeight = 480; |
6548 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, configureAndroid); | 6553 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, configureAndroid); |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8040 | 8045 |
8041 TEST_F(WebFrameTest, MaxFramesDetach) | 8046 TEST_F(WebFrameTest, MaxFramesDetach) |
8042 { | 8047 { |
8043 registerMockedHttpURLLoad("max-frames-detach.html"); | 8048 registerMockedHttpURLLoad("max-frames-detach.html"); |
8044 FrameTestHelpers::WebViewHelper webViewHelper; | 8049 FrameTestHelpers::WebViewHelper webViewHelper; |
8045 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); | 8050 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); |
8046 webViewImpl->mainFrameImpl()->collectGarbage(); | 8051 webViewImpl->mainFrameImpl()->collectGarbage(); |
8047 } | 8052 } |
8048 | 8053 |
8049 } // namespace blink | 8054 } // namespace blink |
OLD | NEW |