#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_MANAGER_TEST_UTIL_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_MANAGER_TEST_UTIL_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "chrome/browser/image_decoder.h"
class SKBitmap;
namespace base {
class FilePath;
}
namespace gfx {
class ImageSkia;
}
namespace chromeos {
namespace test {
extern const char kUserAvatarImage1RelativePath[];
extern const char kUserAvatarImage2RelativePath[];
bool AreImagesEqual(const gfx::ImageSkia& first, const gfx::ImageSkia& second);
class ImageLoader : public ImageDecoder::Delegate {
public:
explicit ImageLoader(const base::FilePath& path);
virtual ~ImageLoader();
scoped_ptr<gfx::ImageSkia> Load();
virtual void OnImageDecoded(const ImageDecoder* decoder,
const SkBitmap& decoded_image) OVERRIDE;
virtual void OnDecodeImageFailed(const ImageDecoder* decoder) OVERRIDE;
private:
base::FilePath path_;
base::RunLoop run_loop_;
scoped_ptr<gfx::ImageSkia> decoded_image_;
DISALLOW_COPY_AND_ASSIGN(ImageLoader);
};
}
}
#endif