Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/component_updater/test/cld_component_installer_unittest.cc

Issue 285293004: Allow browser tests to run with dynamic CLD data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cld_uma
Patch Set: Yet more #ifdefs for compiler cleanliness Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/cld_component_installer.cc ('k') | chrome/browser/translate/translate_browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698