| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| 11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "chrome/test/base/testing_profile.h" |
| 14 | 15 |
| 15 class PrefsTabHelperBrowserTest : public InProcessBrowserTest { | 16 class PrefsTabHelperBrowserTest : public InProcessBrowserTest { |
| 16 protected: | 17 protected: |
| 17 virtual FilePath GetPreferencesFilePath() { | 18 virtual FilePath GetPreferencesFilePath() { |
| 18 FilePath test_data_directory; | 19 FilePath test_data_directory; |
| 19 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory); | 20 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory); |
| 20 return test_data_directory | 21 return test_data_directory |
| 21 .AppendASCII("profiles") | 22 .AppendASCII("profiles") |
| 22 .AppendASCII("webkit_global_migration") | 23 .AppendASCII("webkit_global_migration") |
| 23 .AppendASCII("Default") | 24 .AppendASCII("Default") |
| 24 .Append(chrome::kPreferencesFilename); | 25 .Append(chrome::kPreferencesFilename); |
| 25 } | 26 } |
| 26 | 27 |
| 27 virtual bool SetUpUserDataDirectory() OVERRIDE { | 28 virtual bool SetUpUserDataDirectory() OVERRIDE { |
| 28 FilePath user_data_directory; | 29 FilePath user_data_directory; |
| 29 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); | 30 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); |
| 30 FilePath default_profile = user_data_directory.AppendASCII("Default"); | 31 FilePath default_profile = |
| 32 user_data_directory.AppendASCII(TestingProfile::kTestUserProfileDir); |
| 31 if (!file_util::CreateDirectory(default_profile)) { | 33 if (!file_util::CreateDirectory(default_profile)) { |
| 32 LOG(ERROR) << "Can't create " << default_profile.MaybeAsASCII(); | 34 LOG(ERROR) << "Can't create " << default_profile.MaybeAsASCII(); |
| 33 return false; | 35 return false; |
| 34 } | 36 } |
| 35 FilePath non_global_pref_file = GetPreferencesFilePath(); | 37 FilePath non_global_pref_file = GetPreferencesFilePath(); |
| 36 if (!file_util::PathExists(non_global_pref_file)) { | 38 if (!file_util::PathExists(non_global_pref_file)) { |
| 37 LOG(ERROR) << "Doesn't exist " << non_global_pref_file.MaybeAsASCII(); | 39 LOG(ERROR) << "Doesn't exist " << non_global_pref_file.MaybeAsASCII(); |
| 38 return false; | 40 return false; |
| 39 } | 41 } |
| 40 FilePath default_pref_file = | 42 FilePath default_pref_file = |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 prefs->GetString(prefs::kWebKitFantasyFontFamily)); | 159 prefs->GetString(prefs::kWebKitFantasyFontFamily)); |
| 158 EXPECT_EQ("FixedFontFamily", | 160 EXPECT_EQ("FixedFontFamily", |
| 159 prefs->GetString(prefs::kWebKitFixedFontFamily)); | 161 prefs->GetString(prefs::kWebKitFixedFontFamily)); |
| 160 EXPECT_EQ("SansSerifFontFamily", | 162 EXPECT_EQ("SansSerifFontFamily", |
| 161 prefs->GetString(prefs::kWebKitSansSerifFontFamily)); | 163 prefs->GetString(prefs::kWebKitSansSerifFontFamily)); |
| 162 EXPECT_EQ("SerifFontFamily", | 164 EXPECT_EQ("SerifFontFamily", |
| 163 prefs->GetString(prefs::kWebKitSerifFontFamily)); | 165 prefs->GetString(prefs::kWebKitSerifFontFamily)); |
| 164 EXPECT_EQ("StandardFontFamily", | 166 EXPECT_EQ("StandardFontFamily", |
| 165 prefs->GetString(prefs::kWebKitStandardFontFamily)); | 167 prefs->GetString(prefs::kWebKitStandardFontFamily)); |
| 166 }; | 168 }; |
| OLD | NEW |