1 // Copyright 2015 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 EXTENSIONS_BROWSER_TEST_IMAGE_LOADER_H_
6 #define EXTENSIONS_BROWSER_TEST_IMAGE_LOADER_H_
8 #include "base/run_loop.h"
9 #include "ui/gfx/image/image.h"
11 namespace extensions
{
15 // Helper class for synchronously loading an extension image resource.
16 class TestImageLoader
{
21 // Loads an image to be used in test from |extension|.
22 // The image will be loaded from the relative path |image_path|.
23 static SkBitmap
LoadAndGetExtensionBitmap(const Extension
* extension
,
24 const std::string
& image_path
,
28 void OnImageLoaded(const gfx::Image
& image
);
30 SkBitmap
LoadAndGetBitmap(const Extension
* extension
,
31 const std::string
& path
,
35 base::Closure loader_message_loop_quit_
;
39 DISALLOW_COPY_AND_ASSIGN(TestImageLoader
);
42 } // namespace extensions
44 #endif // EXTENSIONS_BROWSER_TEST_IMAGE_LOADER_H_