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

Side by Side Diff: chrome/common/importer/firefox_importer_utils_unittest.cc

Issue 2317003002: //chrome/browser and //components F-L: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 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 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/common/importer/firefox_importer_utils.h" 5 #include "chrome/common/importer/firefox_importer_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 GetPrefsJsValueCases[i].pref_value, 101 GetPrefsJsValueCases[i].pref_value,
102 GetPrefsJsValue(GetPrefsJsValueCases[i].prefs_content, 102 GetPrefsJsValue(GetPrefsJsValueCases[i].prefs_content,
103 GetPrefsJsValueCases[i].pref_name)); 103 GetPrefsJsValueCases[i].pref_name));
104 } 104 }
105 } 105 }
106 106
107 TEST(FirefoxImporterUtilsTest, GetFirefoxImporterName) { 107 TEST(FirefoxImporterUtilsTest, GetFirefoxImporterName) {
108 base::ScopedTempDir temp_dir; 108 base::ScopedTempDir temp_dir;
109 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 109 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
110 const base::FilePath app_ini_file( 110 const base::FilePath app_ini_file(
111 temp_dir.path().AppendASCII("application.ini")); 111 temp_dir.GetPath().AppendASCII("application.ini"));
112 for (size_t i = 0; i < arraysize(GetFirefoxImporterNameCases); ++i) { 112 for (size_t i = 0; i < arraysize(GetFirefoxImporterNameCases); ++i) {
113 base::WriteFile(app_ini_file, 113 base::WriteFile(app_ini_file,
114 GetFirefoxImporterNameCases[i].app_ini_content.c_str(), 114 GetFirefoxImporterNameCases[i].app_ini_content.c_str(),
115 GetFirefoxImporterNameCases[i].app_ini_content.size()); 115 GetFirefoxImporterNameCases[i].app_ini_content.size());
116 EXPECT_EQ(GetFirefoxImporterName(temp_dir.path()), 116 EXPECT_EQ(
117 GetFirefoxImporterName(temp_dir.GetPath()),
117 l10n_util::GetStringUTF16(GetFirefoxImporterNameCases[i].resource_id)); 118 l10n_util::GetStringUTF16(GetFirefoxImporterNameCases[i].resource_id));
118 } 119 }
119 EXPECT_EQ(l10n_util::GetStringUTF16( 120 EXPECT_EQ(l10n_util::GetStringUTF16(
120 IDS_IMPORT_FROM_FIREFOX), 121 IDS_IMPORT_FROM_FIREFOX),
121 GetFirefoxImporterName(base::FilePath( 122 GetFirefoxImporterName(base::FilePath(
122 FILE_PATH_LITERAL("/invalid/path")))); 123 FILE_PATH_LITERAL("/invalid/path"))));
123 } 124 }
124 125
125 TEST(FirefoxImporterUtilsTest, GetFirefoxProfilePath) { 126 TEST(FirefoxImporterUtilsTest, GetFirefoxProfilePath) {
126 base::DictionaryValue no_profiles; 127 base::DictionaryValue no_profiles;
(...skipping 26 matching lines...) Expand all
153 154
154 base::DictionaryValue default_second; 155 base::DictionaryValue default_second;
155 default_second.SetString("Profile0.Path", "first"); 156 default_second.SetString("Profile0.Path", "first");
156 default_second.SetString("Profile0.IsRelative", "0"); 157 default_second.SetString("Profile0.IsRelative", "0");
157 default_second.SetString("Profile1.Path", "second"); 158 default_second.SetString("Profile1.Path", "second");
158 default_second.SetString("Profile1.IsRelative", "0"); 159 default_second.SetString("Profile1.IsRelative", "0");
159 default_second.SetString("Profile1.Default", "1"); 160 default_second.SetString("Profile1.Default", "1");
160 EXPECT_EQ("second", 161 EXPECT_EQ("second",
161 GetFirefoxProfilePathFromDictionary(default_second).MaybeAsASCII()); 162 GetFirefoxProfilePathFromDictionary(default_second).MaybeAsASCII());
162 } 163 }
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager_browsertest.cc ('k') | components/filesystem/file_system_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698