base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON().
[chromium-blink-merge.git] / ui / ozone / platform / test / test_window_manager.h
blob69be81d91e33e44319c3da9dcf2367b7a9e5ad09
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 UI_OZONE_PLATFORM_TEST_FILE_SURFACE_FACTORY_H_
6 #define UI_OZONE_PLATFORM_TEST_FILE_SURFACE_FACTORY_H_
8 #include "base/files/file_path.h"
9 #include "base/id_map.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/ozone/platform/test/test_window.h"
13 #include "ui/ozone/public/surface_factory_ozone.h"
15 namespace ui {
17 class TestWindowManager : public SurfaceFactoryOzone {
18 public:
19 explicit TestWindowManager(const base::FilePath& dump_location);
20 ~TestWindowManager() override;
22 // Initialize (mainly check that we have a place to write output to).
23 void Initialize();
25 // Register a new window. Returns the window id.
26 int32_t AddWindow(TestWindow* window);
28 // Remove a window.
29 void RemoveWindow(int32_t window_id, TestWindow* window);
31 // User-supplied path for images.
32 base::FilePath base_path() const;
34 // SurfaceFactoryOzone:
35 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
36 gfx::AcceleratedWidget w) override;
37 bool LoadEGLGLES2Bindings(
38 AddGLLibraryCallback add_gl_library,
39 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
41 private:
42 base::FilePath location_;
44 IDMap<TestWindow> windows_;
46 DISALLOW_COPY_AND_ASSIGN(TestWindowManager);
49 } // namespace ui
51 #endif // UI_OZONE_PLATFORM_TEST_FILE_SURFACE_FACTORY_H_