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

Side by Side Diff: apps/app_restore_service_browsertest.cc

Issue 13023002: Change chrome.filesystem to handle the Chrome OS Drive file entries directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: COmment. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "apps/app_restore_service.h" 5 #include "apps/app_restore_service.h"
6 #include "apps/app_restore_service_factory.h" 6 #include "apps/app_restore_service_factory.h"
7 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" 7 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
8 #include "chrome/browser/extensions/api/file_system/file_system_api.h" 8 #include "chrome/browser/extensions/api/file_system/file_system_api.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 content::NotificationService::AllSources()); 63 content::NotificationService::AllSources());
64 64
65 base::ScopedTempDir temp_directory; 65 base::ScopedTempDir temp_directory;
66 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); 66 ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
67 base::FilePath temp_file; 67 base::FilePath temp_file;
68 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(), 68 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(),
69 &temp_file)); 69 &temp_file));
70 70
71 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( 71 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
72 &temp_file); 72 &temp_file);
73 FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest(
74 "temp", temp_directory.path());
73 75
74 ExtensionTestMessageListener file_written_listener("fileWritten", false); 76 ExtensionTestMessageListener file_written_listener("fileWritten", false);
75 ExtensionTestMessageListener access_ok_listener( 77 ExtensionTestMessageListener access_ok_listener(
76 "restartedFileAccessOK", false); 78 "restartedFileAccessOK", false);
77 79
78 const Extension* extension = 80 const Extension* extension =
79 LoadAndLaunchPlatformApp("file_access_saved_to_prefs_test"); 81 LoadAndLaunchPlatformApp("file_access_saved_to_prefs_test");
80 ASSERT_TRUE(extension); 82 ASSERT_TRUE(extension);
81 file_written_listener.WaitUntilSatisfied(); 83 file_written_listener.WaitUntilSatisfied();
82 84
(...skipping 21 matching lines...) Expand all
104 content::NotificationService::AllSources()); 106 content::NotificationService::AllSources());
105 107
106 base::ScopedTempDir temp_directory; 108 base::ScopedTempDir temp_directory;
107 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); 109 ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
108 base::FilePath temp_file; 110 base::FilePath temp_file;
109 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(), 111 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(),
110 &temp_file)); 112 &temp_file));
111 113
112 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( 114 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
113 &temp_file); 115 &temp_file);
116 FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest(
117 "temp", temp_directory.path());
114 118
115 ExtensionTestMessageListener file_written_listener("fileWritten", false); 119 ExtensionTestMessageListener file_written_listener("fileWritten", false);
116 ExtensionTestMessageListener access_ok_listener( 120 ExtensionTestMessageListener access_ok_listener(
117 "restartedFileAccessOK", false); 121 "restartedFileAccessOK", false);
118 122
119 const Extension* extension = 123 const Extension* extension =
120 LoadAndLaunchPlatformApp("file_access_restored_test"); 124 LoadAndLaunchPlatformApp("file_access_restored_test");
121 ASSERT_TRUE(extension); 125 ASSERT_TRUE(extension);
122 file_written_listener.WaitUntilSatisfied(); 126 file_written_listener.WaitUntilSatisfied();
123 127
(...skipping 16 matching lines...) Expand all
140 extension->id(), it->id, it->path, it->writable); 144 extension->id(), it->id, it->path, it->writable);
141 } 145 }
142 146
143 apps::AppRestoreServiceFactory::GetForProfile(browser()->profile())-> 147 apps::AppRestoreServiceFactory::GetForProfile(browser()->profile())->
144 HandleStartup(true); 148 HandleStartup(true);
145 149
146 access_ok_listener.WaitUntilSatisfied(); 150 access_ok_listener.WaitUntilSatisfied();
147 } 151 }
148 152
149 } // namespace apps 153 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698