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