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

Side by Side Diff: ui/compositor/test/fake_context_factory.h

Issue 2752303002: views/mus: Install a mus-friend ContextFactory for tests. (Closed)
Patch Set: . Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 #ifndef UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
6 #define UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
7
8 #include "cc/test/test_gpu_memory_buffer_manager.h"
9 #include "cc/test/test_task_graph_runner.h"
10 #include "ui/compositor/compositor.h"
11
12 namespace cc {
13 class CompositorFrame;
14 class ContextProvider;
15 class FakeCompositorFrameSink;
16 class TestTaskGraphRunner;
17 class TestGpuMemoryBufferManager;
18 }
19
20 namespace ui {
21
22 class FakeContextFactory : public ui::ContextFactory {
23 public:
24 FakeContextFactory() = default;
25 ~FakeContextFactory() override = default;
26
27 const cc::CompositorFrame& GetLastCompositorFrame() const;
28
29 // ui::ContextFactory::
danakj 2017/03/17 16:54:31 I think you meant ui::ContextFactory:, though I pr
sadrul 2017/03/17 18:59:14 Whoops. Done!
30 void CreateCompositorFrameSink(
31 base::WeakPtr<ui::Compositor> compositor) override;
32 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
33 void RemoveCompositor(ui::Compositor* compositor) override;
34 bool DoesCreateTestContexts() override;
35 uint32_t GetImageTextureTarget(gfx::BufferFormat format,
36 gfx::BufferUsage usage) override;
37 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
38 cc::TaskGraphRunner* GetTaskGraphRunner() override;
39 void AddObserver(ui::ContextFactoryObserver* observer) override;
40 void RemoveObserver(ui::ContextFactoryObserver* observer) override;
41
42 private:
43 cc::FakeCompositorFrameSink* frame_sink_ = nullptr;
44 cc::TestTaskGraphRunner task_graph_runner_;
45 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
46
47 DISALLOW_COPY_AND_ASSIGN(FakeContextFactory);
48 };
49
50 } // namespace ui
51
52 #endif // UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698