| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 TEST_F(CldComponentInstallerTest, GetName) { | 119 TEST_F(CldComponentInstallerTest, GetName) { |
| 120 ASSERT_FALSE(traits_.GetName().empty()); | 120 ASSERT_FALSE(traits_.GetName().empty()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 TEST_F(CldComponentInstallerTest, ComponentReady) { | 123 TEST_F(CldComponentInstallerTest, ComponentReady) { |
| 124 scoped_ptr<base::DictionaryValue> manifest; | 124 scoped_ptr<base::DictionaryValue> manifest; |
| 125 const base::FilePath install_dir(FILE_PATH_LITERAL("/foo")); | 125 const base::FilePath install_dir(FILE_PATH_LITERAL("/foo")); |
| 126 const base::Version version("1.2.3.4"); | 126 const base::Version version("1.2.3.4"); |
| 127 traits_.ComponentReady(version, install_dir, manifest.Pass()); | 127 traits_.ComponentReady(version, install_dir, manifest.Pass()); |
| 128 base::FilePath result = CldComponentInstallerTraits::GetLatestCldDataFile(); | 128 base::FilePath result = CldComponentInstallerTraits::GetLatestCldDataFile(); |
| 129 ASSERT_TRUE( | 129 ASSERT_TRUE(base::StartsWith(result.AsUTF16Unsafe(), |
| 130 StartsWith(result.AsUTF16Unsafe(), install_dir.AsUTF16Unsafe(), true)); | 130 install_dir.AsUTF16Unsafe(), true)); |
| 131 ASSERT_TRUE(EndsWith(result.value(), kTestCldDataFileName, true)); | 131 ASSERT_TRUE(EndsWith(result.value(), kTestCldDataFileName, true)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace component_updater | 134 } // namespace component_updater |
| OLD | NEW |