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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp

Issue 1602343002: compositor-worker: cc->blink mutation plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-ian-patch
Patch Set: Merge master + s/scoped_ptr/unique_ptr/ Created 4 years, 8 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 2016 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 #include "platform/graphics/CompositorMutatorClient.h"
6
7 #include "base/callback.h"
8 #include "platform/graphics/CompositorMutation.h"
9 #include "platform/graphics/CompositorMutationsTarget.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "wtf/OwnPtr.h"
13
14 using ::testing::_;
15
16 namespace blink {
17 namespace {
18
19 class MockCompositoMutationsTarget : public CompositorMutationsTarget {
20 public:
21 MOCK_METHOD1(applyMutations, void(CompositorMutations*));
22 };
23
24 TEST(CompositorMutatorClient, CallbackForNonNullMutationsShouldApply)
25 {
26 MockCompositoMutationsTarget target;
27
28 CompositorMutatorClient client(&target);
29 OwnPtr<CompositorMutations> mutations = adoptPtr(new CompositorMutations());
30 client.setMutationsForTesting(mutations.release());
31
32 EXPECT_CALL(target, applyMutations(_));
33 client.TakeMutations().Run();
34 }
35
36 TEST(CompositorMutatorClient, CallbackForNullMutationsShouldBeNoop)
37 {
38 MockCompositoMutationsTarget target;
39 CompositorMutatorClient client(&target);
40
41 EXPECT_CALL(target, applyMutations(_)).Times(0);
42 EXPECT_TRUE(client.TakeMutations().is_null());
43 }
44
45 } // namespace
46 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698