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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
15 #include "chrome/browser/extensions/extension_browsertest.h" | 15 #include "chrome/browser/extensions/extension_browsertest.h" |
16 #include "chrome/browser/extensions/requirements_checker.h" | 16 #include "chrome/browser/extensions/requirements_checker.h" |
17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
19 #include "chrome/common/extensions/extension_file_util.h" | 19 #include "chrome/common/extensions/extension_file_util.h" |
20 #include "chrome/test/base/test_launcher_utils.h" | 20 #include "chrome/test/base/test_launcher_utils.h" |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/browser/gpu_data_manager.h" | 22 #include "content/public/browser/gpu_data_manager.h" |
23 #include "content/public/common/gpu_info.h" | 23 #include "content/public/common/gpu_info.h" |
| 24 #include "content/public/test/test_launcher_utils.h" |
24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/gl/gl_switches.h" | 27 #include "ui/gl/gl_switches.h" |
27 | 28 |
28 namespace extensions { | 29 namespace extensions { |
29 | 30 |
30 class RequirementsCheckerBrowserTest : public ExtensionBrowserTest { | 31 class RequirementsCheckerBrowserTest : public ExtensionBrowserTest { |
31 public: | 32 public: |
32 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 33 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
33 // In linux, we need to launch GPU process to decide if WebGL is allowed. | 34 // In linux, we need to launch GPU process to decide if WebGL is allowed. |
34 // Run it on top of osmesa to avoid bot driver issues. | 35 // Run it on top of osmesa to avoid bot driver issues. |
35 #if defined(OS_LINUX) | 36 #if defined(OS_LINUX) |
36 CHECK(test_launcher_utils::OverrideGLImplementation( | 37 CHECK(content::OverrideGLImplementation( |
37 command_line, gfx::kGLImplementationOSMesaName)) << | 38 command_line, gfx::kGLImplementationOSMesaName)) << |
38 "kUseGL must not be set multiple times!"; | 39 "kUseGL must not be set multiple times!"; |
39 #endif | 40 #endif |
40 } | 41 } |
41 | 42 |
42 scoped_refptr<const Extension> LoadExtensionFromDirName( | 43 scoped_refptr<const Extension> LoadExtensionFromDirName( |
43 const std::string& extension_dir_name) { | 44 const std::string& extension_dir_name) { |
44 FilePath extension_path; | 45 FilePath extension_path; |
45 std::string load_error; | 46 std::string load_error; |
46 PathService::Get(chrome::DIR_TEST_DATA, &extension_path); | 47 PathService::Get(chrome::DIR_TEST_DATA, &extension_path); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 LoadExtensionFromDirName("require_3d")); | 185 LoadExtensionFromDirName("require_3d")); |
185 ASSERT_TRUE(extension.get()); | 186 ASSERT_TRUE(extension.get()); |
186 | 187 |
187 checker_.Check(extension, base::Bind( | 188 checker_.Check(extension, base::Bind( |
188 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, | 189 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, |
189 base::Unretained(this), std::vector<std::string>())); | 190 base::Unretained(this), std::vector<std::string>())); |
190 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 191 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
191 } | 192 } |
192 | 193 |
193 } // extensions | 194 } // extensions |
OLD | NEW |