diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 20:59:51 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 20:59:51 +0000 |
commit | de0f8b44606071e1a31e7414c769535096c1698a (patch) | |
tree | 075fa43cf315f7c063904e13d8a35bfa29d999ad /apps/app_restore_service_browsertest.cc | |
parent | ac5df2d14086f27238b0a92782f1bc4a38054db7 (diff) | |
download | chromium_src-de0f8b44606071e1a31e7414c769535096c1698a.zip chromium_src-de0f8b44606071e1a31e7414c769535096c1698a.tar.gz chromium_src-de0f8b44606071e1a31e7414c769535096c1698a.tar.bz2 |
Move FileEntry code from ExtensionPrefs to FileHandlersAPI
BUG=180083
TBR=ben@chromium.org (gypi)
Review URL: https://chromiumcodereview.appspot.com/14735002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_restore_service_browsertest.cc')
-rw-r--r-- | apps/app_restore_service_browsertest.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/apps/app_restore_service_browsertest.cc b/apps/app_restore_service_browsertest.cc index d0dac93b..a335617e 100644 --- a/apps/app_restore_service_browsertest.cc +++ b/apps/app_restore_service_browsertest.cc @@ -82,20 +82,21 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) { ASSERT_TRUE(extension); file_written_listener.WaitUntilSatisfied(); - ExtensionService* extension_service = - ExtensionSystem::Get(browser()->profile())->extension_service(); - ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); + ExtensionPrefs* extension_prefs = + ExtensionSystem::Get(browser()->profile())->extension_prefs(); // Record the file entries in prefs because when the app gets suspended it // will have them all cleared. std::vector<SavedFileEntry> file_entries; - extension_prefs->GetSavedFileEntries(extension->id(), &file_entries); + extensions::app_file_handler_util::GetSavedFileEntries( + extension_prefs, extension->id(), &file_entries); // One for the read-only file entry and one for the writable file entry. ASSERT_EQ(2u, file_entries.size()); extension_suspended.Wait(); file_entries.clear(); - extension_prefs->GetSavedFileEntries(extension->id(), &file_entries); + extensions::app_file_handler_util::GetSavedFileEntries( + extension_prefs, extension->id(), &file_entries); // File entries should be cleared when the extension is suspended. ASSERT_TRUE(file_entries.empty()); } @@ -125,14 +126,14 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsRestored) { ASSERT_TRUE(extension); file_written_listener.WaitUntilSatisfied(); - ExtensionService* extension_service = - ExtensionSystem::Get(browser()->profile())->extension_service(); - ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); - + ExtensionPrefs* extension_prefs = + ExtensionSystem::Get(browser()->profile())->extension_prefs(); // Record the file entries in prefs because when the app gets suspended it // will have them all cleared. std::vector<SavedFileEntry> file_entries; - extension_prefs->GetSavedFileEntries(extension->id(), &file_entries); + extensions::app_file_handler_util::GetSavedFileEntries(extension_prefs, + extension->id(), + &file_entries); extension_suspended.Wait(); // Simulate a restart by populating the preferences as if the browser didn't @@ -140,8 +141,8 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsRestored) { extension_prefs->SetExtensionRunning(extension->id(), true); for (std::vector<SavedFileEntry>::const_iterator it = file_entries.begin(); it != file_entries.end(); ++it) { - extension_prefs->AddSavedFileEntry( - extension->id(), it->id, it->path, it->writable); + extensions::app_file_handler_util::AddSavedFileEntry( + extension_prefs, extension->id(), it->id, it->path, it->writable); } apps::AppRestoreServiceFactory::GetForProfile(browser()->profile())-> |