OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/gpu/compositor_util.h" | 9 #include "content/browser/gpu/compositor_util.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 SET_UP_SURFACE_OR_PASS_TEST(NULL); | 286 SET_UP_SURFACE_OR_PASS_TEST(NULL); |
287 | 287 |
288 base::RunLoop run_loop; | 288 base::RunLoop run_loop; |
289 GetRenderViewHost()->CopyFromBackingStore( | 289 GetRenderViewHost()->CopyFromBackingStore( |
290 gfx::Rect(), | 290 gfx::Rect(), |
291 frame_size(), | 291 frame_size(), |
292 base::Bind(&RenderWidgetHostViewBrowserTest::FinishCopyFromBackingStore, | 292 base::Bind(&RenderWidgetHostViewBrowserTest::FinishCopyFromBackingStore, |
293 base::Unretained(this), | 293 base::Unretained(this), |
294 run_loop.QuitClosure()), | 294 run_loop.QuitClosure()), |
295 kN32_SkColorType); | 295 kN32_SkColorType); |
296 // Delete the surface before the callback is run. | |
297 GetRenderWidgetHostView()->AcceleratedSurfaceRelease(); | |
298 run_loop.Run(); | 296 run_loop.Run(); |
299 | 297 |
300 EXPECT_EQ(1, callback_invoke_count()); | 298 EXPECT_EQ(1, callback_invoke_count()); |
301 } | 299 } |
302 | 300 |
303 // Tests that the callback passed to CopyFromCompositingSurfaceToVideoFrame is | 301 // Tests that the callback passed to CopyFromCompositingSurfaceToVideoFrame is |
304 // always called, even when the RenderWidgetHost is deleting in the middle of | 302 // always called, even when the RenderWidgetHost is deleting in the middle of |
305 // an async copy. | 303 // an async copy. |
306 // | 304 // |
307 // Test is flaky on Win. http://crbug.com/276783 | 305 // Test is flaky on Win. http://crbug.com/276783 |
(...skipping 15 matching lines...) Expand all Loading... |
323 return; | 321 return; |
324 } | 322 } |
325 | 323 |
326 base::RunLoop run_loop; | 324 base::RunLoop run_loop; |
327 scoped_refptr<media::VideoFrame> dest = | 325 scoped_refptr<media::VideoFrame> dest = |
328 media::VideoFrame::CreateBlackFrame(frame_size()); | 326 media::VideoFrame::CreateBlackFrame(frame_size()); |
329 view->CopyFromCompositingSurfaceToVideoFrame( | 327 view->CopyFromCompositingSurfaceToVideoFrame( |
330 gfx::Rect(view->GetViewBounds().size()), dest, base::Bind( | 328 gfx::Rect(view->GetViewBounds().size()), dest, base::Bind( |
331 &RenderWidgetHostViewBrowserTest::FinishCopyFromCompositingSurface, | 329 &RenderWidgetHostViewBrowserTest::FinishCopyFromCompositingSurface, |
332 base::Unretained(this), run_loop.QuitClosure())); | 330 base::Unretained(this), run_loop.QuitClosure())); |
333 // Delete the surface before the callback is run. | |
334 view->AcceleratedSurfaceRelease(); | |
335 run_loop.Run(); | 331 run_loop.Run(); |
336 | 332 |
337 EXPECT_EQ(1, callback_invoke_count()); | 333 EXPECT_EQ(1, callback_invoke_count()); |
338 } | 334 } |
339 | 335 |
340 // Test basic frame subscription functionality. We subscribe, and then run | 336 // Test basic frame subscription functionality. We subscribe, and then run |
341 // until at least one DeliverFrameCallback has been invoked. | 337 // until at least one DeliverFrameCallback has been invoked. |
342 IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, | 338 IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, |
343 FrameSubscriberTest) { | 339 FrameSubscriberTest) { |
344 SET_UP_SURFACE_OR_PASS_TEST(NULL); | 340 SET_UP_SURFACE_OR_PASS_TEST(NULL); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 908 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
913 INSTANTIATE_TEST_CASE_P( | 909 INSTANTIATE_TEST_CASE_P( |
914 GLAndSoftwareCompositing, | 910 GLAndSoftwareCompositing, |
915 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 911 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
916 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 912 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
917 | 913 |
918 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 914 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
919 | 915 |
920 } // namespace | 916 } // namespace |
921 } // namespace content | 917 } // namespace content |
OLD | NEW |