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 6540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6551 | 6551 |
6552 // Verify it's updated after a device rotation. | 6552 // Verify it's updated after a device rotation. |
6553 client.m_screenInfo.rect.width = viewportHeight; | 6553 client.m_screenInfo.rect.width = viewportHeight; |
6554 client.m_screenInfo.rect.height = viewportWidth; | 6554 client.m_screenInfo.rect.height = viewportWidth; |
6555 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); | 6555 webViewImpl->resize(WebSize(viewportHeight, viewportWidth)); |
6556 webViewImpl->layout(); | 6556 webViewImpl->layout(); |
6557 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); | 6557 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalWidth().toInt()); |
6558 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); | 6558 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalHeight().toInt()); |
6559 } | 6559 } |
6560 | 6560 |
6561 TEST_F(WebFrameTest, FullscreenMediaStreamVideo) | |
Xianzhu
2015/08/03 22:39:02
Is the test case no longer applicable, or covered
Xianzhu
2015/08/03 22:40:07
Never mind. Saw your previous comment about this.
| |
6562 { | |
6563 RuntimeEnabledFeatures::setOverlayFullscreenVideoEnabled(true); | |
6564 FakeCompositingWebViewClient client; | |
6565 registerMockedHttpURLLoad("fullscreen_video.html"); | |
6566 FrameTestHelpers::WebViewHelper webViewHelper; | |
6567 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_video.html", true, 0, &client, configureAndroid); | |
6568 int viewportWidth = 640; | |
6569 int viewportHeight = 480; | |
6570 client.m_screenInfo.rect.width = viewportWidth; | |
6571 client.m_screenInfo.rect.height = viewportHeight; | |
6572 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | |
6573 webViewImpl->layout(); | |
6574 | |
6575 // Fake the video element as MediaStream | |
6576 RefPtrWillBeRawPtr<NullExecutionContext> context = adoptRefWillBeNoop(new Nu llExecutionContext()); | |
6577 MediaStreamRegistry::registry().registerURL(0, toKURL(m_baseURL + "test.webm "), MediaStream::create(context.get())); | |
6578 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); | |
6579 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | |
6580 Element* videoFullscreen = document->getElementById("video"); | |
6581 Fullscreen::from(*document).requestFullscreen(*videoFullscreen, Fullscreen:: PrefixedRequest); | |
6582 webViewImpl->didEnterFullScreen(); | |
6583 webViewImpl->layout(); | |
6584 | |
6585 // Verify that the video layer is visible in fullscreen. | |
6586 DeprecatedPaintLayer* paintLayer = videoFullscreen->layoutObject()->enclosi ngLayer(); | |
6587 GraphicsLayer* graphicsLayer = paintLayer->graphicsLayerBacking(); | |
6588 EXPECT_TRUE(graphicsLayer->contentsAreVisible()); | |
6589 context->notifyContextDestroyed(); | |
6590 } | |
6591 | |
6592 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) | 6561 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) |
6593 { | 6562 { |
6594 FakeCompositingWebViewClient client; | 6563 FakeCompositingWebViewClient client; |
6595 registerMockedHttpURLLoad("viewport-tiny.html"); | 6564 registerMockedHttpURLLoad("viewport-tiny.html"); |
6596 FrameTestHelpers::WebViewHelper webViewHelper(this); | 6565 FrameTestHelpers::WebViewHelper webViewHelper(this); |
6597 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "view port-tiny.html", true, 0, &client, configureAndroid); | 6566 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "view port-tiny.html", true, 0, &client, configureAndroid); |
6598 int viewportWidth = 384; | 6567 int viewportWidth = 384; |
6599 int viewportHeight = 640; | 6568 int viewportHeight = 640; |
6600 client.m_screenInfo.rect.width = viewportWidth; | 6569 client.m_screenInfo.rect.width = viewportWidth; |
6601 client.m_screenInfo.rect.height = viewportHeight; | 6570 client.m_screenInfo.rect.height = viewportHeight; |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7955 | 7924 |
7956 TEST_F(WebFrameTest, MaxFramesDetach) | 7925 TEST_F(WebFrameTest, MaxFramesDetach) |
7957 { | 7926 { |
7958 registerMockedHttpURLLoad("max-frames-detach.html"); | 7927 registerMockedHttpURLLoad("max-frames-detach.html"); |
7959 FrameTestHelpers::WebViewHelper webViewHelper; | 7928 FrameTestHelpers::WebViewHelper webViewHelper; |
7960 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); | 7929 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); |
7961 webViewImpl->mainFrameImpl()->collectGarbage(); | 7930 webViewImpl->mainFrameImpl()->collectGarbage(); |
7962 } | 7931 } |
7963 | 7932 |
7964 } // namespace blink | 7933 } // namespace blink |
OLD | NEW |