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/test/browser_test_utils.h" | 22 #include "content/public/test/browser_test_utils.h" |
23 #include "content/test/gpu/gpu_test_config.h" | |
24 #include "gpu/config/gpu_feature_type.h" | 23 #include "gpu/config/gpu_feature_type.h" |
25 #include "gpu/config/gpu_info.h" | 24 #include "gpu/config/gpu_info.h" |
| 25 #include "gpu/config/gpu_test_config.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 #include "ui/gl/gl_switches.h" | 27 #include "ui/gl/gl_switches.h" |
28 #include "ui/compositor/compositor_setup.h" | 28 #include "ui/compositor/compositor_setup.h" |
29 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
30 #include "ui/surface/io_surface_support_mac.h" | 30 #include "ui/surface/io_surface_support_mac.h" |
31 #endif | 31 #endif |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "base/win/windows_version.h" | 34 #include "base/win/windows_version.h" |
35 #endif | 35 #endif |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 310 std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
311 switches::kUseGL); | 311 switches::kUseGL); |
312 if (use_gl == gfx::kGLImplementationOSMesaName) | 312 if (use_gl == gfx::kGLImplementationOSMesaName) |
313 return; | 313 return; |
314 | 314 |
315 // Linux Intel uses mesa driver, where multisampling is not supported. | 315 // Linux Intel uses mesa driver, where multisampling is not supported. |
316 // Multisampling is also not supported on virtualized mac os. | 316 // Multisampling is also not supported on virtualized mac os. |
317 std::vector<std::string> configs; | 317 std::vector<std::string> configs; |
318 configs.push_back("LINUX INTEL"); | 318 configs.push_back("LINUX INTEL"); |
319 configs.push_back("MAC VMWARE"); | 319 configs.push_back("MAC VMWARE"); |
320 if (GPUTestBotConfig::CurrentConfigMatches(configs)) | 320 if (gpu::GPUTestBotConfig::CurrentConfigMatches(configs)) |
321 return; | 321 return; |
322 | 322 |
323 const base::FilePath url(FILE_PATH_LITERAL("feature_multisampling.html")); | 323 const base::FilePath url(FILE_PATH_LITERAL("feature_multisampling.html")); |
324 RunTest(url, "\"TRUE\"", true); | 324 RunTest(url, "\"TRUE\"", true); |
325 } | 325 } |
326 | 326 |
327 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MultisamplingBlocked) { | 327 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MultisamplingBlocked) { |
328 // Multisampling fails on virtualized mac os. | 328 // Multisampling fails on virtualized mac os. |
329 if (GPUTestBotConfig::CurrentConfigMatches("MAC VMWARE")) | 329 if (gpu::GPUTestBotConfig::CurrentConfigMatches("MAC VMWARE")) |
330 return; | 330 return; |
331 | 331 |
332 const std::string json_blacklist = | 332 const std::string json_blacklist = |
333 "{\n" | 333 "{\n" |
334 " \"name\": \"gpu blacklist\",\n" | 334 " \"name\": \"gpu blacklist\",\n" |
335 " \"version\": \"1.0\",\n" | 335 " \"version\": \"1.0\",\n" |
336 " \"entries\": [\n" | 336 " \"entries\": [\n" |
337 " {\n" | 337 " {\n" |
338 " \"id\": 1,\n" | 338 " \"id\": 1,\n" |
339 " \"features\": [\n" | 339 " \"features\": [\n" |
(...skipping 13 matching lines...) Expand all Loading... |
353 class WebGLMultisamplingTest : public GpuFeatureTest { | 353 class WebGLMultisamplingTest : public GpuFeatureTest { |
354 public: | 354 public: |
355 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 355 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
356 GpuFeatureTest::SetUpCommandLine(command_line); | 356 GpuFeatureTest::SetUpCommandLine(command_line); |
357 command_line->AppendSwitch(switches::kDisableGLMultisampling); | 357 command_line->AppendSwitch(switches::kDisableGLMultisampling); |
358 } | 358 } |
359 }; | 359 }; |
360 | 360 |
361 IN_PROC_BROWSER_TEST_F(WebGLMultisamplingTest, MultisamplingDisabled) { | 361 IN_PROC_BROWSER_TEST_F(WebGLMultisamplingTest, MultisamplingDisabled) { |
362 // Multisampling fails on virtualized mac os. | 362 // Multisampling fails on virtualized mac os. |
363 if (GPUTestBotConfig::CurrentConfigMatches("MAC VMWARE")) | 363 if (gpu::GPUTestBotConfig::CurrentConfigMatches("MAC VMWARE")) |
364 return; | 364 return; |
365 | 365 |
366 const base::FilePath url(FILE_PATH_LITERAL("feature_multisampling.html")); | 366 const base::FilePath url(FILE_PATH_LITERAL("feature_multisampling.html")); |
367 RunTest(url, "\"FALSE\"", true); | 367 RunTest(url, "\"FALSE\"", true); |
368 } | 368 } |
369 | 369 |
370 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DAllowed) { | 370 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DAllowed) { |
371 // Accelerated canvas 2D is not supported on XP. | 371 // Accelerated canvas 2D is not supported on XP. |
372 if (GPUTestBotConfig::CurrentConfigMatches("XP")) | 372 if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) |
373 return; | 373 return; |
374 | 374 |
375 EXPECT_FALSE(GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 375 EXPECT_FALSE(GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
376 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)); | 376 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)); |
377 | 377 |
378 const base::FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 378 const base::FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
379 RunEventTest(url, kAcceleratedCanvasCreationEvent, true); | 379 RunEventTest(url, kAcceleratedCanvasCreationEvent, true); |
380 } | 380 } |
381 | 381 |
382 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) { | 382 IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 base::StringPrintf( | 551 base::StringPrintf( |
552 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " | 552 "%d (resize offset %d): IOSurface width %d -> %d; Creates %d " |
553 "Expected %d", offset_i, offsets[offset_i], | 553 "Expected %d", offset_i, offsets[offset_i], |
554 old_width, new_width, num_creates, expected_creates); | 554 old_width, new_width, num_creates, expected_creates); |
555 } | 555 } |
556 } | 556 } |
557 } | 557 } |
558 #endif | 558 #endif |
559 | 559 |
560 } // namespace anonymous | 560 } // namespace anonymous |
OLD | NEW |