| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/test/trace_event_analyzer.h" | 10 #include "base/test/trace_event_analyzer.h" |
| 11 #include "base/version.h" | 11 #include "base/version.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 17 #include "chrome/test/base/test_launcher_utils.h" | 17 #include "chrome/test/base/test_launcher_utils.h" |
| 18 #include "chrome/test/base/tracing.h" | 18 #include "chrome/test/base/tracing.h" |
| 19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "content/public/browser/gpu_data_manager.h" | 20 #include "content/public/browser/gpu_data_manager.h" |
| 21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/common/gpu_info.h" | 22 #include "content/public/common/gpu_info.h" |
| 23 #include "content/public/test/browser_test_utils.h" | 23 #include "content/public/test/browser_test_utils.h" |
| 24 #include "content/public/test/test_launcher_utils.h" |
| 24 #include "content/test/gpu/gpu_test_config.h" | 25 #include "content/test/gpu/gpu_test_config.h" |
| 25 #include "content/test/gpu/test_switches.h" | 26 #include "content/test/gpu/test_switches.h" |
| 26 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| 27 #include "ui/gl/gl_switches.h" | 28 #include "ui/gl/gl_switches.h" |
| 28 #include "ui/compositor/compositor_setup.h" | 29 #include "ui/compositor/compositor_setup.h" |
| 29 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 30 #include "ui/surface/io_surface_support_mac.h" | 31 #include "ui/surface/io_surface_support_mac.h" |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 54 virtual void SetUpInProcessBrowserTestFixture() { | 55 virtual void SetUpInProcessBrowserTestFixture() { |
| 55 FilePath test_dir; | 56 FilePath test_dir; |
| 56 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 57 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
| 57 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 58 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
| 58 } | 59 } |
| 59 | 60 |
| 60 virtual void SetUpCommandLine(CommandLine* command_line) { | 61 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 61 // Do not use mesa if real GPU is required. | 62 // Do not use mesa if real GPU is required. |
| 62 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { | 63 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { |
| 63 #if !defined(OS_MACOSX) | 64 #if !defined(OS_MACOSX) |
| 64 CHECK(test_launcher_utils::OverrideGLImplementation( | 65 CHECK(content::OverrideGLImplementation( |
| 65 command_line, gfx::kGLImplementationOSMesaName)) << | 66 command_line, gfx::kGLImplementationOSMesaName)) << |
| 66 "kUseGL must not be set by test framework code!"; | 67 "kUseGL must not be set by test framework code!"; |
| 67 #endif | 68 #endif |
| 68 } else { | 69 } else { |
| 69 gpu_enabled_ = true; | 70 gpu_enabled_ = true; |
| 70 } | 71 } |
| 71 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 72 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
| 72 ui::DisableTestCompositor(); | 73 ui::DisableTestCompositor(); |
| 73 command_line->AppendSwitchASCII(switches::kWindowSize, "400,300"); | 74 command_line->AppendSwitchASCII(switches::kWindowSize, "400,300"); |
| 74 } | 75 } |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 base::StringPrintf( | 525 base::StringPrintf( |
| 525 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " | 526 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " |
| 526 "Expected %d", offset_i, offsets[offset_i], | 527 "Expected %d", offset_i, offsets[offset_i], |
| 527 old_width, new_width, num_creates, expected_creates); | 528 old_width, new_width, num_creates, expected_creates); |
| 528 } | 529 } |
| 529 } | 530 } |
| 530 } | 531 } |
| 531 #endif | 532 #endif |
| 532 | 533 |
| 533 } // namespace anonymous | 534 } // namespace anonymous |
| OLD | NEW |