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

Unified Diff: blimp/client/test/compositor/test_display_compositor.h

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Fixed this a bit more. Still some thread violations :(. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/test/compositor/test_display_compositor.h
diff --git a/blimp/client/test/compositor/test_display_compositor.h b/blimp/client/test/compositor/test_display_compositor.h
new file mode 100644
index 0000000000000000000000000000000000000000..5235c1ab86adb26208ea657a2bbb50074ec23e01
--- /dev/null
+++ b/blimp/client/test/compositor/test_display_compositor.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_
+#define BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "blimp/client/support/compositor/display_compositor.h"
+
+class SkBitmap;
+
+namespace cc {
+class CopyOutputResult;
+} // namespace cc
+
+namespace blimp {
+namespace client {
+class CompositorDependencies;
+
+// An implementation of the DisplayCompositor that supplies a ContextProvider
+// that is not backed by a platform specific widget. It is not meant to be used
+// to actually display content. It also provides a hook to get access to an
+// SkBitmap that represents the cc::Layer passed into |SetContentLayer|.
+class TestDisplayCompositor : public DisplayCompositor {
+ public:
+ struct CopyRequest {
+ CopyRequest();
+ ~CopyRequest();
+
+ base::WaitableEvent waiter;
+ std::unique_ptr<SkBitmap> result;
+ };
+
+ explicit TestDisplayCompositor(
+ CompositorDependencies* compositor_dependencies);
+ ~TestDisplayCompositor() override;
+
+ // Returns an SkBitmap that represents the cc::Layer hierarchy being drawn by
+ // this compositor. This will block until the readback completes.
+ void GetBitmap(CopyRequest* request);
Khushal 2016/09/13 04:47:24 I know you really wanted a sync call but I would s
David Trainor- moved to gerrit 2016/09/13 06:18:05 This is all gone. Moved to BlimpContentsView like
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestDisplayCompositor);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_

Powered by Google App Engine
This is Rietveld 408576698