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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "core/frame/FrameView.h" | 56 #include "core/frame/FrameView.h" |
57 #include "core/frame/LocalFrame.h" | 57 #include "core/frame/LocalFrame.h" |
58 #include "core/frame/RemoteFrame.h" | 58 #include "core/frame/RemoteFrame.h" |
59 #include "core/frame/Settings.h" | 59 #include "core/frame/Settings.h" |
60 #include "core/frame/VisualViewport.h" | 60 #include "core/frame/VisualViewport.h" |
61 #include "core/html/HTMLDocument.h" | 61 #include "core/html/HTMLDocument.h" |
62 #include "core/html/HTMLFormElement.h" | 62 #include "core/html/HTMLFormElement.h" |
63 #include "core/html/HTMLMediaElement.h" | 63 #include "core/html/HTMLMediaElement.h" |
64 #include "core/input/EventHandler.h" | 64 #include "core/input/EventHandler.h" |
65 #include "core/layout/HitTestResult.h" | 65 #include "core/layout/HitTestResult.h" |
66 #include "core/layout/LayoutFullScreen.h" | |
67 #include "core/layout/LayoutView.h" | 66 #include "core/layout/LayoutView.h" |
68 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 67 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
69 #include "core/loader/DocumentLoader.h" | 68 #include "core/loader/DocumentLoader.h" |
70 #include "core/loader/DocumentThreadableLoader.h" | 69 #include "core/loader/DocumentThreadableLoader.h" |
71 #include "core/loader/DocumentThreadableLoaderClient.h" | 70 #include "core/loader/DocumentThreadableLoaderClient.h" |
72 #include "core/loader/FrameLoadRequest.h" | 71 #include "core/loader/FrameLoadRequest.h" |
73 #include "core/loader/ThreadableLoader.h" | 72 #include "core/loader/ThreadableLoader.h" |
74 #include "core/page/Page.h" | 73 #include "core/page/Page.h" |
75 #include "core/paint/DeprecatedPaintLayer.h" | 74 #include "core/paint/DeprecatedPaintLayer.h" |
76 #include "core/testing/NullExecutionContext.h" | 75 #include "core/testing/NullExecutionContext.h" |
(...skipping 6402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6479 | 6478 |
6480 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 6479 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
6481 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6480 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
6482 Element* divFullscreen = document->getElementById("div1"); | 6481 Element* divFullscreen = document->getElementById("div1"); |
6483 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6482 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
6484 webViewImpl->didEnterFullScreen(); | 6483 webViewImpl->didEnterFullScreen(); |
6485 webViewImpl->layout(); | 6484 webViewImpl->layout(); |
6486 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); | 6485 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); |
6487 | 6486 |
6488 // Verify that the element is sized to the viewport. | 6487 // Verify that the element is sized to the viewport. |
6489 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6488 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6489 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
6490 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6490 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
6491 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6491 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
6492 | 6492 |
6493 // Verify it's updated after a device rotation. | 6493 // Verify it's updated after a device rotation. |
6494 client.m_screenInfo.rect.width = viewportHeight; | 6494 client.m_screenInfo.rect.width = viewportHeight; |
6495 client.m_screenInfo.rect.height = viewportWidth; | 6495 client.m_screenInfo.rect.height = viewportWidth; |
6496 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6496 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
6497 webViewImpl->layout(); | 6497 webViewImpl->layout(); |
6498 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6498 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
6499 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6499 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6583 webViewImpl->layout(); | 6583 webViewImpl->layout(); |
6584 | 6584 |
6585 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); | 6585 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); |
6586 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6586 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
6587 Element* divFullscreen = document->getElementById("div1"); | 6587 Element* divFullscreen = document->getElementById("div1"); |
6588 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6588 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
6589 webViewImpl->didEnterFullScreen(); | 6589 webViewImpl->didEnterFullScreen(); |
6590 webViewImpl->layout(); | 6590 webViewImpl->layout(); |
6591 | 6591 |
6592 // Verify that the element is sized to the viewport. | 6592 // Verify that the element is sized to the viewport. |
6593 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6593 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6594 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
6594 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6595 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
6595 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6596 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
6596 | 6597 |
6597 // Verify it's updated after a device rotation. | 6598 // Verify it's updated after a device rotation. |
6598 client.m_screenInfo.rect.width = viewportHeight; | 6599 client.m_screenInfo.rect.width = viewportHeight; |
6599 client.m_screenInfo.rect.height = viewportWidth; | 6600 client.m_screenInfo.rect.height = viewportWidth; |
6600 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6601 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
6601 webViewImpl->layout(); | 6602 webViewImpl->layout(); |
6602 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6603 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
6603 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6604 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8218 | 8219 |
8219 TEST_F(WebFrameTest, MaxFramesDetach) | 8220 TEST_F(WebFrameTest, MaxFramesDetach) |
8220 { | 8221 { |
8221 registerMockedHttpURLLoad("max-frames-detach.html"); | 8222 registerMockedHttpURLLoad("max-frames-detach.html"); |
8222 FrameTestHelpers::WebViewHelper webViewHelper; | 8223 FrameTestHelpers::WebViewHelper webViewHelper; |
8223 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8224 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
8224 webViewImpl->mainFrameImpl()->collectGarbage(); | 8225 webViewImpl->mainFrameImpl()->collectGarbage(); |
8225 } | 8226 } |
8226 | 8227 |
8227 } // namespace blink | 8228 } // namespace blink |
OLD | NEW |