Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / users / avatar / user_image_manager_test_util.h
blob6e237ecdbf80581fe9052ee27e25e99ab1f2272f
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_MANAGER_TEST_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_MANAGER_TEST_UTIL_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h"
13 #include "chrome/browser/image_decoder.h"
15 class SKBitmap;
17 namespace base {
18 class FilePath;
21 namespace gfx {
22 class ImageSkia;
25 namespace chromeos {
26 namespace test {
28 extern const char kUserAvatarImage1RelativePath[];
29 extern const char kUserAvatarImage2RelativePath[];
31 // Returns |true| if the two given images are pixel-for-pixel identical.
32 bool AreImagesEqual(const gfx::ImageSkia& first, const gfx::ImageSkia& second);
34 class ImageLoader : public ImageDecoder::ImageRequest {
35 public:
36 explicit ImageLoader(const base::FilePath& path);
37 ~ImageLoader() override;
39 scoped_ptr<gfx::ImageSkia> Load();
41 // ImageDecoder::ImageRequest:
42 void OnImageDecoded(const SkBitmap& decoded_image) override;
43 void OnDecodeImageFailed() override;
45 private:
46 base::FilePath path_;
47 base::RunLoop run_loop_;
49 scoped_ptr<gfx::ImageSkia> decoded_image_;
51 DISALLOW_COPY_AND_ASSIGN(ImageLoader);
54 } // namespace test
55 } // namespace chromeos
57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_MANAGER_TEST_UTIL_H_