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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Content client that exists only to register chrome-extension:// scheme with | 26 // Content client that exists only to register chrome-extension:// scheme with |
27 // the url module. | 27 // the url module. |
28 // TODO(jamescook): Should this be merged with ShellContentClient? Should this | 28 // TODO(jamescook): Should this be merged with ShellContentClient? Should this |
29 // be a persistent object available to tests? | 29 // be a persistent object available to tests? |
30 class ExtensionsContentClient : public content::ContentClient { | 30 class ExtensionsContentClient : public content::ContentClient { |
31 public: | 31 public: |
32 ExtensionsContentClient() {} | 32 ExtensionsContentClient() {} |
33 ~ExtensionsContentClient() override {} | 33 ~ExtensionsContentClient() override {} |
34 | 34 |
35 // content::ContentClient overrides: | 35 // content::ContentClient overrides: |
36 void AddAdditionalSchemes( | 36 void AddAdditionalSchemes(Schemes* schemes) override { |
37 std::vector<url::SchemeWithType>* standard_schemes, | 37 schemes->standard_schemes.push_back(extensions::kExtensionScheme); |
38 std::vector<url::SchemeWithType>* referrer_schemes, | 38 schemes->savable_schemes.push_back(extensions::kExtensionScheme); |
39 std::vector<std::string>* savable_schemes) override { | |
40 standard_schemes->push_back(url::SchemeWithType{ | |
41 extensions::kExtensionScheme, url::SCHEME_WITHOUT_PORT}); | |
42 savable_schemes->push_back(extensions::kExtensionScheme); | |
43 } | 39 } |
44 | 40 |
45 private: | 41 private: |
46 DISALLOW_COPY_AND_ASSIGN(ExtensionsContentClient); | 42 DISALLOW_COPY_AND_ASSIGN(ExtensionsContentClient); |
47 }; | 43 }; |
48 | 44 |
49 // The test suite for extensions_unittests. | 45 // The test suite for extensions_unittests. |
50 class ExtensionsTestSuite : public content::ContentTestSuiteBase { | 46 class ExtensionsTestSuite : public content::ContentTestSuiteBase { |
51 public: | 47 public: |
52 ExtensionsTestSuite(int argc, char** argv); | 48 ExtensionsTestSuite(int argc, char** argv); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); | 102 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); |
107 | 103 |
108 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); | 104 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); |
109 mojo::edk::test::ScopedIPCSupport ipc_support(test_io_thread.task_runner()); | 105 mojo::edk::test::ScopedIPCSupport ipc_support(test_io_thread.task_runner()); |
110 | 106 |
111 return base::LaunchUnitTests(argc, | 107 return base::LaunchUnitTests(argc, |
112 argv, | 108 argv, |
113 base::Bind(&content::UnitTestTestSuite::Run, | 109 base::Bind(&content::UnitTestTestSuite::Run, |
114 base::Unretained(&test_suite))); | 110 base::Unretained(&test_suite))); |
115 } | 111 } |
OLD | NEW |