Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 497723002: Merge willEnter/willExitFullScreen into didEnter/didExitFullScreen (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5635 matching lines...) Expand 10 before | Expand all | Expand 10 after
5646 int viewportWidth = 640; 5646 int viewportWidth = 640;
5647 int viewportHeight = 480; 5647 int viewportHeight = 480;
5648 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, &configueCompositingWebView); 5648 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, &configueCompositingWebView);
5649 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); 5649 webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
5650 webViewImpl->layout(); 5650 webViewImpl->layout();
5651 5651
5652 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); 5652 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document();
5653 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); 5653 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture);
5654 Element* divFullscreen = document->getElementById("div1"); 5654 Element* divFullscreen = document->getElementById("div1");
5655 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr efixedRequest); 5655 Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::Pr efixedRequest);
5656 webViewImpl->willEnterFullScreen();
5657 webViewImpl->didEnterFullScreen(); 5656 webViewImpl->didEnterFullScreen();
5658 webViewImpl->layout(); 5657 webViewImpl->layout();
5659 5658
5660 // Verify that the main frame is not scrollable. 5659 // Verify that the main frame is not scrollable.
5661 ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document)); 5660 ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document));
5662 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor mLayer(); 5661 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor mLayer();
5663 ASSERT_FALSE(webScrollLayer->scrollable()); 5662 ASSERT_FALSE(webScrollLayer->scrollable());
5664 5663
5665 // Verify that the main frame is scrollable upon exiting fullscreen. 5664 // Verify that the main frame is scrollable upon exiting fullscreen.
5666 webViewImpl->willExitFullScreen();
5667 webViewImpl->didExitFullScreen(); 5665 webViewImpl->didExitFullScreen();
5668 webViewImpl->layout(); 5666 webViewImpl->layout();
5669 ASSERT_FALSE(blink::Fullscreen::isFullScreen(*document)); 5667 ASSERT_FALSE(blink::Fullscreen::isFullScreen(*document));
5670 webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer(); 5668 webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
5671 ASSERT_TRUE(webScrollLayer->scrollable()); 5669 ASSERT_TRUE(webScrollLayer->scrollable());
5672 } 5670 }
5673 5671
5674 TEST_F(WebFrameTest, FullscreenMainFrameScrollable) 5672 TEST_F(WebFrameTest, FullscreenMainFrameScrollable)
5675 { 5673 {
5676 FakeCompositingWebViewClient client; 5674 FakeCompositingWebViewClient client;
5677 registerMockedHttpURLLoad("fullscreen_div.html"); 5675 registerMockedHttpURLLoad("fullscreen_div.html");
5678 FrameTestHelpers::WebViewHelper webViewHelper; 5676 FrameTestHelpers::WebViewHelper webViewHelper;
5679 int viewportWidth = 640; 5677 int viewportWidth = 640;
5680 int viewportHeight = 480; 5678 int viewportHeight = 480;
5681 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, &configueCompositingWebView); 5679 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_div.html", true, 0, &client, &configueCompositingWebView);
5682 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); 5680 webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
5683 webViewImpl->layout(); 5681 webViewImpl->layout();
5684 5682
5685 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); 5683 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document();
5686 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture); 5684 blink::UserGestureIndicator gesture(blink::DefinitelyProcessingUserGesture);
5687 Fullscreen::from(*document).requestFullscreen(*document->documentElement(), Fullscreen::PrefixedRequest); 5685 Fullscreen::from(*document).requestFullscreen(*document->documentElement(), Fullscreen::PrefixedRequest);
5688 webViewImpl->willEnterFullScreen();
5689 webViewImpl->didEnterFullScreen(); 5686 webViewImpl->didEnterFullScreen();
5690 webViewImpl->layout(); 5687 webViewImpl->layout();
5691 5688
5692 // Verify that the main frame is still scrollable. 5689 // Verify that the main frame is still scrollable.
5693 ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document)); 5690 ASSERT_TRUE(blink::Fullscreen::isFullScreen(*document));
5694 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor mLayer(); 5691 WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platfor mLayer();
5695 ASSERT_TRUE(webScrollLayer->scrollable()); 5692 ASSERT_TRUE(webScrollLayer->scrollable());
5696 } 5693 }
5697 5694
5698 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants) 5695 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants)
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
6140 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6137 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6141 6138
6142 // Neither should a page reload. 6139 // Neither should a page reload.
6143 localFrame->reload(); 6140 localFrame->reload();
6144 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6141 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6145 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6142 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6146 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6143 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6147 } 6144 }
6148 6145
6149 } // namespace 6146 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698