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

Side by Side Diff: ui/aura/test/mus/test_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_AURA_TEST_MUS_TEST_CONTEXT_FACTORY_H_
6 #define UI_AURA_TEST_MUS_TEST_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 aura {
21 namespace test {
22
23 class TestContextFactory : public ui::ContextFactory {
sky 2017/03/17 15:48:16 Please add a description of this.
24 public:
25 TestContextFactory() = default;
26 ~TestContextFactory() override = default;
27
28 const cc::CompositorFrame& GetLastCompositorFrame() const;
29
30 // ui::ContextFactory::
31 void CreateCompositorFrameSink(
32 base::WeakPtr<ui::Compositor> compositor) override;
33 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
34 void RemoveCompositor(ui::Compositor* compositor) override;
35 bool DoesCreateTestContexts() override;
36 uint32_t GetImageTextureTarget(gfx::BufferFormat format,
37 gfx::BufferUsage usage) override;
38 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
39 cc::TaskGraphRunner* GetTaskGraphRunner() override;
40 void AddObserver(ui::ContextFactoryObserver* observer) override;
41 void RemoveObserver(ui::ContextFactoryObserver* observer) override;
42
43 private:
44 cc::FakeCompositorFrameSink* frame_sink_ = nullptr;
45 cc::TestTaskGraphRunner task_graph_runner_;
46 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
47
48 DISALLOW_COPY_AND_ASSIGN(TestContextFactory);
49 };
50
51 } // namespace test
52 } // namespace aura
53
54 #endif // UI_AURA_TEST_MUS_TEST_CONTEXT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698