| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 command_line->AppendSwitchASCII(switches::kUseGL, "osmesa"); | 44 command_line->AppendSwitchASCII(switches::kUseGL, "osmesa"); |
| 45 #endif | 45 #endif |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SetupBlacklist(const std::string& json_blacklist) { | 48 void SetupBlacklist(const std::string& json_blacklist) { |
| 49 scoped_ptr<Version> os_version(Version::GetVersionFromString("1.0")); | 49 scoped_ptr<Version> os_version(Version::GetVersionFromString("1.0")); |
| 50 GpuBlacklist* blacklist = new GpuBlacklist("1.0"); | 50 GpuBlacklist* blacklist = new GpuBlacklist("1.0"); |
| 51 | 51 |
| 52 ASSERT_TRUE(blacklist->LoadGpuBlacklist( | 52 ASSERT_TRUE(blacklist->LoadGpuBlacklist( |
| 53 json_blacklist, GpuBlacklist::kAllOs)); | 53 json_blacklist, GpuBlacklist::kAllOs)); |
| 54 GpuDataManager::GetInstance()->SetBuiltInGpuBlacklist(blacklist); | 54 GpuDataManager::GetInstance()->SetGpuBlacklist(blacklist); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void RunTest(const FilePath& url, GpuResultFlags expectations) { | 57 void RunTest(const FilePath& url, GpuResultFlags expectations) { |
| 58 using namespace trace_analyzer; | 58 using namespace trace_analyzer; |
| 59 | 59 |
| 60 FilePath test_path; | 60 FilePath test_path; |
| 61 PathService::Get(chrome::DIR_TEST_DATA, &test_path); | 61 PathService::Get(chrome::DIR_TEST_DATA, &test_path); |
| 62 test_path = test_path.Append(FILE_PATH_LITERAL("gpu")); | 62 test_path = test_path.Append(FILE_PATH_LITERAL("gpu")); |
| 63 test_path = test_path.Append(url); | 63 test_path = test_path.Append(url); |
| 64 | 64 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 EXPECT_EQ( | 227 EXPECT_EQ( |
| 228 flags.flags(), | 228 flags.flags(), |
| 229 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); | 229 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); |
| 230 | 230 |
| 231 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); | 231 const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html")); |
| 232 RunTest(url, EXPECT_NO_GPU_PROCESS); | 232 RunTest(url, EXPECT_NO_GPU_PROCESS); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace anonymous | 235 } // namespace anonymous |
| 236 | 236 |
| OLD | NEW |