| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/extensions/test_extension_prefs.h" | 5 #include "chrome/browser/extensions/test_extension_prefs.h" |
| 6 | 6 |
| 7 | 7 |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
| 14 #include "chrome/browser/extensions/extension_prefs.h" | 14 #include "chrome/browser/extensions/extension_prefs.h" |
| 15 #include "chrome/browser/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/pref_value_store.h" | 16 #include "chrome/browser/prefs/pref_value_store.h" |
| 17 #include "chrome/common/extensions/extension.h" | 17 #include "chrome/common/extensions/extension.h" |
| 18 #include "chrome/common/extensions/extension_constants.h" | 18 #include "chrome/common/extensions/extension_constants.h" |
| 19 #include "chrome/common/json_pref_store.h" | 19 #include "chrome/common/json_pref_store.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 TestExtensionPrefs::TestExtensionPrefs() { | 22 TestExtensionPrefs::TestExtensionPrefs() { |
| 23 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 23 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 24 preferences_file_ = temp_dir_.path().AppendASCII("Preferences"); | 24 preferences_file_ = temp_dir_.path().AppendASCII("Preferences"); |
| 25 extensions_dir_ = temp_dir_.path().AppendASCII("Extensions"); | 25 extensions_dir_ = temp_dir_.path().AppendASCII("Extensions"); |
| 26 EXPECT_TRUE(file_util::CreateDirectory(extensions_dir_)); | 26 EXPECT_TRUE(file_util::CreateDirectory(extensions_dir_)); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const bool kInitialIncognitoEnabled = false; | 67 const bool kInitialIncognitoEnabled = false; |
| 68 prefs_->OnExtensionInstalled(extension, Extension::ENABLED, | 68 prefs_->OnExtensionInstalled(extension, Extension::ENABLED, |
| 69 kInitialIncognitoEnabled); | 69 kInitialIncognitoEnabled); |
| 70 return extension; | 70 return extension; |
| 71 } | 71 } |
| 72 | 72 |
| 73 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { | 73 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { |
| 74 scoped_ptr<Extension> extension(AddExtension(name)); | 74 scoped_ptr<Extension> extension(AddExtension(name)); |
| 75 return extension->id(); | 75 return extension->id(); |
| 76 } | 76 } |
| OLD | NEW |