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

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

Issue 898783003: Move rendering/RenderLayer* to layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "core/fetch/ResourceFetcher.h" 54 #include "core/fetch/ResourceFetcher.h"
55 #include "core/frame/FrameHost.h" 55 #include "core/frame/FrameHost.h"
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/PinchViewport.h" 58 #include "core/frame/PinchViewport.h"
59 #include "core/frame/Settings.h" 59 #include "core/frame/Settings.h"
60 #include "core/html/HTMLDocument.h" 60 #include "core/html/HTMLDocument.h"
61 #include "core/html/HTMLFormElement.h" 61 #include "core/html/HTMLFormElement.h"
62 #include "core/html/HTMLMediaElement.h" 62 #include "core/html/HTMLMediaElement.h"
63 #include "core/layout/HitTestResult.h" 63 #include "core/layout/HitTestResult.h"
64 #include "core/layout/compositing/RenderLayerCompositor.h" 64 #include "core/layout/compositing/LayerCompositor.h"
65 #include "core/loader/DocumentThreadableLoader.h" 65 #include "core/loader/DocumentThreadableLoader.h"
66 #include "core/loader/DocumentThreadableLoaderClient.h" 66 #include "core/loader/DocumentThreadableLoaderClient.h"
67 #include "core/loader/FrameLoadRequest.h" 67 #include "core/loader/FrameLoadRequest.h"
68 #include "core/loader/ThreadableLoader.h" 68 #include "core/loader/ThreadableLoader.h"
69 #include "core/page/EventHandler.h" 69 #include "core/page/EventHandler.h"
70 #include "core/page/Page.h" 70 #include "core/page/Page.h"
71 #include "core/rendering/RenderFullScreen.h" 71 #include "core/rendering/RenderFullScreen.h"
72 #include "core/rendering/RenderView.h" 72 #include "core/rendering/RenderView.h"
73 #include "core/testing/NullExecutionContext.h" 73 #include "core/testing/NullExecutionContext.h"
74 #include "core/testing/URLTestHelpers.h" 74 #include "core/testing/URLTestHelpers.h"
(...skipping 5963 matching lines...) Expand 10 before | Expand all | Expand 10 after
6038 { 6038 {
6039 registerMockedHttpURLLoad("non-scrollable.html"); 6039 registerMockedHttpURLLoad("non-scrollable.html");
6040 TestMainFrameUserOrProgrammaticScrollFrameClient client; 6040 TestMainFrameUserOrProgrammaticScrollFrameClient client;
6041 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr (new FakeCompositingWebViewClient()); 6041 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr (new FakeCompositingWebViewClient());
6042 FrameTestHelpers::WebViewHelper webViewHelper; 6042 FrameTestHelpers::WebViewHelper webViewHelper;
6043 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi gueCompositingWebView); 6043 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi gueCompositingWebView);
6044 6044
6045 webViewHelper.webView()->resize(WebSize(100, 100)); 6045 webViewHelper.webView()->resize(WebSize(100, 100));
6046 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "non-scrollable.html"); 6046 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "non-scrollable.html");
6047 6047
6048 RenderLayerCompositor* compositor = webViewHelper.webViewImpl()->compositor (); 6048 LayerCompositor* compositor = webViewHelper.webViewImpl()->compositor();
6049 ASSERT_TRUE(compositor->scrollLayer()); 6049 ASSERT_TRUE(compositor->scrollLayer());
6050 6050
6051 // Verify that the WebLayer is not scrollable initially. 6051 // Verify that the WebLayer is not scrollable initially.
6052 GraphicsLayer* scrollLayer = compositor->scrollLayer(); 6052 GraphicsLayer* scrollLayer = compositor->scrollLayer();
6053 WebLayer* webScrollLayer = scrollLayer->platformLayer(); 6053 WebLayer* webScrollLayer = scrollLayer->platformLayer();
6054 ASSERT_FALSE(webScrollLayer->userScrollableHorizontal()); 6054 ASSERT_FALSE(webScrollLayer->userScrollableHorizontal());
6055 ASSERT_FALSE(webScrollLayer->userScrollableVertical()); 6055 ASSERT_FALSE(webScrollLayer->userScrollableVertical());
6056 6056
6057 // Call javascript to make the layer scrollable, and verify it. 6057 // Call javascript to make the layer scrollable, and verify it.
6058 WebLocalFrameImpl* frame = (WebLocalFrameImpl*)webViewHelper.webView()->main Frame(); 6058 WebLocalFrameImpl* frame = (WebLocalFrameImpl*)webViewHelper.webView()->main Frame();
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
6377 RefPtrWillBeRawPtr<NullExecutionContext> context = adoptRefWillBeNoop(new Nu llExecutionContext()); 6377 RefPtrWillBeRawPtr<NullExecutionContext> context = adoptRefWillBeNoop(new Nu llExecutionContext());
6378 MediaStreamRegistry::registry().registerURL(0, toKURL(m_baseURL + "test.webm "), MediaStream::create(context.get())); 6378 MediaStreamRegistry::registry().registerURL(0, toKURL(m_baseURL + "test.webm "), MediaStream::create(context.get()));
6379 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document(); 6379 Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()- >document();
6380 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); 6380 UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
6381 Element* videoFullscreen = document->getElementById("video"); 6381 Element* videoFullscreen = document->getElementById("video");
6382 Fullscreen::from(*document).requestFullscreen(*videoFullscreen, Fullscreen:: PrefixedRequest); 6382 Fullscreen::from(*document).requestFullscreen(*videoFullscreen, Fullscreen:: PrefixedRequest);
6383 webViewImpl->didEnterFullScreen(); 6383 webViewImpl->didEnterFullScreen();
6384 webViewImpl->layout(); 6384 webViewImpl->layout();
6385 6385
6386 // Verify that the video layer is visible in fullscreen. 6386 // Verify that the video layer is visible in fullscreen.
6387 RenderLayer* renderLayer = videoFullscreen->renderer()->enclosingLayer(); 6387 Layer* renderLayer = videoFullscreen->renderer()->enclosingLayer();
6388 GraphicsLayer* graphicsLayer = renderLayer->graphicsLayerBacking(); 6388 GraphicsLayer* graphicsLayer = renderLayer->graphicsLayerBacking();
6389 EXPECT_TRUE(graphicsLayer->contentsAreVisible()); 6389 EXPECT_TRUE(graphicsLayer->contentsAreVisible());
6390 context->notifyContextDestroyed(); 6390 context->notifyContextDestroyed();
6391 } 6391 }
6392 6392
6393 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants) 6393 TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants)
6394 { 6394 {
6395 registerMockedHttpURLLoad("percent-height-descendants.html"); 6395 registerMockedHttpURLLoad("percent-height-descendants.html");
6396 FrameTestHelpers::WebViewHelper webViewHelper; 6396 FrameTestHelpers::WebViewHelper webViewHelper;
6397 webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html "); 6397 webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html ");
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
7019 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7019 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7020 7020
7021 // Neither should a page reload. 7021 // Neither should a page reload.
7022 localFrame->reload(); 7022 localFrame->reload();
7023 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 7023 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
7024 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 7024 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
7025 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7025 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7026 } 7026 }
7027 7027
7028 } // namespace 7028 } // namespace
OLDNEW
« no previous file with comments | « Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698