| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 TEST_F(CldComponentInstallerTest, OnCustomInstall) { | 70 TEST_F(CldComponentInstallerTest, OnCustomInstall) { |
| 71 const base::DictionaryValue manifest; | 71 const base::DictionaryValue manifest; |
| 72 const base::FilePath install_dir; | 72 const base::FilePath install_dir; |
| 73 // Sanity: shouldn't crash. | 73 // Sanity: shouldn't crash. |
| 74 ASSERT_TRUE(traits.OnCustomInstall(manifest, install_dir)); | 74 ASSERT_TRUE(traits.OnCustomInstall(manifest, install_dir)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 TEST_F(CldComponentInstallerTest, GetInstalledPath) { | 77 TEST_F(CldComponentInstallerTest, GetInstalledPath) { |
| 78 const base::FilePath base_dir; | 78 const base::FilePath base_dir; |
| 79 const base::FilePath result = traits.GetInstalledPath(base_dir); | 79 const base::FilePath result = |
| 80 CldComponentInstallerTraits::GetInstalledPath(base_dir); |
| 80 ASSERT_TRUE(EndsWith(result.value(), chrome::kCLDDataFilename, true)); | 81 ASSERT_TRUE(EndsWith(result.value(), chrome::kCLDDataFilename, true)); |
| 81 } | 82 } |
| 82 | 83 |
| 83 TEST_F(CldComponentInstallerTest, GetBaseDirectory) { | 84 TEST_F(CldComponentInstallerTest, GetBaseDirectory) { |
| 84 const base::FilePath result = traits.GetBaseDirectory(); | 85 const base::FilePath result = traits.GetBaseDirectory(); |
| 85 ASSERT_FALSE(result.empty()); | 86 ASSERT_FALSE(result.empty()); |
| 86 } | 87 } |
| 87 | 88 |
| 88 TEST_F(CldComponentInstallerTest, GetHash) { | 89 TEST_F(CldComponentInstallerTest, GetHash) { |
| 89 std::vector<uint8> hash; | 90 std::vector<uint8> hash; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 101 const base::Version version("1.2.3.4"); | 102 const base::Version version("1.2.3.4"); |
| 102 traits.ComponentReady(version, install_dir, manifest.Pass()); | 103 traits.ComponentReady(version, install_dir, manifest.Pass()); |
| 103 base::FilePath result = component_updater::GetLatestCldDataFile(); | 104 base::FilePath result = component_updater::GetLatestCldDataFile(); |
| 104 ASSERT_TRUE(StartsWith(result.AsUTF16Unsafe(), | 105 ASSERT_TRUE(StartsWith(result.AsUTF16Unsafe(), |
| 105 install_dir.AsUTF16Unsafe(), | 106 install_dir.AsUTF16Unsafe(), |
| 106 true)); | 107 true)); |
| 107 ASSERT_TRUE(EndsWith(result.value(), chrome::kCLDDataFilename, true)); | 108 ASSERT_TRUE(EndsWith(result.value(), chrome::kCLDDataFilename, true)); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace component_updater | 111 } // namespace component_updater |
| OLD | NEW |