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

Side by Side Diff: android_webview/browser/browser_view_renderer_unittest.cc

Issue 1816283005: Move SharedRendererState ownership to AwContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/browser_view_renderer.h" 9 #include "android_webview/browser/browser_view_renderer.h"
10 #include "android_webview/browser/child_frame.h" 10 #include "android_webview/browser/child_frame.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const ParentCompositorDrawConstraints& constraints1, 116 const ParentCompositorDrawConstraints& constraints1,
117 const ParentCompositorDrawConstraints& constraints2) { 117 const ParentCompositorDrawConstraints& constraints2) {
118 if (constraints1.is_layer != constraints2.is_layer || 118 if (constraints1.is_layer != constraints2.is_layer ||
119 constraints1.transform != constraints2.transform) 119 constraints1.transform != constraints2.transform)
120 return false; 120 return false;
121 121
122 return !constraints1.is_layer || 122 return !constraints1.is_layer ||
123 constraints1.surface_rect_empty == constraints2.surface_rect_empty; 123 constraints1.surface_rect_empty == constraints2.surface_rect_empty;
124 } 124 }
125 125
126 void ParentDrawConstraintsUpdated( 126 void OnParentDrawConstraintsUpdated() override {
127 const ParentCompositorDrawConstraints& constraints) override { 127 RenderingTest::OnParentDrawConstraintsUpdated();
128 ParentCompositorDrawConstraints constraints =
129 shared_renderer_state_->GetParentDrawConstraintsOnUI();
128 switch (on_draw_count_) { 130 switch (on_draw_count_) {
129 case 1u: 131 case 1u:
130 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_)); 132 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_));
131 break; 133 break;
132 case 3u: 134 case 3u:
133 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_)); 135 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_));
134 EndTest(); 136 EndTest();
135 break; 137 break;
136 // There will be a following 4th onDraw. But the hardware renderer won't 138 // There will be a following 4th onDraw. But the hardware renderer won't
137 // post back the draw constraints in DrawGL because the constraints 139 // post back the draw constraints in DrawGL because the constraints
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 279
278 private: 280 private:
279 std::queue<content::SynchronousCompositor::Frame> frames_; 281 std::queue<content::SynchronousCompositor::Frame> frames_;
280 uint32_t last_output_surface_id_; 282 uint32_t last_output_surface_id_;
281 std::map<cc::ResourceId, int> expected_return_count_; 283 std::map<cc::ResourceId, int> expected_return_count_;
282 }; 284 };
283 285
284 RENDERING_TEST_F(SwitchOutputSurfaceIdTest); 286 RENDERING_TEST_F(SwitchOutputSurfaceIdTest);
285 287
286 } // namespace android_webview 288 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/browser_view_renderer_client.h ('k') | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698