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_proxy.h" | 6 #include "base/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/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #endif | 70 #endif |
71 NavigateToURL(shell(), net::FilePathToFileURL( | 71 NavigateToURL(shell(), net::FilePathToFileURL( |
72 test_dir_.AppendASCII("rwhv_compositing_animation.html"))); | 72 test_dir_.AppendASCII("rwhv_compositing_animation.html"))); |
73 if (!CheckAcceleratedCompositingActive()) | 73 if (!CheckAcceleratedCompositingActive()) |
74 return false; | 74 return false; |
75 | 75 |
76 // The page is now accelerated composited but a compositing surface might | 76 // The page is now accelerated composited but a compositing surface might |
77 // not be available immediately so wait for it. | 77 // not be available immediately so wait for it. |
78 while (!CheckCompositingSurface()) { | 78 while (!CheckCompositingSurface()) { |
79 base::RunLoop run_loop; | 79 base::RunLoop run_loop; |
80 MessageLoop::current()->PostDelayedTask( | 80 base::MessageLoop::current()->PostDelayedTask( |
81 FROM_HERE, | 81 FROM_HERE, |
82 run_loop.QuitClosure(), | 82 run_loop.QuitClosure(), |
83 base::TimeDelta::FromMilliseconds(10)); | 83 base::TimeDelta::FromMilliseconds(10)); |
84 run_loop.Run(); | 84 run_loop.Run(); |
85 } | 85 } |
86 return true; | 86 return true; |
87 } | 87 } |
88 | 88 |
89 bool SetupNonCompositing() { | 89 bool SetupNonCompositing() { |
90 NavigateToURL(shell(), net::FilePathToFileURL( | 90 NavigateToURL(shell(), net::FilePathToFileURL( |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 &second_frame_captured, | 313 &second_frame_captured, |
314 base::Time::Now())); | 314 base::Time::Now())); |
315 run_loop.Run(); | 315 run_loop.Run(); |
316 | 316 |
317 EXPECT_TRUE(first_frame_captured); | 317 EXPECT_TRUE(first_frame_captured); |
318 EXPECT_TRUE(second_frame_captured); | 318 EXPECT_TRUE(second_frame_captured); |
319 } | 319 } |
320 #endif | 320 #endif |
321 | 321 |
322 } // namespace content | 322 } // namespace content |
OLD | NEW |