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 5523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 FrameTestHelpers::WebViewHelper webViewHelper; | 5534 FrameTestHelpers::WebViewHelper webViewHelper; |
5535 int viewportWidth = 640; | 5535 int viewportWidth = 640; |
5536 int viewportHeight = 480; | 5536 int viewportHeight = 480; |
5537 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); | 5537 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); |
5538 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 5538 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); |
5539 webViewImpl->layout(); | 5539 webViewImpl->layout(); |
5540 | 5540 |
5541 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 5541 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
5542 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 5542 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); |
5543 Element* divFullscreen = document->getElementById("div1"); | 5543 Element* divFullscreen = document->getElementById("div1"); |
5544 divFullscreen->webkitRequestFullscreen(); | 5544 FullscreenElementStack::from(*document).requestFullscreen(*divFullscreen, Fu
llscreenElementStack::PrefixedRequest); |
5545 webViewImpl->willEnterFullScreen(); | 5545 webViewImpl->willEnterFullScreen(); |
5546 webViewImpl->didEnterFullScreen(); | 5546 webViewImpl->didEnterFullScreen(); |
5547 webViewImpl->layout(); | 5547 webViewImpl->layout(); |
5548 | 5548 |
5549 // Verify that the main frame is not scrollable. | 5549 // Verify that the main frame is not scrollable. |
5550 ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); | 5550 ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); |
5551 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); | 5551 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); |
5552 ASSERT_FALSE(webScrollLayer->scrollable()); | 5552 ASSERT_FALSE(webScrollLayer->scrollable()); |
5553 | 5553 |
5554 // Verify that the main frame is scrollable upon exiting fullscreen. | 5554 // Verify that the main frame is scrollable upon exiting fullscreen. |
(...skipping 11 matching lines...) Expand all Loading... |
5566 registerMockedHttpURLLoad("fullscreen_div.html"); | 5566 registerMockedHttpURLLoad("fullscreen_div.html"); |
5567 FrameTestHelpers::WebViewHelper webViewHelper; | 5567 FrameTestHelpers::WebViewHelper webViewHelper; |
5568 int viewportWidth = 640; | 5568 int viewportWidth = 640; |
5569 int viewportHeight = 480; | 5569 int viewportHeight = 480; |
5570 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); | 5570 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full
screen_div.html", true, 0, &client, &configueCompositingWebView); |
5571 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); | 5571 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); |
5572 webViewImpl->layout(); | 5572 webViewImpl->layout(); |
5573 | 5573 |
5574 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); | 5574 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()-
>document(); |
5575 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); | 5575 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); |
5576 document->documentElement()->webkitRequestFullscreen(); | 5576 FullscreenElementStack::from(*document).requestFullscreen(*document->documen
tElement(), FullscreenElementStack::PrefixedRequest); |
5577 webViewImpl->willEnterFullScreen(); | 5577 webViewImpl->willEnterFullScreen(); |
5578 webViewImpl->didEnterFullScreen(); | 5578 webViewImpl->didEnterFullScreen(); |
5579 webViewImpl->layout(); | 5579 webViewImpl->layout(); |
5580 | 5580 |
5581 // Verify that the main frame is still scrollable. | 5581 // Verify that the main frame is still scrollable. |
5582 ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); | 5582 ASSERT_TRUE(blink::FullscreenElementStack::isFullScreen(*document)); |
5583 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); | 5583 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor
mLayer(); |
5584 ASSERT_TRUE(webScrollLayer->scrollable()); | 5584 ASSERT_TRUE(webScrollLayer->scrollable()); |
5585 } | 5585 } |
5586 | 5586 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5943 | 5943 |
5944 client.reset(); | 5944 client.reset(); |
5945 // Try to load the request with cross origin access. Should succeed. | 5945 // Try to load the request with cross origin access. Should succeed. |
5946 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; | 5946 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; |
5947 blink::DocumentThreadableLoader::loadResourceSynchronously( | 5947 blink::DocumentThreadableLoader::loadResourceSynchronously( |
5948 *frame->document(), blink::ResourceRequest(resourceUrl), client, options
, resourceLoaderOptions); | 5948 *frame->document(), blink::ResourceRequest(resourceUrl), client, options
, resourceLoaderOptions); |
5949 EXPECT_FALSE(client.failed()); | 5949 EXPECT_FALSE(client.failed()); |
5950 } | 5950 } |
5951 | 5951 |
5952 } // namespace | 5952 } // namespace |
OLD | NEW |