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 <utility> | |
8 | |
9 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
10 #include "base/path_service.h" | 8 #include "base/path_service.h" |
11 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
12 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
14 #include "base/time/time.h" | 12 #include "base/time/time.h" |
15 #include "base/values.h" | 13 #include "base/values.h" |
16 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
17 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
18 #include "components/prefs/mock_pref_change_callback.h" | 16 #include "components/prefs/mock_pref_change_callback.h" |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 prefs_.AddExtensionWithManifest(dictionary, Manifest::INTERNAL); | 565 prefs_.AddExtensionWithManifest(dictionary, Manifest::INTERNAL); |
568 id_ = extension->id(); | 566 id_ = extension->id(); |
569 | 567 |
570 | 568 |
571 // Set idle info | 569 // Set idle info |
572 base::DictionaryValue manifest; | 570 base::DictionaryValue manifest; |
573 manifest.SetString(manifest_keys::kName, "test"); | 571 manifest.SetString(manifest_keys::kName, "test"); |
574 manifest.SetString(manifest_keys::kVersion, "0.2"); | 572 manifest.SetString(manifest_keys::kVersion, "0.2"); |
575 std::unique_ptr<base::ListValue> scripts(new base::ListValue); | 573 std::unique_ptr<base::ListValue> scripts(new base::ListValue); |
576 scripts->AppendString("test.js"); | 574 scripts->AppendString("test.js"); |
577 manifest.Set(manifest_keys::kBackgroundScripts, std::move(scripts)); | 575 manifest.Set(manifest_keys::kBackgroundScripts, scripts.release()); |
578 base::FilePath path = | 576 base::FilePath path = |
579 prefs_.extensions_dir().AppendASCII("test_0.2"); | 577 prefs_.extensions_dir().AppendASCII("test_0.2"); |
580 std::string errors; | 578 std::string errors; |
581 scoped_refptr<Extension> new_extension = Extension::Create( | 579 scoped_refptr<Extension> new_extension = Extension::Create( |
582 path, Manifest::INTERNAL, manifest, Extension::NO_FLAGS, id_, &errors); | 580 path, Manifest::INTERNAL, manifest, Extension::NO_FLAGS, id_, &errors); |
583 ASSERT_TRUE(new_extension.get()) << errors; | 581 ASSERT_TRUE(new_extension.get()) << errors; |
584 ASSERT_EQ(id_, new_extension->id()); | 582 ASSERT_EQ(id_, new_extension->id()); |
585 prefs()->SetDelayedInstallInfo(new_extension.get(), | 583 prefs()->SetDelayedInstallInfo(new_extension.get(), |
586 Extension::ENABLED, | 584 Extension::ENABLED, |
587 kInstallFlagNone, | 585 kInstallFlagNone, |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 | 991 |
994 private: | 992 private: |
995 std::unique_ptr<const PermissionSet> active_perms_; | 993 std::unique_ptr<const PermissionSet> active_perms_; |
996 scoped_refptr<Extension> component_extension_; | 994 scoped_refptr<Extension> component_extension_; |
997 scoped_refptr<Extension> no_component_extension_; | 995 scoped_refptr<Extension> no_component_extension_; |
998 }; | 996 }; |
999 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { | 997 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { |
1000 } | 998 } |
1001 | 999 |
1002 } // namespace extensions | 1000 } // namespace extensions |
OLD | NEW |