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

Side by Side Diff: cc/trees/remote_channel_unittest.cc

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LayerTreeSettings::ToProtobuf, update comments. Created 5 years 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 2015 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 "cc/test/layer_tree_test.h"
6
7 namespace cc {
8
9 class RemoteChannelTest : public LayerTreeTest {
10 protected:
11 RemoteChannelTest() : calls_received_(0) {}
12
13 ~RemoteChannelTest() override {}
14
15 void BeginTest() override {
16 DCHECK(IsRemoteTest());
17 BeginChannelTest();
18 }
19 virtual void BeginChannelTest() {}
20
21 int calls_received_;
22
23 private:
24 DISALLOW_COPY_AND_ASSIGN(RemoteChannelTest);
25 };
26
27 class RemoteChannelTestShutdownByMainCompositor : public RemoteChannelTest {
28 void OverrideLayerTreeSettings(LayerTreeSettings* settings) override {
29 calls_received_++;
30 EndTest();
31 }
32
33 void ReceivedDidShutdown() override { calls_received_++; }
34
35 void AfterTest() override { EXPECT_EQ(2, calls_received_); }
36 };
37
38 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestShutdownByMainCompositor);
39
40 class RemoteChannelTestShutdownbyRemoteChannelHostClient
41 : public RemoteChannelTest {
42 void BeginChannelTest() override {
43 DestroyRemoteChannelHost();
44 EndTest();
45 }
46
47 void OverrideLayerTreeSettings(LayerTreeSettings* settings) override {
48 calls_received_++;
49 }
50
51 void ReceivedDidShutdown() override { NOTREACHED(); }
52
53 void AfterTest() override { EXPECT_EQ(1, calls_received_); }
54 };
55
56 REMOTE_DIRECT_RENDERER_TEST_F(
57 RemoteChannelTestShutdownbyRemoteChannelHostClient);
58
59 class RemoteChannelTestMainThreadStoppedFlinging : public RemoteChannelTest {
60 void BeginChannelTest() override { proxy()->MainThreadHasStoppedFlinging(); }
61
62 void MainThreadHasStoppedFlingingOnImpl() override {
63 calls_received_++;
64 EndTest();
65 }
66
67 void AfterTest() override { EXPECT_EQ(1, calls_received_); }
68 };
69
70 REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestMainThreadStoppedFlinging);
71
72 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698