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