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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/values.h" | 6 #include "base/values.h" |
7 #include "chrome/browser/extensions/extension_pref_value_map.h" | 7 #include "chrome/browser/extensions/extension_pref_value_map.h" |
8 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" | 8 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" |
9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 TEST_F(ProtectedPrefsWatcherTest, ExtensionPrefChange) { | 100 TEST_F(ProtectedPrefsWatcherTest, ExtensionPrefChange) { |
101 // Changes to extensions data (but not to extension IDs) do not update | 101 // Changes to extensions data (but not to extension IDs) do not update |
102 // the backup and its signature. | 102 // the backup and its signature. |
103 MessageLoopForUI message_loop; | 103 MessageLoopForUI message_loop; |
104 content::TestBrowserThread ui_thread(content::BrowserThread::UI, | 104 content::TestBrowserThread ui_thread(content::BrowserThread::UI, |
105 &message_loop); | 105 &message_loop); |
106 | 106 |
107 FilePath extensions_install_dir = | 107 FilePath extensions_install_dir = |
108 profile_.GetPath().AppendASCII(ExtensionService::kInstallDirectoryName); | 108 profile_.GetPath().AppendASCII(ExtensionService::kInstallDirectoryName); |
109 scoped_ptr<ExtensionPrefs> extension_prefs( | 109 scoped_ptr<extensions::ExtensionPrefs> extension_prefs( |
110 new ExtensionPrefs(profile_.GetPrefs(), | 110 new extensions::ExtensionPrefs(profile_.GetPrefs(), |
111 extensions_install_dir, | 111 extensions_install_dir, |
112 ExtensionPrefValueMapFactory::GetForProfile( | 112 ExtensionPrefValueMapFactory::GetForProfile( |
113 &profile_))); | 113 &profile_))); |
114 std::string sample_id = extension_misc::kWebStoreAppId; | 114 std::string sample_id = extension_misc::kWebStoreAppId; |
115 extension_prefs->Init(false); | 115 extension_prefs->Init(false); |
116 // Flip a pref value of an extension (this will actually add it to the list). | 116 // Flip a pref value of an extension (this will actually add it to the list). |
117 extension_prefs->SetAppNotificationDisabled( | 117 extension_prefs->SetAppNotificationDisabled( |
118 sample_id, !extension_prefs->IsAppNotificationDisabled(sample_id)); | 118 sample_id, !extension_prefs->IsAppNotificationDisabled(sample_id)); |
119 | 119 |
120 // Backup is still valid. | 120 // Backup is still valid. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 std::string(prefs::kHomePageIsNewTabPage)); | 284 std::string(prefs::kHomePageIsNewTabPage)); |
285 EXPECT_EQ("browser.show_home_button", std::string(prefs::kShowHomeButton)); | 285 EXPECT_EQ("browser.show_home_button", std::string(prefs::kShowHomeButton)); |
286 EXPECT_EQ("session.restore_on_startup", | 286 EXPECT_EQ("session.restore_on_startup", |
287 std::string(prefs::kRestoreOnStartup)); | 287 std::string(prefs::kRestoreOnStartup)); |
288 EXPECT_EQ("session.urls_to_restore_on_startup", | 288 EXPECT_EQ("session.urls_to_restore_on_startup", |
289 std::string(prefs::kURLsToRestoreOnStartup)); | 289 std::string(prefs::kURLsToRestoreOnStartup)); |
290 EXPECT_EQ("pinned_tabs", std::string(prefs::kPinnedTabs)); | 290 EXPECT_EQ("pinned_tabs", std::string(prefs::kPinnedTabs)); |
291 } | 291 } |
292 | 292 |
293 } // namespace protector | 293 } // namespace protector |
OLD | NEW |