| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return true; | 214 return true; |
| 215 #endif | 215 #endif |
| 216 | 216 |
| 217 base::FilePath profile_dir; | 217 base::FilePath profile_dir; |
| 218 EXPECT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &profile_dir)); | 218 EXPECT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &profile_dir)); |
| 219 profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); | 219 profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); |
| 220 | 220 |
| 221 // Sanity check that old protected pref file is never present in modern | 221 // Sanity check that old protected pref file is never present in modern |
| 222 // Chromes. | 222 // Chromes. |
| 223 EXPECT_FALSE(base::PathExists( | 223 EXPECT_FALSE(base::PathExists( |
| 224 profile_dir.Append(chrome::kProtectedPreferencesFilenameDeprecated))); | 224 profile_dir.Append(FILE_PATH_LITERAL("Protected Preferences")))); |
| 225 | 225 |
| 226 // Read the preferences from disk. | 226 // Read the preferences from disk. |
| 227 | 227 |
| 228 const base::FilePath unprotected_pref_file = | 228 const base::FilePath unprotected_pref_file = |
| 229 profile_dir.Append(chrome::kPreferencesFilename); | 229 profile_dir.Append(chrome::kPreferencesFilename); |
| 230 EXPECT_TRUE(base::PathExists(unprotected_pref_file)); | 230 EXPECT_TRUE(base::PathExists(unprotected_pref_file)); |
| 231 | 231 |
| 232 const base::FilePath protected_pref_file = | 232 const base::FilePath protected_pref_file = |
| 233 profile_dir.Append(chrome::kSecurePreferencesFilename); | 233 profile_dir.Append(chrome::kSecurePreferencesFilename); |
| 234 EXPECT_EQ(protection_level_ > PROTECTION_DISABLED_ON_PLATFORM, | 234 EXPECT_EQ(protection_level_ > PROTECTION_DISABLED_ON_PLATFORM, |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 EXPECT_EQ(DefaultSearchManager::FROM_FALLBACK, dse_source); | 1271 EXPECT_EQ(DefaultSearchManager::FROM_FALLBACK, dse_source); |
| 1272 EXPECT_NE(current_dse->keyword(), base::UTF8ToUTF16("badkeyword")); | 1272 EXPECT_NE(current_dse->keyword(), base::UTF8ToUTF16("badkeyword")); |
| 1273 EXPECT_NE(current_dse->short_name(), base::UTF8ToUTF16("badname")); | 1273 EXPECT_NE(current_dse->short_name(), base::UTF8ToUTF16("badname")); |
| 1274 EXPECT_NE(current_dse->url(), | 1274 EXPECT_NE(current_dse->url(), |
| 1275 "http://bad_default_engine/search?q=dirty_user_query"); | 1275 "http://bad_default_engine/search?q=dirty_user_query"); |
| 1276 } | 1276 } |
| 1277 } | 1277 } |
| 1278 }; | 1278 }; |
| 1279 | 1279 |
| 1280 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestDefaultSearch, SearchProtected); | 1280 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestDefaultSearch, SearchProtected); |
| OLD | NEW |