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 6407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6484 | 6483 |
6485 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 6484 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
6486 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6485 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
6487 Element* divFullscreen = document->getElementById("div1"); | 6486 Element* divFullscreen = document->getElementById("div1"); |
6488 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6487 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
6489 webViewImpl->didEnterFullScreen(); | 6488 webViewImpl->didEnterFullScreen(); |
6490 webViewImpl->layout(); | 6489 webViewImpl->layout(); |
6491 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); | 6490 ASSERT_TRUE(Fullscreen::isFullScreen(*document)); |
6492 | 6491 |
6493 // Verify that the element is sized to the viewport. | 6492 // Verify that the element is sized to the viewport. |
6494 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6493 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6494 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
6495 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6495 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
6496 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6496 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
6497 | 6497 |
6498 // Verify it's updated after a device rotation. | 6498 // Verify it's updated after a device rotation. |
6499 client.m_screenInfo.rect.width = viewportHeight; | 6499 client.m_screenInfo.rect.width = viewportHeight; |
6500 client.m_screenInfo.rect.height = viewportWidth; | 6500 client.m_screenInfo.rect.height = viewportWidth; |
6501 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6501 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
6502 webViewImpl->layout(); | 6502 webViewImpl->layout(); |
6503 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6503 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
6504 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6504 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6588 webViewImpl->layout(); | 6588 webViewImpl->layout(); |
6589 | 6589 |
6590 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); | 6590 Document* document = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame(
)->firstChild())->frame()->document(); |
6591 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 6591 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
6592 Element* divFullscreen = document->getElementById("div1"); | 6592 Element* divFullscreen = document->getElementById("div1"); |
6593 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); | 6593 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr
efixedRequest); |
6594 webViewImpl->didEnterFullScreen(); | 6594 webViewImpl->didEnterFullScreen(); |
6595 webViewImpl->layout(); | 6595 webViewImpl->layout(); |
6596 | 6596 |
6597 // Verify that the element is sized to the viewport. | 6597 // Verify that the element is sized to the viewport. |
6598 LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullS
creenLayoutObject(); | 6598 Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*docum
ent); |
| 6599 LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObj
ect()); |
6599 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 6600 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
6600 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 6601 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
6601 | 6602 |
6602 // Verify it's updated after a device rotation. | 6603 // Verify it's updated after a device rotation. |
6603 client.m_screenInfo.rect.width = viewportHeight; | 6604 client.m_screenInfo.rect.width = viewportHeight; |
6604 client.m_screenInfo.rect.height = viewportWidth; | 6605 client.m_screenInfo.rect.height = viewportWidth; |
6605 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6606 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
6606 webViewImpl->layout(); | 6607 webViewImpl->layout(); |
6607 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6608 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
6608 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6609 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8223 | 8224 |
8224 TEST_F(WebFrameTest, MaxFramesDetach) | 8225 TEST_F(WebFrameTest, MaxFramesDetach) |
8225 { | 8226 { |
8226 registerMockedHttpURLLoad("max-frames-detach.html"); | 8227 registerMockedHttpURLLoad("max-frames-detach.html"); |
8227 FrameTestHelpers::WebViewHelper webViewHelper; | 8228 FrameTestHelpers::WebViewHelper webViewHelper; |
8228 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8229 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
8229 webViewImpl->mainFrameImpl()->collectGarbage(); | 8230 webViewImpl->mainFrameImpl()->collectGarbage(); |
8230 } | 8231 } |
8231 | 8232 |
8232 } // namespace blink | 8233 } // namespace blink |
OLD | NEW |