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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 844 |
845 // Clear the registered events to ensure they are updated. | 845 // Clear the registered events to ensure they are updated. |
846 extension_prefs->SetRegisteredEvents(extension->id(), | 846 extension_prefs->SetRegisteredEvents(extension->id(), |
847 std::set<std::string>()); | 847 std::set<std::string>()); |
848 | 848 |
849 const base::StringValue old_version("1"); | 849 const base::StringValue old_version("1"); |
850 std::string pref_path("extensions.settings."); | 850 std::string pref_path("extensions.settings."); |
851 pref_path += extension->id(); | 851 pref_path += extension->id(); |
852 pref_path += ".manifest.version"; | 852 pref_path += ".manifest.version"; |
853 // TODO(joi): Do registrations up front. | 853 // TODO(joi): Do registrations up front. |
854 PrefRegistrySyncable* registry = static_cast<PrefRegistrySyncable*>( | 854 user_prefs::PrefRegistrySyncable* registry = |
855 extension_prefs->pref_service()->DeprecatedGetPrefRegistry()); | 855 static_cast<user_prefs::PrefRegistrySyncable*>( |
| 856 extension_prefs->pref_service()->DeprecatedGetPrefRegistry()); |
856 registry->RegisterStringPref( | 857 registry->RegisterStringPref( |
857 pref_path.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); | 858 pref_path.c_str(), |
| 859 std::string(), |
| 860 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
858 extension_prefs->pref_service()->Set(pref_path.c_str(), old_version); | 861 extension_prefs->pref_service()->Set(pref_path.c_str(), old_version); |
859 } | 862 } |
860 | 863 |
861 // Component App Test 3 of 3: simulate a component extension upgrade that | 864 // Component App Test 3 of 3: simulate a component extension upgrade that |
862 // re-adds the OnLaunched event, and allows the app to be launched. | 865 // re-adds the OnLaunched event, and allows the app to be launched. |
863 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) { | 866 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) { |
864 CheckExtensionInstalledObserver should_install; | 867 CheckExtensionInstalledObserver should_install; |
865 // Since we are forcing an upgrade, we need to wait for the load again. | 868 // Since we are forcing an upgrade, we need to wait for the load again. |
866 content::WindowedNotificationObserver app_loaded_observer( | 869 content::WindowedNotificationObserver app_loaded_observer( |
867 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 870 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 | 974 |
972 while (!ContainsKey(opener_app_ids_, file_manager->id())) { | 975 while (!ContainsKey(opener_app_ids_, file_manager->id())) { |
973 content::RunAllPendingInMessageLoop(); | 976 content::RunAllPendingInMessageLoop(); |
974 } | 977 } |
975 } | 978 } |
976 | 979 |
977 #endif // defined(OS_CHROMEOS) | 980 #endif // defined(OS_CHROMEOS) |
978 | 981 |
979 | 982 |
980 } // namespace extensions | 983 } // namespace extensions |
OLD | NEW |