| 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 "chrome/browser/extensions/extension_prefs_unittest.h" | 5 #include "chrome/browser/extensions/extension_prefs_unittest.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/prefs/mock_pref_change_callback.h" | 10 #include "base/prefs/mock_pref_change_callback.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 manifest.SetString(extension_manifest_keys::kVersion, | 445 manifest.SetString(extension_manifest_keys::kVersion, |
| 446 "1." + base::IntToString(num)); | 446 "1." + base::IntToString(num)); |
| 447 base::FilePath path = | 447 base::FilePath path = |
| 448 prefs_.extensions_dir().AppendASCII(base::IntToString(num)); | 448 prefs_.extensions_dir().AppendASCII(base::IntToString(num)); |
| 449 std::string errors; | 449 std::string errors; |
| 450 scoped_refptr<Extension> extension = Extension::Create( | 450 scoped_refptr<Extension> extension = Extension::Create( |
| 451 path, Manifest::INTERNAL, manifest, Extension::NO_FLAGS, id, &errors); | 451 path, Manifest::INTERNAL, manifest, Extension::NO_FLAGS, id, &errors); |
| 452 ASSERT_TRUE(extension.get()) << errors; | 452 ASSERT_TRUE(extension.get()) << errors; |
| 453 ASSERT_EQ(id, extension->id()); | 453 ASSERT_EQ(id, extension->id()); |
| 454 prefs()->SetDelayedInstallInfo(extension.get(), Extension::ENABLED, | 454 prefs()->SetDelayedInstallInfo(extension.get(), Extension::ENABLED, |
| 455 ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, |
| 455 syncer::StringOrdinal()); | 456 syncer::StringOrdinal()); |
| 456 } | 457 } |
| 457 | 458 |
| 458 // Verifies that we get back expected idle install information previously | 459 // Verifies that we get back expected idle install information previously |
| 459 // set by SetIdleInfo. | 460 // set by SetIdleInfo. |
| 460 void VerifyIdleInfo(std::string id, int num) { | 461 void VerifyIdleInfo(std::string id, int num) { |
| 461 scoped_ptr<ExtensionInfo> info(prefs()->GetDelayedInstallInfo(id)); | 462 scoped_ptr<ExtensionInfo> info(prefs()->GetDelayedInstallInfo(id)); |
| 462 ASSERT_TRUE(info); | 463 ASSERT_TRUE(info); |
| 463 std::string version; | 464 std::string version; |
| 464 ASSERT_TRUE(info->extension_manifest->GetString("version", &version)); | 465 ASSERT_TRUE(info->extension_manifest->GetString("version", &version)); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 | 751 |
| 751 private: | 752 private: |
| 752 scoped_refptr<const Extension> extension_a_; | 753 scoped_refptr<const Extension> extension_a_; |
| 753 scoped_refptr<const Extension> extension_b_; | 754 scoped_refptr<const Extension> extension_b_; |
| 754 scoped_refptr<const Extension> extension_c_; | 755 scoped_refptr<const Extension> extension_c_; |
| 755 }; | 756 }; |
| 756 TEST_F(ExtensionPrefsBlacklistedExtensions, | 757 TEST_F(ExtensionPrefsBlacklistedExtensions, |
| 757 ExtensionPrefsBlacklistedExtensions) {} | 758 ExtensionPrefsBlacklistedExtensions) {} |
| 758 | 759 |
| 759 } // namespace extensions | 760 } // namespace extensions |
| OLD | NEW |