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

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2036403002: Always use the WebFrameWidget when attaching the root graphics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding comments Created 4 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/VisualViewport.h" 5 #include "core/frame/VisualViewport.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 // prior to the VisualViewport being attached to the layer tree. 418 // prior to the VisualViewport being attached to the layer tree.
419 TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment) 419 TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment)
420 { 420 {
421 initializeWithDesktopSettings(); 421 initializeWithDesktopSettings();
422 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); 422 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
423 GraphicsLayer* rootGraphicsLayer = 423 GraphicsLayer* rootGraphicsLayer =
424 frameView.layoutView()->compositor()->rootGraphicsLayer(); 424 frameView.layoutView()->compositor()->rootGraphicsLayer();
425 425
426 // Make sure that a resize that comes in while there's no root layer is 426 // Make sure that a resize that comes in while there's no root layer is
427 // honoured when we attach to the layer tree. 427 // honoured when we attach to the layer tree.
428 webViewImpl()->setRootGraphicsLayer(nullptr); 428 WebFrameWidget* mainFrameWidget = static_cast<WebFrameWidget*>(webViewImpl() ->mainFrame()->toWebLocalFrame()->frameWidget());
429 mainFrameWidget->setRootGraphicsLayer(nullptr);
429 webViewImpl()->resize(IntSize(320, 240)); 430 webViewImpl()->resize(IntSize(320, 240));
430 webViewImpl()->setRootGraphicsLayer(rootGraphicsLayer); 431 mainFrameWidget->setRootGraphicsLayer(rootGraphicsLayer);
431 432
432 navigateTo("about:blank"); 433 navigateTo("about:blank");
433 webViewImpl()->updateAllLifecyclePhases(); 434 webViewImpl()->updateAllLifecyclePhases();
434 435
435 VisualViewport& visualViewport = frame()->page()->frameHost().visualViewport (); 436 VisualViewport& visualViewport = frame()->page()->frameHost().visualViewport ();
436 EXPECT_FLOAT_SIZE_EQ(FloatSize(320, 240), visualViewport.containerLayer()->s ize()); 437 EXPECT_FLOAT_SIZE_EQ(FloatSize(320, 240), visualViewport.containerLayer()->s ize());
437 } 438 }
438 439
439 // Make sure that the visibleRect method acurately reflects the scale and scroll location 440 // Make sure that the visibleRect method acurately reflects the scale and scroll location
440 // of the viewport. 441 // of the viewport.
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 webViewImpl()->handleInputEvent(pinchUpdate); 1859 webViewImpl()->handleInputEvent(pinchUpdate);
1859 1860
1860 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport(); 1861 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi ewport();
1861 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); 1862 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
1862 1863
1863 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); 1864 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location());
1864 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); 1865 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble());
1865 } 1866 }
1866 1867
1867 } // namespace 1868 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698