| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 13 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 14 #include "base/test/scoped_path_override.h" | 16 #include "base/test/scoped_path_override.h" |
| 15 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 "<?xml version='1.0' encoding='UTF-8'?>\n" | 124 "<?xml version='1.0' encoding='UTF-8'?>\n" |
| 123 "<gupdate xmlns='http://www.google.com/update2/response' " | 125 "<gupdate xmlns='http://www.google.com/update2/response' " |
| 124 "protocol='2.0'>\n" | 126 "protocol='2.0'>\n" |
| 125 " <app appid='%s'>\n" | 127 " <app appid='%s'>\n" |
| 126 " <updatecheck codebase='%s' version='1.0' />\n" | 128 " <updatecheck codebase='%s' version='1.0' />\n" |
| 127 " </app>\n" | 129 " </app>\n" |
| 128 "</gupdate>", | 130 "</gupdate>", |
| 129 extension_misc::kInAppPaymentsSupportAppId, | 131 extension_misc::kInAppPaymentsSupportAppId, |
| 130 test_server_->GetURL(kAppPath).spec().c_str())); | 132 test_server_->GetURL(kAppPath).spec().c_str())); |
| 131 response->set_content_type("text/xml"); | 133 response->set_content_type("text/xml"); |
| 132 return response.Pass(); | 134 return std::move(response); |
| 133 } | 135 } |
| 134 if (url.path() == kAppPath) { | 136 if (url.path() == kAppPath) { |
| 135 base::FilePath test_data_dir; | 137 base::FilePath test_data_dir; |
| 136 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 138 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 137 std::string contents; | 139 std::string contents; |
| 138 base::ReadFileToString( | 140 base::ReadFileToString( |
| 139 test_data_dir.AppendASCII("extensions/dummyiap.crx"), | 141 test_data_dir.AppendASCII("extensions/dummyiap.crx"), |
| 140 &contents); | 142 &contents); |
| 141 scoped_ptr<BasicHttpResponse> response(new BasicHttpResponse); | 143 scoped_ptr<BasicHttpResponse> response(new BasicHttpResponse); |
| 142 response->set_code(net::HTTP_OK); | 144 response->set_code(net::HTTP_OK); |
| 143 response->set_content(contents); | 145 response->set_content(contents); |
| 144 return response.Pass(); | 146 return std::move(response); |
| 145 } | 147 } |
| 146 | 148 |
| 147 return nullptr; | 149 return nullptr; |
| 148 } | 150 } |
| 149 | 151 |
| 150 scoped_ptr<EmbeddedTestServer> test_server_; | 152 scoped_ptr<EmbeddedTestServer> test_server_; |
| 151 scoped_ptr<ExtensionCacheFake> test_extension_cache_; | 153 scoped_ptr<ExtensionCacheFake> test_extension_cache_; |
| 152 | 154 |
| 153 #if defined(OS_CHROMEOS) | 155 #if defined(OS_CHROMEOS) |
| 154 // chromeos::ServicesCustomizationExternalLoader is hooked up as an | 156 // chromeos::ServicesCustomizationExternalLoader is hooked up as an |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 service_->CheckForExternalUpdates(); | 174 service_->CheckForExternalUpdates(); |
| 173 runner->Run(); | 175 runner->Run(); |
| 174 | 176 |
| 175 EXPECT_TRUE(service_->GetInstalledExtension( | 177 EXPECT_TRUE(service_->GetInstalledExtension( |
| 176 extension_misc::kInAppPaymentsSupportAppId)); | 178 extension_misc::kInAppPaymentsSupportAppId)); |
| 177 EXPECT_TRUE(service_->IsExtensionEnabled( | 179 EXPECT_TRUE(service_->IsExtensionEnabled( |
| 178 extension_misc::kInAppPaymentsSupportAppId)); | 180 extension_misc::kInAppPaymentsSupportAppId)); |
| 179 } | 181 } |
| 180 | 182 |
| 181 } // namespace extensions | 183 } // namespace extensions |
| OLD | NEW |