OLD | NEW |
---|---|
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" |
11 #include "android_webview/browser/render_thread_manager.h" | |
boliu
2016/04/21 18:14:10
needed?
Tobias Sargeant
2016/04/22 11:42:22
Not strictly. Can't just remove it as is, but mayb
| |
11 #include "android_webview/browser/test/rendering_test.h" | 12 #include "android_webview/browser/test/rendering_test.h" |
12 #include "base/location.h" | 13 #include "base/location.h" |
13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
14 #include "cc/output/compositor_frame.h" | 15 #include "cc/output/compositor_frame.h" |
15 #include "content/public/test/test_synchronous_compositor_android.h" | 16 #include "content/public/test/test_synchronous_compositor_android.h" |
16 | 17 |
17 namespace android_webview { | 18 namespace android_webview { |
18 | 19 |
19 class SmokeTest : public RenderingTest { | 20 class SmokeTest : public RenderingTest { |
20 void StartTest() override { browser_view_renderer_->PostInvalidate(); } | 21 void StartTest() override { browser_view_renderer_->PostInvalidate(); } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 const ParentCompositorDrawConstraints& constraints2) { | 118 const ParentCompositorDrawConstraints& constraints2) { |
118 if (constraints1.is_layer != constraints2.is_layer || | 119 if (constraints1.is_layer != constraints2.is_layer || |
119 constraints1.transform != constraints2.transform) | 120 constraints1.transform != constraints2.transform) |
120 return false; | 121 return false; |
121 | 122 |
122 return !constraints1.is_layer || | 123 return !constraints1.is_layer || |
123 constraints1.surface_rect_empty == constraints2.surface_rect_empty; | 124 constraints1.surface_rect_empty == constraints2.surface_rect_empty; |
124 } | 125 } |
125 | 126 |
126 void OnParentDrawConstraintsUpdated() override { | 127 void OnParentDrawConstraintsUpdated() override { |
127 RenderingTest::OnParentDrawConstraintsUpdated(); | |
128 ParentCompositorDrawConstraints constraints = | 128 ParentCompositorDrawConstraints constraints = |
129 render_thread_manager_->GetParentDrawConstraintsOnUI(); | 129 render_thread_manager_->GetParentDrawConstraintsOnUI(); |
130 switch (on_draw_count_) { | 130 switch (on_draw_count_) { |
131 case 1u: | 131 case 1u: |
132 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_)); | 132 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_)); |
133 break; | 133 break; |
134 case 3u: | 134 case 3u: |
135 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_)); | 135 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_)); |
136 EndTest(); | 136 EndTest(); |
137 break; | 137 break; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 279 |
280 private: | 280 private: |
281 std::queue<content::SynchronousCompositor::Frame> frames_; | 281 std::queue<content::SynchronousCompositor::Frame> frames_; |
282 uint32_t last_output_surface_id_; | 282 uint32_t last_output_surface_id_; |
283 std::map<cc::ResourceId, int> expected_return_count_; | 283 std::map<cc::ResourceId, int> expected_return_count_; |
284 }; | 284 }; |
285 | 285 |
286 RENDERING_TEST_F(SwitchOutputSurfaceIdTest); | 286 RENDERING_TEST_F(SwitchOutputSurfaceIdTest); |
287 | 287 |
288 } // namespace android_webview | 288 } // namespace android_webview |
OLD | NEW |