OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
11 #include "content/public/test/content_test_suite_base.h" | 11 #include "content/public/test/content_test_suite_base.h" |
12 #include "content/public/test/unittest_test_suite.h" | 12 #include "content/public/test/unittest_test_suite.h" |
13 #include "extensions/common/constants.h" | 13 #include "extensions/common/constants.h" |
14 #include "extensions/common/extension_paths.h" | 14 #include "extensions/common/extension_paths.h" |
15 #include "extensions/test/test_extensions_client.h" | 15 #include "extensions/test/test_extensions_client.h" |
16 #include "mojo/embedder/test_embedder.h" | 16 #include "mojo/embedder/test_embedder.h" |
17 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/gl/gl_surface.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 // Content client that exists only to register chrome-extension:// scheme with | 22 // Content client that exists only to register chrome-extension:// scheme with |
22 // the url module. | 23 // the url module. |
23 // TODO(jamescook): Should this be merged with ShellContentClient? Should this | 24 // TODO(jamescook): Should this be merged with ShellContentClient? Should this |
24 // be a persistent object available to tests? | 25 // be a persistent object available to tests? |
25 class ExtensionsContentClient : public content::ContentClient { | 26 class ExtensionsContentClient : public content::ContentClient { |
26 public: | 27 public: |
27 ExtensionsContentClient() {} | 28 ExtensionsContentClient() {} |
(...skipping 29 matching lines...) Expand all Loading... |
57 DISALLOW_COPY_AND_ASSIGN(ExtensionsTestSuite); | 58 DISALLOW_COPY_AND_ASSIGN(ExtensionsTestSuite); |
58 }; | 59 }; |
59 | 60 |
60 ExtensionsTestSuite::ExtensionsTestSuite(int argc, char** argv) | 61 ExtensionsTestSuite::ExtensionsTestSuite(int argc, char** argv) |
61 : content::ContentTestSuiteBase(argc, argv) {} | 62 : content::ContentTestSuiteBase(argc, argv) {} |
62 | 63 |
63 ExtensionsTestSuite::~ExtensionsTestSuite() {} | 64 ExtensionsTestSuite::~ExtensionsTestSuite() {} |
64 | 65 |
65 void ExtensionsTestSuite::Initialize() { | 66 void ExtensionsTestSuite::Initialize() { |
66 content::ContentTestSuiteBase::Initialize(); | 67 content::ContentTestSuiteBase::Initialize(); |
| 68 gfx::GLSurface::InitializeOneOffForTests(); |
67 | 69 |
68 // Register the chrome-extension:// scheme via this circuitous path. Note | 70 // Register the chrome-extension:// scheme via this circuitous path. Note |
69 // that this does not persistently set up a ContentClient; individual tests | 71 // that this does not persistently set up a ContentClient; individual tests |
70 // must use content::SetContentClient(). | 72 // must use content::SetContentClient(). |
71 { | 73 { |
72 ExtensionsContentClient content_client; | 74 ExtensionsContentClient content_client; |
73 RegisterContentSchemes(&content_client); | 75 RegisterContentSchemes(&content_client); |
74 } | 76 } |
75 | 77 |
76 extensions::RegisterPathProvider(); | 78 extensions::RegisterPathProvider(); |
(...skipping 20 matching lines...) Expand all Loading... |
97 | 99 |
98 int main(int argc, char** argv) { | 100 int main(int argc, char** argv) { |
99 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); | 101 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); |
100 | 102 |
101 mojo::embedder::test::InitWithSimplePlatformSupport(); | 103 mojo::embedder::test::InitWithSimplePlatformSupport(); |
102 return base::LaunchUnitTests(argc, | 104 return base::LaunchUnitTests(argc, |
103 argv, | 105 argv, |
104 base::Bind(&content::UnitTestTestSuite::Run, | 106 base::Bind(&content::UnitTestTestSuite::Run, |
105 base::Unretained(&test_suite))); | 107 base::Unretained(&test_suite))); |
106 } | 108 } |
OLD | NEW |