Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 void SetPrefInteg(const std::string& extension_id, 733 void SetPrefInteg(const std::string& extension_id,
734 const std::string& pref_path, 734 const std::string& pref_path,
735 int value) { 735 int value) {
736 std::string msg = " while setting: "; 736 std::string msg = " while setting: ";
737 msg += extension_id; 737 msg += extension_id;
738 msg += " "; 738 msg += " ";
739 msg += pref_path; 739 msg += pref_path;
740 msg += " = "; 740 msg += " = ";
741 msg += base::IntToString(value); 741 msg += base::IntToString(value);
742 742
743 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); 743 SetPref(extension_id, pref_path, new base::Value(value), msg);
744 } 744 }
745 745
746 void SetPrefBool(const std::string& extension_id, 746 void SetPrefBool(const std::string& extension_id,
747 const std::string& pref_path, 747 const std::string& pref_path,
748 bool value) { 748 bool value) {
749 std::string msg = " while setting: "; 749 std::string msg = " while setting: ";
750 msg += extension_id + " " + pref_path; 750 msg += extension_id + " " + pref_path;
751 msg += " = "; 751 msg += " = ";
752 msg += (value ? "true" : "false"); 752 msg += (value ? "true" : "false");
753 753
754 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); 754 SetPref(extension_id, pref_path, new base::Value(value), msg);
755 } 755 }
756 756
757 void ClearPref(const std::string& extension_id, 757 void ClearPref(const std::string& extension_id,
758 const std::string& pref_path) { 758 const std::string& pref_path) {
759 std::string msg = " while clearing: "; 759 std::string msg = " while clearing: ";
760 msg += extension_id + " " + pref_path; 760 msg += extension_id + " " + pref_path;
761 761
762 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings"); 762 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings");
763 base::DictionaryValue* dict = update.Get(); 763 base::DictionaryValue* dict = update.Get();
764 ASSERT_TRUE(dict != NULL) << msg; 764 ASSERT_TRUE(dict != NULL) << msg;
(...skipping 6431 matching lines...) Expand 10 before | Expand all | Expand 10 after
7196 shared_module->manifest()->type()); 7196 shared_module->manifest()->type());
7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); 7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId));
7198 7198
7199 // Reload the extension and wait for it to complete. This previously crashed 7199 // Reload the extension and wait for it to complete. This previously crashed
7200 // (see crbug.com/676815). 7200 // (see crbug.com/676815).
7201 service()->ReloadExtension(kExtensionId); 7201 service()->ReloadExtension(kExtensionId);
7202 base::RunLoop().RunUntilIdle(); 7202 base::RunLoop().RunUntilIdle();
7203 // The shared module should be enabled. 7203 // The shared module should be enabled.
7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); 7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId));
7205 } 7205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698