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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
19 #include "chrome/browser/gpu_process_host.h" | 19 #include "chrome/browser/gpu_process_host.h" |
20 #include "chrome/browser/gpu_process_host_ui_shim.h" | 20 #include "chrome/browser/gpu_process_host_ui_shim.h" |
21 #include "chrome/browser/renderer_host/render_view_host.h" | 21 #include "chrome/browser/renderer_host/render_view_host.h" |
22 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/gpu_info.h" | 25 #include "chrome/common/gpu_info.h" |
26 #include "chrome/test/in_process_browser_test.h" | 26 #include "chrome/test/in_process_browser_test.h" |
27 #include "chrome/test/test_launcher_utils.h" | 27 #include "chrome/test/test_launcher_utils.h" |
28 #include "chrome/test/ui_test_utils.h" | 28 #include "chrome/test/ui_test_utils.h" |
29 #include "gfx/codec/png_codec.h" | |
30 #include "gfx/size.h" | |
31 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
32 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
34 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
35 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
| 34 #include "ui/gfx/codec/png_codec.h" |
| 35 #include "ui/gfx/size.h" |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 // Command line flag for forcing the machine's GPU to be used instead of OSMesa. | 39 // Command line flag for forcing the machine's GPU to be used instead of OSMesa. |
40 const char kUseGpuInTests[] = "use-gpu-in-tests"; | 40 const char kUseGpuInTests[] = "use-gpu-in-tests"; |
41 | 41 |
42 // Command line flag for overriding the default location for putting generated | 42 // Command line flag for overriding the default location for putting generated |
43 // test images that do not match references. | 43 // test images that do not match references. |
44 const char kGeneratedDir[] = "generated-dir"; | 44 const char kGeneratedDir[] = "generated-dir"; |
45 | 45 |
(...skipping 267 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 |