| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // Class that contains a PrefService and handles cleanup of a temporary file | 68 // Class that contains a PrefService and handles cleanup of a temporary file |
| 69 // backing it. | 69 // backing it. |
| 70 class ScopedTempPrefService { | 70 class ScopedTempPrefService { |
| 71 public: | 71 public: |
| 72 ScopedTempPrefService() { | 72 ScopedTempPrefService() { |
| 73 // Make sure different tests won't use the same prefs file. It will cause | 73 // Make sure different tests won't use the same prefs file. It will cause |
| 74 // problem when different tests are running in parallel. | 74 // problem when different tests are running in parallel. |
| 75 temp_dir_.CreateUniqueTempDir(); | 75 temp_dir_.CreateUniqueTempDir(); |
| 76 FilePath pref_file = temp_dir_.path().AppendASCII("prefs"); | 76 FilePath pref_file = temp_dir_.path().AppendASCII("prefs"); |
| 77 prefs_.reset(new PrefService(pref_file, NULL)); | 77 prefs_.reset(new PrefService(pref_file)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 ~ScopedTempPrefService() {} | 80 ~ScopedTempPrefService() {} |
| 81 | 81 |
| 82 PrefService* get() { | 82 PrefService* get() { |
| 83 return prefs_.get(); | 83 return prefs_.get(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 // Ordering matters, we want |prefs_| to be destroyed before |temp_dir_|. | 87 // Ordering matters, we want |prefs_| to be destroyed before |temp_dir_|. |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 // -prodversionmin (shouldn't update if browser version too old) | 627 // -prodversionmin (shouldn't update if browser version too old) |
| 628 // -manifests & updates arriving out of order / interleaved | 628 // -manifests & updates arriving out of order / interleaved |
| 629 // -Profile::GetDefaultRequestContext() returning null | 629 // -Profile::GetDefaultRequestContext() returning null |
| 630 // (should not crash, but just do check later) | 630 // (should not crash, but just do check later) |
| 631 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 631 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
| 632 // -An extension gets uninstalled while updates are in progress (so it doesn't | 632 // -An extension gets uninstalled while updates are in progress (so it doesn't |
| 633 // "come back from the dead") | 633 // "come back from the dead") |
| 634 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 634 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
| 635 // you don't get downgraded accidentally) | 635 // you don't get downgraded accidentally) |
| 636 // -An update manifest mentions multiple updates | 636 // -An update manifest mentions multiple updates |
| OLD | NEW |