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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp

Issue 1895873006: compositor-worker: Initialize CW machinery plumbing to compositor and fire CW rAF callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only allow setting global scope once. Created 4 years, 7 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: third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
index ca0f1f7b4d99962ddc52c9ce01779af265f592ed..e02a73e80a7f9343009a82387b6fb04e3eeded69 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "platform/graphics/CompositorMutation.h"
#include "platform/graphics/CompositorMutationsTarget.h"
+#include "platform/graphics/CompositorMutator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/OwnPtr.h"
@@ -16,6 +17,14 @@ using ::testing::_;
namespace blink {
namespace {
+class MockCompositorMutator : public GarbageCollected<MockCompositorMutator>, public CompositorMutator {
jbroman 2016/05/04 22:11:06 super-nit: consider not using the term "Mock" when
flackr 2016/05/05 14:04:15 Done.
+ USING_GARBAGE_COLLECTED_MIXIN(MockCompositorMutator);
+public:
+ MockCompositorMutator() {}
+
+ bool mutate(double monotonicTimeNow) override { return false; }
+};
+
class MockCompositoMutationsTarget : public CompositorMutationsTarget {
public:
MOCK_METHOD1(applyMutations, void(CompositorMutations*));
@@ -25,7 +34,7 @@ TEST(CompositorMutatorClient, CallbackForNonNullMutationsShouldApply)
{
MockCompositoMutationsTarget target;
- CompositorMutatorClient client(&target);
+ CompositorMutatorClient client(new MockCompositorMutator, &target);
OwnPtr<CompositorMutations> mutations = adoptPtr(new CompositorMutations());
client.setMutationsForTesting(mutations.release());
@@ -36,7 +45,7 @@ TEST(CompositorMutatorClient, CallbackForNonNullMutationsShouldApply)
TEST(CompositorMutatorClient, CallbackForNullMutationsShouldBeNoop)
{
MockCompositoMutationsTarget target;
- CompositorMutatorClient client(&target);
+ CompositorMutatorClient client(new MockCompositorMutator, &target);
EXPECT_CALL(target, applyMutations(_)).Times(0);
EXPECT_TRUE(client.TakeMutations().is_null());

Powered by Google App Engine
This is Rietveld 408576698