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

Side by Side Diff: third_party/WebKit/Source/web/PageOverlayTest.cpp

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "web/PageOverlay.h" 5 #include "web/PageOverlay.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "platform/graphics/Color.h" 8 #include "platform/graphics/Color.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/paint/DrawingRecorder.h" 10 #include "platform/graphics/paint/DrawingRecorder.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void initialize(CompositingMode compositingMode) 71 void initialize(CompositingMode compositingMode)
72 { 72 {
73 m_helper.initialize( 73 m_helper.initialize(
74 false /* enableJavascript */, nullptr /* webFrameClient */, nullptr /* webViewClient */, nullptr /* webWidgetClient */, 74 false /* enableJavascript */, nullptr /* webFrameClient */, nullptr /* webViewClient */, nullptr /* webWidgetClient */,
75 compositingMode == AcceleratedCompositing ? enableAcceleratedComposi ting : disableAcceleratedCompositing); 75 compositingMode == AcceleratedCompositing ? enableAcceleratedComposi ting : disableAcceleratedCompositing);
76 webViewImpl()->resize(WebSize(viewportWidth, viewportHeight)); 76 webViewImpl()->resize(WebSize(viewportWidth, viewportHeight));
77 webViewImpl()->updateAllLifecyclePhases(); 77 webViewImpl()->updateAllLifecyclePhases();
78 ASSERT_EQ(compositingMode == AcceleratedCompositing, webViewImpl()->isAc celeratedCompositingActive()); 78 ASSERT_EQ(compositingMode == AcceleratedCompositing, webViewImpl()->isAc celeratedCompositingActive());
79 } 79 }
80 80
81 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } 81 WebViewImpl* webViewImpl() const { return m_helper.webView(); }
82 82
83 std::unique_ptr<PageOverlay> createSolidYellowOverlay() 83 std::unique_ptr<PageOverlay> createSolidYellowOverlay()
84 { 84 {
85 return PageOverlay::create(webViewImpl(), new SolidColorOverlay(SK_Color YELLOW)); 85 return PageOverlay::create(webViewImpl(), new SolidColorOverlay(SK_Color YELLOW));
86 } 86 }
87 87
88 template <typename OverlayType> 88 template <typename OverlayType>
89 void runPageOverlayTestWithAcceleratedCompositing(); 89 void runPageOverlayTestWithAcceleratedCompositing();
90 90
91 private: 91 private:
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 { 143 {
144 initialize(AcceleratedCompositing); 144 initialize(AcceleratedCompositing);
145 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay(); 145 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay();
146 pageOverlay->update(); 146 pageOverlay->update();
147 webViewImpl()->updateAllLifecyclePhases(); 147 webViewImpl()->updateAllLifecyclePhases();
148 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight), pageOverlay->visu alRect()); 148 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight), pageOverlay->visu alRect());
149 } 149 }
150 150
151 } // namespace 151 } // namespace
152 } // namespace blink 152 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698