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

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

Issue 1418953002: cc: Send shared variables between main and impl side using the channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 unified diff | Download patch
« no previous file with comments | « cc/trees/threaded_channel.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/threaded_channel.h" 5 #include "cc/trees/threaded_channel.h"
6 6
7 #include "cc/test/layer_tree_test.h" 7 #include "cc/test/layer_tree_test.h"
8 #include "cc/trees/single_thread_proxy.h" 8 #include "cc/trees/single_thread_proxy.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 27 matching lines...) Expand all
38 // LayerTreeTest. 38 // LayerTreeTest.
39 ThreadProxy* thread_proxy_; 39 ThreadProxy* thread_proxy_;
40 int calls_received_; 40 int calls_received_;
41 41
42 private: 42 private:
43 DISALLOW_COPY_AND_ASSIGN(ThreadedChannelTest); 43 DISALLOW_COPY_AND_ASSIGN(ThreadedChannelTest);
44 }; 44 };
45 45
46 class ThreadedChannelTestInitializationAndShutdown 46 class ThreadedChannelTestInitializationAndShutdown
47 : public ThreadedChannelTest { 47 : public ThreadedChannelTest {
48 void InitializeImplOnImpl() override { calls_received_++; }
49
48 void SetVisibleOnImpl(bool visible) override { calls_received_++; } 50 void SetVisibleOnImpl(bool visible) override { calls_received_++; }
49 51
50 void ReceivedRequestNewOutputSurface() override { calls_received_++; } 52 void ReceivedRequestNewOutputSurface() override { calls_received_++; }
51 53
52 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override { 54 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override {
53 calls_received_++; 55 calls_received_++;
54 } 56 }
55 57
56 void ReceivedSetRendererCapabilitiesMainCopy( 58 void ReceivedSetRendererCapabilitiesMainCopy(
57 const RendererCapabilities& capabilities) override { 59 const RendererCapabilities& capabilities) override {
58 calls_received_++; 60 calls_received_++;
59 } 61 }
60 62
61 void ReceivedDidInitializeOutputSurface( 63 void ReceivedDidInitializeOutputSurface(
62 bool success, 64 bool success,
63 const RendererCapabilities& capabilities) override { 65 const RendererCapabilities& capabilities) override {
64 calls_received_++; 66 calls_received_++;
65 EndTest(); 67 EndTest();
66 } 68 }
67 69
70 void WillCloseLayerTreeHostOnImpl() override { calls_received_++; }
68 void FinishGLOnImpl() override { calls_received_++; } 71 void FinishGLOnImpl() override { calls_received_++; }
69 72
70 void AfterTest() override { EXPECT_EQ(6, calls_received_); } 73 void AfterTest() override { EXPECT_EQ(8, calls_received_); }
71 }; 74 };
72 75
73 MULTI_THREAD_DIRECT_RENDERER_TEST_F( 76 MULTI_THREAD_DIRECT_RENDERER_TEST_F(
74 ThreadedChannelTestInitializationAndShutdown); 77 ThreadedChannelTestInitializationAndShutdown);
75 78
76 class ThreadedChannelTestThrottleFrameProduction : public ThreadedChannelTest { 79 class ThreadedChannelTestThrottleFrameProduction : public ThreadedChannelTest {
77 void BeginChannelTest() override { 80 void BeginChannelTest() override {
78 proxy()->SetThrottleFrameProduction(true); 81 proxy()->SetThrottleFrameProduction(true);
79 } 82 }
80 83
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 calls_received_++; 305 calls_received_++;
303 EndTest(); 306 EndTest();
304 } 307 }
305 308
306 void AfterTest() override { EXPECT_EQ(1, calls_received_); } 309 void AfterTest() override { EXPECT_EQ(1, calls_received_); }
307 }; 310 };
308 311
309 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation); 312 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation);
310 313
311 } // namespace cc 314 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/threaded_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698