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/test/trace_event_analyzer.h" | 9 #include "base/test/trace_event_analyzer.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 class Canvas2DEnabledTest : public GpuFeatureTest { | 276 class Canvas2DEnabledTest : public GpuFeatureTest { |
277 public: | 277 public: |
278 virtual void SetUpCommandLine(CommandLine* command_line) { | 278 virtual void SetUpCommandLine(CommandLine* command_line) { |
279 GpuFeatureTest::SetUpCommandLine(command_line); | 279 GpuFeatureTest::SetUpCommandLine(command_line); |
280 command_line->AppendSwitch(switches::kEnableAccelerated2dCanvas); | 280 command_line->AppendSwitch(switches::kEnableAccelerated2dCanvas); |
281 } | 281 } |
282 }; | 282 }; |
283 | 283 |
284 IN_PROC_BROWSER_TEST_F(Canvas2DEnabledTest, Canvas2DAllowed) { | 284 IN_PROC_BROWSER_TEST_F(Canvas2DEnabledTest, Canvas2DAllowed) { |
285 GpuFeatureType type = GpuDataManager::GetInstance()->GetGpuFeatureType(); | |
286 EXPECT_EQ(type, 0); | |
287 | |
288 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | |
289 | |
290 GpuResultFlags expectations = EXPECT_GPU_SWAP_BUFFERS; | |
291 #if defined(OS_WIN) | 285 #if defined(OS_WIN) |
292 // Accelerated canvas 2D is not supported on XP. | 286 // Accelerated canvas 2D is not supported on XP. |
293 GPUTestBotConfig test_bot; | 287 GPUTestBotConfig test_bot; |
294 test_bot.LoadCurrentConfig(NULL); | 288 test_bot.LoadCurrentConfig(NULL); |
295 if (test_bot.os() == GPUTestConfig::kOsWinXP) | 289 if (test_bot.os() == GPUTestConfig::kOsWinXP) |
296 expectations = EXPECT_NO_GPU_PROCESS; | 290 return; |
297 #endif | 291 #endif |
298 RunTest(url, expectations); | 292 |
| 293 GpuFeatureType type = GpuDataManager::GetInstance()->GetGpuFeatureType(); |
| 294 EXPECT_EQ(type, 0); |
| 295 |
| 296 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 297 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); |
299 } | 298 } |
300 | 299 |
301 IN_PROC_BROWSER_TEST_F(Canvas2DEnabledTest, Canvas2DBlocked) { | 300 IN_PROC_BROWSER_TEST_F(Canvas2DEnabledTest, Canvas2DBlocked) { |
302 const std::string json_blacklist = | 301 const std::string json_blacklist = |
303 "{\n" | 302 "{\n" |
304 " \"name\": \"gpu blacklist\",\n" | 303 " \"name\": \"gpu blacklist\",\n" |
305 " \"version\": \"1.0\",\n" | 304 " \"version\": \"1.0\",\n" |
306 " \"entries\": [\n" | 305 " \"entries\": [\n" |
307 " {\n" | 306 " {\n" |
308 " \"id\": 1,\n" | 307 " \"id\": 1,\n" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 351 } |
353 }; | 352 }; |
354 | 353 |
355 IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, DISABLED_ThreadedCompositor) { | 354 IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, DISABLED_ThreadedCompositor) { |
356 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); | 355 const FilePath url(FILE_PATH_LITERAL("feature_compositing.html")); |
357 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); | 356 RunTest(url, EXPECT_GPU_SWAP_BUFFERS); |
358 } | 357 } |
359 | 358 |
360 } // namespace anonymous | 359 } // namespace anonymous |
361 | 360 |
OLD | NEW |