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

Unified Diff: services/ui/surfaces/display_compositor.h

Issue 2520513002: Add DisplayCompositorTest. (Closed)
Patch Set: Rebase + improve. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/surfaces/display_compositor.h
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h
index d31ccfdfd19aaf5e6655bae09339120a698587c9..568f4d393fb1505a699bca5fe8a2a15395f778db 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -7,6 +7,10 @@
#include <stdint.h>
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
#include "base/macros.h"
#include "cc/ipc/display_compositor.mojom.h"
#include "cc/surfaces/frame_sink_id.h"
@@ -31,6 +35,10 @@ class SurfaceManager;
namespace ui {
+namespace test {
+class DisplayCompositorTest;
+}
+
class DisplayCompositorClient;
class GpuCompositorFrameSink;
class MusGpuMemoryBufferManager;
@@ -78,6 +86,9 @@ class DisplayCompositor : public cc::SurfaceObserver,
bool destroy_compositor_frame_sink);
private:
+ friend class test::DisplayCompositorTest;
+
+ const cc::SurfaceId& GetRootSurfaceId() const;
// cc::SurfaceObserver implementation.
void OnSurfaceCreated(const cc::SurfaceId& surface_id,
@@ -99,6 +110,10 @@ class DisplayCompositor : public cc::SurfaceObserver,
gpu::ImageFactory* image_factory_;
cc::mojom::DisplayCompositorClientPtr client_;
+ // Will normally point to |manager_| as it provides the interface. For tests
+ // it will be swapped out with a mock implementation.
+ cc::SurfaceReferenceManager* reference_manager_;
+
// SurfaceIds that have temporary references from top level root so they
// aren't GC'd before DisplayCompositorClient can add a real reference. This
// is basically a collection of surface ids, for example:

Powered by Google App Engine
This is Rietveld 408576698