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

Unified Diff: chrome/browser/media_galleries/fileapi/itunes_data_provider.h

Issue 18348019: Add a test for ITunesDataProvider (try two). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac compile Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/fileapi/itunes_data_provider.h
diff --git a/chrome/browser/media_galleries/fileapi/itunes_data_provider.h b/chrome/browser/media_galleries/fileapi/itunes_data_provider.h
index 5d8cb4f7dde921c5e3054ba54ba80184f994cc8b..c53f5520dd53dbc3e6bf7301a7bf43cc9b8ed586 100644
--- a/chrome/browser/media_galleries/fileapi/itunes_data_provider.h
+++ b/chrome/browser/media_galleries/fileapi/itunes_data_provider.h
@@ -17,6 +17,8 @@
namespace itunes {
+class TestITunesDataProvider;
+
// This class is the holder for iTunes parsed data. Given a path to the iTunes
// library XML file it will read it in, parse the data, and provide convenient
// methods to access it. When the file changes, it will update the data.
@@ -30,7 +32,7 @@ class ITunesDataProvider {
typedef base::Callback<void(bool)> ReadyCallback;
explicit ITunesDataProvider(const base::FilePath& library_path);
- ~ITunesDataProvider();
+ virtual ~ITunesDataProvider();
// Ask the data provider to refresh the data if necessary. |ready_callback|
// will be called with the result; false if unable to parse the XML file.
@@ -61,6 +63,8 @@ class ITunesDataProvider {
Album GetAlbum(const ArtistName& artist, const AlbumName& album) const;
private:
+ friend class TestITunesDataProvider;
+
typedef std::map<AlbumName, Album> Artist;
typedef std::map<ArtistName, Artist> Library;
@@ -79,8 +83,8 @@ class ITunesDataProvider {
// watch.
void OnLibraryWatchStarted(scoped_ptr<base::FilePathWatcher> library_watcher);
- // Called when |library_path_| has changed.
- void OnLibraryChanged(const base::FilePath& path, bool error);
+ // Called when |library_path_| has changed. Virtual for testing.
+ virtual void OnLibraryChanged(const base::FilePath& path, bool error);
// Called when the utility process finishes parsing the library XML file.
void OnLibraryParsed(const ReadyCallback& ready_callback,
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698