| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 LoadExtensionFromDirName("require_3d")); | 129 LoadExtensionFromDirName("require_3d")); |
| 130 ASSERT_TRUE(extension.get()); | 130 ASSERT_TRUE(extension.get()); |
| 131 | 131 |
| 132 // Backlist webgl | 132 // Backlist webgl |
| 133 std::vector<std::string> blacklisted_features; | 133 std::vector<std::string> blacklisted_features; |
| 134 blacklisted_features.push_back("webgl"); | 134 blacklisted_features.push_back("webgl"); |
| 135 BlackListGPUFeatures(blacklisted_features); | 135 BlackListGPUFeatures(blacklisted_features); |
| 136 content::RunAllBlockingPoolTasksUntilIdle(); | 136 content::RunAllBlockingPoolTasksUntilIdle(); |
| 137 | 137 |
| 138 std::vector<std::string> expected_errors; | 138 std::vector<std::string> expected_errors; |
| 139 expected_errors.push_back(l10n_util::GetStringUTF8( | 139 if (!content::GpuDataManager::GetInstance()->ShouldUseSwiftShader()) { |
| 140 IDS_EXTENSION_WEBGL_NOT_SUPPORTED)); | 140 expected_errors.push_back( |
| 141 l10n_util::GetStringUTF8(IDS_EXTENSION_WEBGL_NOT_SUPPORTED)); |
| 142 } |
| 141 | 143 |
| 142 checker_->Check(extension, base::Bind( | 144 checker_->Check(extension, base::Bind( |
| 143 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, | 145 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, |
| 144 base::Unretained(this), expected_errors)); | 146 base::Unretained(this), expected_errors)); |
| 145 content::RunAllBlockingPoolTasksUntilIdle(); | 147 content::RunAllBlockingPoolTasksUntilIdle(); |
| 146 } | 148 } |
| 147 | 149 |
| 148 IN_PROC_BROWSER_TEST_F(RequirementsCheckerBrowserTest, Check3DExtension) { | 150 IN_PROC_BROWSER_TEST_F(RequirementsCheckerBrowserTest, Check3DExtension) { |
| 149 scoped_refptr<const Extension> extension( | 151 scoped_refptr<const Extension> extension( |
| 150 LoadExtensionFromDirName("require_3d")); | 152 LoadExtensionFromDirName("require_3d")); |
| 151 ASSERT_TRUE(extension.get()); | 153 ASSERT_TRUE(extension.get()); |
| 152 | 154 |
| 153 std::vector<std::string> expected_errors; | 155 std::vector<std::string> expected_errors; |
| 154 | 156 |
| 155 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { | 157 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { |
| 156 expected_errors.push_back(l10n_util::GetStringUTF8( | 158 expected_errors.push_back(l10n_util::GetStringUTF8( |
| 157 IDS_EXTENSION_WEBGL_NOT_SUPPORTED)); | 159 IDS_EXTENSION_WEBGL_NOT_SUPPORTED)); |
| 158 } | 160 } |
| 159 | 161 |
| 160 checker_->Check(extension, base::Bind( | 162 checker_->Check(extension, base::Bind( |
| 161 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, | 163 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, |
| 162 base::Unretained(this), expected_errors)); | 164 base::Unretained(this), expected_errors)); |
| 163 content::RunAllBlockingPoolTasksUntilIdle(); | 165 content::RunAllBlockingPoolTasksUntilIdle(); |
| 164 } | 166 } |
| 165 | 167 |
| 166 } // namespace extensions | 168 } // namespace extensions |
| OLD | NEW |