OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "app/app_switches.h" | 8 #include "app/app_switches.h" |
9 #include "app/gfx/gl/gl_implementation.h" | 9 #include "app/gfx/gl/gl_implementation.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Collects info about the GPU. Iff the info is collected, |client_info| will be | 110 // Collects info about the GPU. Iff the info is collected, |client_info| will be |
111 // set and true will be returned. This info may be partial or complete. This | 111 // set and true will be returned. This info may be partial or complete. This |
112 // will return false if we are running in a virtualized environment. | 112 // will return false if we are running in a virtualized environment. |
113 bool CollectGPUInfo(GPUInfo* client_info) { | 113 bool CollectGPUInfo(GPUInfo* client_info) { |
114 CHECK(client_info); | 114 CHECK(client_info); |
115 GpuProcessHostUIShim* gpu_host_shim = GpuProcessHostUIShim::GetInstance(); | 115 GpuProcessHostUIShim* gpu_host_shim = GpuProcessHostUIShim::GetInstance(); |
116 if (!gpu_host_shim) | 116 if (!gpu_host_shim) |
117 return false; | 117 return false; |
118 GPUInfo info = gpu_host_shim->gpu_info(); | 118 GPUInfo info = gpu_host_shim->gpu_info(); |
119 if (info.level() == GPUInfo::kUninitialized) { | 119 if (info.progress() == GPUInfo::kUninitialized) { |
120 GPUInfoCollectedObserver observer(gpu_host_shim); | 120 GPUInfoCollectedObserver observer(gpu_host_shim); |
121 gpu_host_shim->CollectGraphicsInfoAsynchronously(GPUInfo::kPartial); | 121 gpu_host_shim->CollectGraphicsInfoAsynchronously(); |
122 ui_test_utils::RunMessageLoop(); | 122 ui_test_utils::RunMessageLoop(); |
123 if (!observer.gpu_info_collected()) | 123 if (!observer.gpu_info_collected()) |
124 return false; | 124 return false; |
125 info = gpu_host_shim->gpu_info(); | 125 info = gpu_host_shim->gpu_info(); |
126 } | 126 } |
127 *client_info = info; | 127 *client_info = info; |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 } // namespace | 131 } // namespace |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); | 313 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); |
314 | 314 |
315 SkBitmap bitmap; | 315 SkBitmap bitmap; |
316 gfx::Size container_size(500, 500); | 316 gfx::Size container_size(500, 500); |
317 ResizeTabContainer(browser(), container_size); | 317 ResizeTabContainer(browser(), container_size); |
318 ASSERT_TRUE(ui_test_utils::TakeRenderWidgetSnapshot( | 318 ASSERT_TRUE(ui_test_utils::TakeRenderWidgetSnapshot( |
319 browser()->GetSelectedTabContents()->render_view_host(), | 319 browser()->GetSelectedTabContents()->render_view_host(), |
320 container_size, &bitmap)); | 320 container_size, &bitmap)); |
321 ASSERT_TRUE(CompareImages(bitmap, "")); | 321 ASSERT_TRUE(CompareImages(bitmap, "")); |
322 } | 322 } |
OLD | NEW |