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

Side by Side Diff: chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 <vector> 5 #include <vector>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 AlbumMap::const_iterator album_2 = albums->find("Album 2 Name 1899-12-30"); 59 AlbumMap::const_iterator album_2 = albums->find("Album 2 Name 1899-12-30");
60 EXPECT_NE(albums->end(), album_2); 60 EXPECT_NE(albums->end(), album_2);
61 EXPECT_EQ("Album 2 Name", album_2->second.name); 61 EXPECT_EQ("Album 2 Name", album_2->second.name);
62 EXPECT_EQ(base::FilePath(), album_2->second.path); 62 EXPECT_EQ(base::FilePath(), album_2->second.path);
63 EXPECT_EQ("uid5", album_2->second.uid); 63 EXPECT_EQ("uid5", album_2->second.uid);
64 } 64 }
65 65
66 void VerifyTestAlbumsImagesIndex(PicasaDataProvider* data_provider, 66 void VerifyTestAlbumsImagesIndex(PicasaDataProvider* data_provider,
67 base::FilePath test_folder_1_path, 67 base::FilePath test_folder_1_path,
68 base::FilePath test_folder_2_path) { 68 base::FilePath test_folder_2_path) {
69 base::PlatformFileError error; 69 base::File::Error error;
70 scoped_ptr<AlbumImages> album_1_images = 70 scoped_ptr<AlbumImages> album_1_images =
71 data_provider->FindAlbumImages("uid3", &error); 71 data_provider->FindAlbumImages("uid3", &error);
72 ASSERT_TRUE(album_1_images); 72 ASSERT_TRUE(album_1_images);
73 EXPECT_EQ(base::PLATFORM_FILE_OK, error); 73 EXPECT_EQ(base::File::FILE_OK, error);
74 EXPECT_EQ(2u, album_1_images->size()); 74 EXPECT_EQ(2u, album_1_images->size());
75 EXPECT_NE(album_1_images->end(), album_1_images->find("InBoth.jpg")); 75 EXPECT_NE(album_1_images->end(), album_1_images->find("InBoth.jpg"));
76 EXPECT_EQ(test_folder_1_path.AppendASCII("InBoth.jpg"), 76 EXPECT_EQ(test_folder_1_path.AppendASCII("InBoth.jpg"),
77 (*album_1_images)["InBoth.jpg"]); 77 (*album_1_images)["InBoth.jpg"]);
78 EXPECT_NE(album_1_images->end(), 78 EXPECT_NE(album_1_images->end(),
79 album_1_images->find("InFirstAlbumOnly.jpg")); 79 album_1_images->find("InFirstAlbumOnly.jpg"));
80 EXPECT_EQ(test_folder_2_path.AppendASCII("InFirstAlbumOnly.jpg"), 80 EXPECT_EQ(test_folder_2_path.AppendASCII("InFirstAlbumOnly.jpg"),
81 (*album_1_images)["InFirstAlbumOnly.jpg"]); 81 (*album_1_images)["InFirstAlbumOnly.jpg"]);
82 82
83 scoped_ptr<AlbumImages> album_2_images = 83 scoped_ptr<AlbumImages> album_2_images =
84 data_provider->FindAlbumImages("uid5", &error); 84 data_provider->FindAlbumImages("uid5", &error);
85 ASSERT_TRUE(album_2_images); 85 ASSERT_TRUE(album_2_images);
86 EXPECT_EQ(base::PLATFORM_FILE_OK, error); 86 EXPECT_EQ(base::File::FILE_OK, error);
87 EXPECT_EQ(2u, album_2_images->size()); 87 EXPECT_EQ(2u, album_2_images->size());
88 EXPECT_NE(album_2_images->end(), album_2_images->find("InBoth.jpg")); 88 EXPECT_NE(album_2_images->end(), album_2_images->find("InBoth.jpg"));
89 EXPECT_EQ(test_folder_1_path.AppendASCII("InBoth.jpg"), 89 EXPECT_EQ(test_folder_1_path.AppendASCII("InBoth.jpg"),
90 (*album_2_images)["InBoth.jpg"]); 90 (*album_2_images)["InBoth.jpg"]);
91 EXPECT_NE(album_2_images->end(), 91 EXPECT_NE(album_2_images->end(),
92 album_2_images->find("InSecondAlbumOnly.jpg")); 92 album_2_images->find("InSecondAlbumOnly.jpg"));
93 EXPECT_EQ(test_folder_1_path.AppendASCII("InSecondAlbumOnly.jpg"), 93 EXPECT_EQ(test_folder_1_path.AppendASCII("InSecondAlbumOnly.jpg"),
94 (*album_2_images)["InSecondAlbumOnly.jpg"]); 94 (*album_2_images)["InSecondAlbumOnly.jpg"]);
95 } 95 }
96 96
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 base::Unretained(this))); 551 base::Unretained(this)));
552 } 552 }
553 }; 553 };
554 554
555 IN_PROC_BROWSER_TEST_F(PicasaDataProviderInvalidateInflightAlbumsIndexerTest, 555 IN_PROC_BROWSER_TEST_F(PicasaDataProviderInvalidateInflightAlbumsIndexerTest,
556 InvalidateInflightAlbumsIndexerTest) { 556 InvalidateInflightAlbumsIndexerTest) {
557 RunTest(); 557 RunTest();
558 } 558 }
559 559
560 } // namespace picasa 560 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698