edd294c6a0f655239c8c96d08c9923d10540d8bd
[platform/framework/web/crosswalk.git] / src / chrome / browser / media_galleries / fileapi / picasa_file_util_unittest.cc
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <set>
6 #include <string>
7 #include <vector>
8
9 #include "base/bind_helpers.h"
10 #include "base/file_util.h"
11 #include "base/files/file_path.h"
12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_vector.h"
15 #include "base/message_loop/message_loop.h"
16 #include "base/message_loop/message_loop_proxy.h"
17 #include "base/platform_file.h"
18 #include "base/run_loop.h"
19 #include "base/strings/stringprintf.h"
20 #include "base/time/time.h"
21 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
22 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
23 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"
24 #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"
25 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
26 #include "chrome/common/media_galleries/picasa_types.h"
27 #include "chrome/common/media_galleries/pmp_constants.h"
28 #include "content/public/browser/browser_thread.h"
29 #include "content/public/test/test_browser_thread.h"
30 #include "content/public/test/test_file_system_options.h"
31 #include "testing/gtest/include/gtest/gtest.h"
32 #include "webkit/browser/fileapi/async_file_util.h"
33 #include "webkit/browser/fileapi/external_mount_points.h"
34 #include "webkit/browser/fileapi/file_system_context.h"
35 #include "webkit/browser/fileapi/file_system_operation_context.h"
36 #include "webkit/browser/fileapi/file_system_operation_runner.h"
37 #include "webkit/browser/fileapi/isolated_context.h"
38 #include "webkit/browser/quota/mock_special_storage_policy.h"
39 #include "webkit/common/blob/shareable_file_reference.h"
40
41 using fileapi::FileSystemOperationContext;
42 using fileapi::FileSystemOperation;
43 using fileapi::FileSystemURL;
44
45 namespace picasa {
46
47 namespace {
48
49 base::Time::Exploded test_date_exploded = { 2013, 4, 0, 16, 0, 0, 0, 0 };
50
51 bool WriteJPEGHeader(const base::FilePath& path) {
52   const char kJpegHeader[] = "\xFF\xD8\xFF";  // Per HTML5 specification.
53   return base::WriteFile(path, kJpegHeader, arraysize(kJpegHeader)) != -1;
54 }
55
56 class TestFolder {
57  public:
58   TestFolder(const std::string& name, const base::Time& timestamp,
59              const std::string& uid, unsigned int image_files,
60              unsigned int non_image_files)
61       : name_(name),
62         timestamp_(timestamp),
63         uid_(uid),
64         image_files_(image_files),
65         non_image_files_(non_image_files),
66         folder_info_("", base::Time(), "", base::FilePath()) {
67   }
68
69   bool Init() {
70     if (!folder_dir_.CreateUniqueTempDir())
71       return false;
72
73     folder_info_ = AlbumInfo(name_, timestamp_, uid_, folder_dir_.path());
74
75     for (unsigned int i = 0; i < image_files_; ++i) {
76       std::string image_filename = base::StringPrintf("img%05d.jpg", i);
77       image_filenames_.insert(image_filename);
78
79       base::FilePath path = folder_dir_.path().AppendASCII(image_filename);
80
81       if (!WriteJPEGHeader(path))
82         return false;
83     }
84
85     for (unsigned int i = 0; i < non_image_files_; ++i) {
86       base::FilePath path = folder_dir_.path().AppendASCII(
87           base::StringPrintf("hello%05d.txt", i));
88       if (base::WriteFile(path, NULL, 0) == -1)
89         return false;
90     }
91
92     return true;
93   }
94
95   double GetVariantTimestamp() const {
96     DCHECK(!folder_dir_.path().empty());
97     base::Time variant_epoch = base::Time::FromLocalExploded(
98         picasa::kPmpVariantTimeEpoch);
99
100     int64 microseconds_since_epoch =
101         (folder_info_.timestamp - variant_epoch).InMicroseconds();
102
103     return static_cast<double>(microseconds_since_epoch) /
104                                base::Time::kMicrosecondsPerDay;
105   }
106
107   const std::set<std::string>& image_filenames() const {
108     DCHECK(!folder_dir_.path().empty());
109     return image_filenames_;
110   }
111
112   const AlbumInfo& folder_info() const {
113     DCHECK(!folder_dir_.path().empty());
114     return folder_info_;
115   }
116
117   const base::Time& timestamp() const {
118     return timestamp_;
119   }
120
121  private:
122   const std::string name_;
123   const base::Time timestamp_;
124   const std::string uid_;
125   unsigned int image_files_;
126   unsigned int non_image_files_;
127
128   std::set<std::string> image_filenames_;
129
130   base::ScopedTempDir folder_dir_;
131   AlbumInfo folder_info_;
132 };
133
134 void ReadDirectoryTestHelperCallback(
135     base::RunLoop* run_loop,
136     FileSystemOperation::FileEntryList* contents,
137     bool* completed, base::File::Error error,
138     const FileSystemOperation::FileEntryList& file_list,
139     bool has_more) {
140   DCHECK(!*completed);
141   *completed = !has_more && error == base::File::FILE_OK;
142   *contents = file_list;
143   run_loop->Quit();
144 }
145
146 void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner,
147                              const FileSystemURL& url,
148                              FileSystemOperation::FileEntryList* contents,
149                              bool* completed) {
150   DCHECK(contents);
151   DCHECK(completed);
152   base::RunLoop run_loop;
153   runner->ReadDirectory(
154       url, base::Bind(&ReadDirectoryTestHelperCallback, &run_loop, contents,
155                       completed));
156   run_loop.Run();
157 }
158
159 void SynchronouslyRunOnMediaTaskRunner(const base::Closure& closure) {
160   base::RunLoop loop;
161   MediaFileSystemBackend::MediaTaskRunner()->PostTaskAndReply(
162       FROM_HERE,
163       closure,
164       loop.QuitClosure());
165   loop.Run();
166 }
167
168 void CreateSnapshotFileTestHelperCallback(
169     base::RunLoop* run_loop,
170     base::File::Error* error,
171     base::FilePath* platform_path_result,
172     base::File::Error result,
173     const base::File::Info& file_info,
174     const base::FilePath& platform_path,
175     const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
176   DCHECK(run_loop);
177   DCHECK(error);
178   DCHECK(platform_path_result);
179
180   *error = result;
181   *platform_path_result = platform_path;
182   run_loop->Quit();
183 }
184
185 }  // namespace
186
187 class TestPicasaFileUtil : public PicasaFileUtil {
188  public:
189   TestPicasaFileUtil(MediaPathFilter* media_path_filter,
190                      PicasaDataProvider* data_provider)
191       : PicasaFileUtil(media_path_filter),
192         data_provider_(data_provider) {
193   }
194   virtual ~TestPicasaFileUtil() {}
195  private:
196   virtual PicasaDataProvider* GetDataProvider() OVERRIDE {
197     return data_provider_;
198   }
199
200   PicasaDataProvider* data_provider_;
201 };
202
203 class TestMediaFileSystemBackend : public MediaFileSystemBackend {
204  public:
205   TestMediaFileSystemBackend(const base::FilePath& profile_path,
206                              PicasaFileUtil* picasa_file_util)
207       : MediaFileSystemBackend(profile_path,
208                                MediaFileSystemBackend::MediaTaskRunner().get()),
209         test_file_util_(picasa_file_util) {}
210
211   virtual fileapi::AsyncFileUtil*
212   GetAsyncFileUtil(fileapi::FileSystemType type) OVERRIDE {
213     if (type != fileapi::kFileSystemTypePicasa)
214       return NULL;
215
216     return test_file_util_.get();
217   }
218
219  private:
220   scoped_ptr<fileapi::AsyncFileUtil> test_file_util_;
221 };
222
223 class PicasaFileUtilTest : public testing::Test {
224  public:
225   PicasaFileUtilTest()
226       : io_thread_(content::BrowserThread::IO, &message_loop_) {
227   }
228   virtual ~PicasaFileUtilTest() {}
229
230   virtual void SetUp() OVERRIDE {
231     ASSERT_TRUE(profile_dir_.CreateUniqueTempDir());
232     ImportedMediaGalleryRegistry::GetInstance()->Initialize();
233
234     scoped_refptr<quota::SpecialStoragePolicy> storage_policy =
235         new quota::MockSpecialStoragePolicy();
236
237     SynchronouslyRunOnMediaTaskRunner(base::Bind(
238         &PicasaFileUtilTest::SetUpOnMediaTaskRunner, base::Unretained(this)));
239
240     media_path_filter_.reset(new MediaPathFilter());
241
242     ScopedVector<fileapi::FileSystemBackend> additional_providers;
243     additional_providers.push_back(new TestMediaFileSystemBackend(
244         profile_dir_.path(),
245         new TestPicasaFileUtil(media_path_filter_.get(),
246                                picasa_data_provider_.get())));
247
248     file_system_context_ = new fileapi::FileSystemContext(
249         base::MessageLoopProxy::current().get(),
250         base::MessageLoopProxy::current().get(),
251         fileapi::ExternalMountPoints::CreateRefCounted().get(),
252         storage_policy.get(),
253         NULL,
254         additional_providers.Pass(),
255         std::vector<fileapi::URLRequestAutoMountHandler>(),
256         profile_dir_.path(),
257         content::CreateAllowFileAccessOptions());
258   }
259
260   virtual void TearDown() OVERRIDE {
261     SynchronouslyRunOnMediaTaskRunner(
262         base::Bind(&PicasaFileUtilTest::TearDownOnMediaTaskRunner,
263                    base::Unretained(this)));
264   }
265
266  protected:
267   void SetUpOnMediaTaskRunner() {
268     picasa_data_provider_.reset(new PicasaDataProvider(base::FilePath()));
269   }
270
271   void TearDownOnMediaTaskRunner() {
272     picasa_data_provider_.reset();
273   }
274
275   // |test_folders| must be in alphabetical order for easy verification
276   void SetupFolders(ScopedVector<TestFolder>* test_folders,
277                     const std::vector<AlbumInfo>& albums,
278                     const AlbumImagesMap& albums_images) {
279     std::vector<AlbumInfo> folders;
280     for (ScopedVector<TestFolder>::iterator it = test_folders->begin();
281         it != test_folders->end(); ++it) {
282       TestFolder* test_folder = *it;
283       ASSERT_TRUE(test_folder->Init());
284       folders.push_back(test_folder->folder_info());
285     }
286
287     PicasaDataProvider::UniquifyNames(albums,
288                                       &picasa_data_provider_->album_map_);
289     PicasaDataProvider::UniquifyNames(folders,
290                                       &picasa_data_provider_->folder_map_);
291     picasa_data_provider_->albums_images_ = albums_images;
292     picasa_data_provider_->state_ =
293         PicasaDataProvider::ALBUMS_IMAGES_FRESH_STATE;
294   }
295
296   void VerifyFolderDirectoryList(const ScopedVector<TestFolder>& test_folders) {
297     FileSystemOperation::FileEntryList contents;
298     FileSystemURL url = CreateURL(kPicasaDirFolders);
299     bool completed = false;
300     ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
301
302     ASSERT_TRUE(completed);
303     ASSERT_EQ(test_folders.size(), contents.size());
304
305     for (size_t i = 0; i < contents.size(); ++i) {
306       EXPECT_TRUE(contents[i].is_directory);
307
308       // Because the timestamp is written out as a floating point Microsoft
309       // variant time, we only expect it to be accurate to within a second.
310       base::TimeDelta delta = test_folders[i]->folder_info().timestamp -
311                               contents[i].last_modified_time;
312       EXPECT_LT(delta, base::TimeDelta::FromSeconds(1));
313
314       FileSystemOperation::FileEntryList folder_contents;
315       FileSystemURL folder_url = CreateURL(
316           std::string(kPicasaDirFolders) + "/" +
317           base::FilePath(contents[i].name).AsUTF8Unsafe());
318       bool folder_read_completed = false;
319       ReadDirectoryTestHelper(operation_runner(), folder_url, &folder_contents,
320                               &folder_read_completed);
321
322       EXPECT_TRUE(folder_read_completed);
323
324       const std::set<std::string>& image_filenames =
325           test_folders[i]->image_filenames();
326
327       EXPECT_EQ(image_filenames.size(), folder_contents.size());
328
329       for (FileSystemOperation::FileEntryList::const_iterator file_it =
330                folder_contents.begin(); file_it != folder_contents.end();
331            ++file_it) {
332         EXPECT_EQ(1u, image_filenames.count(
333             base::FilePath(file_it->name).AsUTF8Unsafe()));
334       }
335     }
336   }
337
338   std::string DateToPathString(const base::Time& time) {
339     return PicasaDataProvider::DateToPathString(time);
340   }
341
342   void TestNonexistentDirectory(const std::string& path) {
343     FileSystemOperation::FileEntryList contents;
344     FileSystemURL url = CreateURL(path);
345     bool completed = false;
346     ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
347
348     ASSERT_FALSE(completed);
349   }
350
351   void TestEmptyDirectory(const std::string& path) {
352     FileSystemOperation::FileEntryList contents;
353     FileSystemURL url = CreateURL(path);
354     bool completed = false;
355     ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
356
357     ASSERT_TRUE(completed);
358     EXPECT_EQ(0u, contents.size());
359   }
360
361   FileSystemURL CreateURL(const std::string& path) const {
362     base::FilePath virtual_path =
363         ImportedMediaGalleryRegistry::GetInstance()->ImportedRoot();
364     virtual_path = virtual_path.AppendASCII("picasa");
365     virtual_path = virtual_path.AppendASCII(path);
366     return file_system_context_->CreateCrackedFileSystemURL(
367         GURL("http://www.example.com"), fileapi::kFileSystemTypePicasa,
368         virtual_path);
369   }
370
371   fileapi::FileSystemOperationRunner* operation_runner() const {
372     return file_system_context_->operation_runner();
373   }
374
375   scoped_refptr<fileapi::FileSystemContext> file_system_context() const {
376     return file_system_context_;
377   }
378
379  private:
380   base::MessageLoop message_loop_;
381   content::TestBrowserThread io_thread_;
382
383   base::ScopedTempDir profile_dir_;
384
385   scoped_refptr<fileapi::FileSystemContext> file_system_context_;
386   scoped_ptr<PicasaDataProvider> picasa_data_provider_;
387   scoped_ptr<MediaPathFilter> media_path_filter_;
388
389   DISALLOW_COPY_AND_ASSIGN(PicasaFileUtilTest);
390 };
391
392 TEST_F(PicasaFileUtilTest, DateFormat) {
393   base::Time::Exploded exploded_shortmonth = { 2013, 4, 0, 16, 0, 0, 0, 0 };
394   base::Time shortmonth = base::Time::FromLocalExploded(exploded_shortmonth);
395
396   base::Time::Exploded exploded_shortday = { 2013, 11, 0, 3, 0, 0, 0, 0 };
397   base::Time shortday = base::Time::FromLocalExploded(exploded_shortday);
398
399   EXPECT_EQ("2013-04-16", DateToPathString(shortmonth));
400   EXPECT_EQ("2013-11-03", DateToPathString(shortday));
401 }
402
403 TEST_F(PicasaFileUtilTest, NameDeduplication) {
404   ScopedVector<TestFolder> test_folders;
405   std::vector<std::string> expected_names;
406
407   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
408   base::Time test_date_2 = test_date - base::TimeDelta::FromDays(1);
409
410   std::string test_date_string = DateToPathString(test_date);
411   std::string test_date_2_string = DateToPathString(test_date_2);
412
413   test_folders.push_back(
414       new TestFolder("diff_date", test_date_2, "uuid3", 0, 0));
415   expected_names.push_back("diff_date " + test_date_2_string);
416
417   test_folders.push_back(
418       new TestFolder("diff_date", test_date, "uuid2", 0, 0));
419   expected_names.push_back("diff_date " + test_date_string);
420
421   test_folders.push_back(
422       new TestFolder("duplicate", test_date, "uuid4", 0, 0));
423   expected_names.push_back("duplicate " + test_date_string + " (1)");
424
425   test_folders.push_back(
426       new TestFolder("duplicate", test_date, "uuid5", 0, 0));
427   expected_names.push_back("duplicate " + test_date_string + " (2)");
428
429   test_folders.push_back(
430       new TestFolder("unique_name", test_date, "uuid1", 0, 0));
431   expected_names.push_back("unique_name " + test_date_string);
432
433   SetupFolders(&test_folders, std::vector<AlbumInfo>(), AlbumImagesMap());
434
435   FileSystemOperation::FileEntryList contents;
436   FileSystemURL url = CreateURL(kPicasaDirFolders);
437   bool completed = false;
438   ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
439
440   ASSERT_TRUE(completed);
441   ASSERT_EQ(expected_names.size(), contents.size());
442   for (size_t i = 0; i < contents.size(); ++i) {
443     EXPECT_EQ(expected_names[i],
444               base::FilePath(contents[i].name).AsUTF8Unsafe());
445     EXPECT_EQ(test_folders[i]->timestamp(), contents[i].last_modified_time);
446     EXPECT_TRUE(contents[i].is_directory);
447   }
448 }
449
450 TEST_F(PicasaFileUtilTest, RootFolders) {
451   ScopedVector<TestFolder> empty_folders_list;
452   SetupFolders(&empty_folders_list, std::vector<AlbumInfo>(), AlbumImagesMap());
453
454   FileSystemOperation::FileEntryList contents;
455   FileSystemURL url = CreateURL("");
456   bool completed = false;
457   ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
458
459   ASSERT_TRUE(completed);
460   ASSERT_EQ(2u, contents.size());
461
462   EXPECT_TRUE(contents.front().is_directory);
463   EXPECT_TRUE(contents.back().is_directory);
464
465   EXPECT_EQ(0, contents.front().size);
466   EXPECT_EQ(0, contents.back().size);
467
468   EXPECT_EQ(FILE_PATH_LITERAL("albums"), contents.front().name);
469   EXPECT_EQ(FILE_PATH_LITERAL("folders"), contents.back().name);
470 }
471
472 TEST_F(PicasaFileUtilTest, NonexistentFolder) {
473   ScopedVector<TestFolder> empty_folders_list;
474   SetupFolders(&empty_folders_list, std::vector<AlbumInfo>(), AlbumImagesMap());
475
476   TestNonexistentDirectory(std::string(kPicasaDirFolders) + "/foo");
477   TestNonexistentDirectory(std::string(kPicasaDirFolders) + "/foo/bar");
478   TestNonexistentDirectory(std::string(kPicasaDirFolders) + "/foo/bar/baz");
479 }
480
481 TEST_F(PicasaFileUtilTest, FolderContentsTrivial) {
482   ScopedVector<TestFolder> test_folders;
483   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
484
485   test_folders.push_back(
486       new TestFolder("folder-1-empty", test_date, "uid-empty", 0, 0));
487   test_folders.push_back(
488       new TestFolder("folder-2-images", test_date, "uid-images", 5, 0));
489   test_folders.push_back(
490       new TestFolder("folder-3-nonimages", test_date, "uid-nonimages", 0, 5));
491   test_folders.push_back(
492       new TestFolder("folder-4-both", test_date, "uid-both", 5, 5));
493
494   SetupFolders(&test_folders, std::vector<AlbumInfo>(), AlbumImagesMap());
495   VerifyFolderDirectoryList(test_folders);
496 }
497
498 TEST_F(PicasaFileUtilTest, FolderWithManyFiles) {
499   ScopedVector<TestFolder> test_folders;
500   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
501
502   test_folders.push_back(
503       new TestFolder("folder-many-files", test_date, "uid-both", 500, 500));
504
505   SetupFolders(&test_folders, std::vector<AlbumInfo>(), AlbumImagesMap());
506   VerifyFolderDirectoryList(test_folders);
507 }
508
509 TEST_F(PicasaFileUtilTest, ManyFolders) {
510   ScopedVector<TestFolder> test_folders;
511   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
512
513   // TODO(tommycli): Turn number of test folders back up to 50 (or more) once
514   // https://codereview.chromium.org/15479003/ lands.
515   for (unsigned int i = 0; i < 25; ++i) {
516     base::Time date = test_date - base::TimeDelta::FromDays(i);
517
518     test_folders.push_back(
519         new TestFolder(base::StringPrintf("folder-%05d", i),
520                        date,
521                        base::StringPrintf("uid%05d", i), i % 5, i % 3));
522   }
523
524   SetupFolders(&test_folders, std::vector<AlbumInfo>(), AlbumImagesMap());
525   VerifyFolderDirectoryList(test_folders);
526 }
527
528 TEST_F(PicasaFileUtilTest, AlbumExistence) {
529   ScopedVector<TestFolder> test_folders;
530   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
531
532   std::vector<AlbumInfo> albums;
533   AlbumInfo info;
534   info.name = "albumname";
535   info.uid = "albumuid";
536   info.timestamp = test_date;
537   albums.push_back(info);
538
539   AlbumImagesMap albums_images;
540   albums_images[info.uid] = AlbumImages();
541
542   SetupFolders(&test_folders, albums, albums_images);
543
544   TestEmptyDirectory(std::string(kPicasaDirAlbums) + "/albumname 2013-04-16");
545   TestNonexistentDirectory(std::string(kPicasaDirAlbums) +
546                            "/albumname 2013-04-16/toodeep");
547   TestNonexistentDirectory(std::string(kPicasaDirAlbums) + "/wrongname");
548 }
549
550 TEST_F(PicasaFileUtilTest, AlbumContents) {
551   ScopedVector<TestFolder> test_folders;
552   base::Time test_date = base::Time::FromLocalExploded(test_date_exploded);
553
554   std::vector<AlbumInfo> albums;
555   AlbumInfo info;
556   info.name = "albumname";
557   info.uid = "albumuid";
558   info.timestamp = test_date;
559   albums.push_back(info);
560
561   base::ScopedTempDir temp_dir;
562   ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
563
564   base::FilePath image_path = temp_dir.path().AppendASCII("img.jpg");
565   ASSERT_TRUE(WriteJPEGHeader(image_path));
566
567   AlbumImagesMap albums_images;
568   albums_images[info.uid] = AlbumImages();
569   albums_images[info.uid]["mapped_name.jpg"] = image_path;
570
571   SetupFolders(&test_folders, albums, albums_images);
572
573   FileSystemOperation::FileEntryList contents;
574   FileSystemURL url =
575       CreateURL(std::string(kPicasaDirAlbums) + "/albumname 2013-04-16");
576   bool completed = false;
577   ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
578
579   ASSERT_TRUE(completed);
580   EXPECT_EQ(1u, contents.size());
581   EXPECT_EQ("mapped_name.jpg",
582             base::FilePath(contents.begin()->name).AsUTF8Unsafe());
583   EXPECT_FALSE(contents.begin()->is_directory);
584
585   // Create a snapshot file to verify the file path.
586   base::RunLoop loop;
587   base::File::Error error;
588   base::FilePath platform_path_result;
589   fileapi::FileSystemOperationRunner::SnapshotFileCallback snapshot_callback =
590       base::Bind(&CreateSnapshotFileTestHelperCallback,
591                  &loop,
592                  &error,
593                  &platform_path_result);
594   operation_runner()->CreateSnapshotFile(
595       CreateURL(std::string(kPicasaDirAlbums) +
596                 "/albumname 2013-04-16/mapped_name.jpg"),
597       snapshot_callback);
598   loop.Run();
599   EXPECT_EQ(base::File::FILE_OK, error);
600   EXPECT_EQ(image_path, platform_path_result);
601 }
602
603 }  // namespace picasa