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

Unified Diff: cc/trees/threaded_channel_unittest.cc

Issue 1417053005: cc: Split ThreadProxy into ProxyMain and ProxyImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change ThreadedChannel::GetProxyImpl to GetProxyImplForTesting 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/threaded_channel_unittest.cc
diff --git a/cc/trees/threaded_channel_unittest.cc b/cc/trees/threaded_channel_unittest.cc
index e9b6d5141f0f718aaa34bec84f8b8a52c98148a7..c0d596737f9abb38ebe9fdd04864da4a0b0816ee 100644
--- a/cc/trees/threaded_channel_unittest.cc
+++ b/cc/trees/threaded_channel_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2015 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.
@@ -13,13 +13,12 @@ namespace cc {
// The ThreadedChannel tests are run only for threaded and direct mode.
class ThreadedChannelTest : public LayerTreeTest {
protected:
- ThreadedChannelTest() : thread_proxy_(nullptr), calls_received_(0) {}
+ ThreadedChannelTest() : calls_received_(0) {}
~ThreadedChannelTest() override {}
void BeginTest() override {
DCHECK(HasImplThread());
- thread_proxy_ = static_cast<ThreadProxy*>(proxy());
BeginChannelTest();
};
virtual void BeginChannelTest() {}
@@ -36,9 +35,6 @@ class ThreadedChannelTest : public LayerTreeTest {
void AfterTest() override {}
- // TODO(khushalsagar): Remove this once ProxyImpl is added to the
- // LayerTreeTest.
- ThreadProxy* thread_proxy_;
int calls_received_;
private:
@@ -47,8 +43,6 @@ class ThreadedChannelTest : public LayerTreeTest {
class ThreadedChannelTestInitializationAndShutdown
: public ThreadedChannelTest {
- void InitializeImplOnImpl() override { calls_received_++; }
-
void SetVisibleOnImpl(bool visible) override { calls_received_++; }
void ReceivedRequestNewOutputSurface() override { calls_received_++; }
@@ -69,10 +63,9 @@ class ThreadedChannelTestInitializationAndShutdown
EndTest();
}
- void WillCloseLayerTreeHostOnImpl() override { calls_received_++; }
void FinishGLOnImpl() override { calls_received_++; }
- void AfterTest() override { EXPECT_EQ(8, calls_received_); }
+ void AfterTest() override { EXPECT_EQ(6, calls_received_); }
};
MULTI_THREAD_DIRECT_RENDERER_TEST_F(
@@ -246,7 +239,7 @@ class ThreadedChannelTestBeginMainFrameNotExpectedSoon
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- thread_proxy_->SendBeginMainFrameNotExpectedSoon();
+ GetProxyImpl()->SendBeginMainFrameNotExpectedSoon();
}
void ReceivedBeginMainFrameNotExpectedSoon() override {
@@ -266,7 +259,7 @@ class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest {
void StartTestOnImplThread() override {
scoped_ptr<AnimationEventsVector> events(
make_scoped_ptr(new AnimationEventsVector));
- thread_proxy_->PostAnimationEventsToMainThreadOnImplThread(events.Pass());
+ GetProxyImpl()->PostAnimationEventsToMainThreadOnImplThread(events.Pass());
}
void ReceivedSetAnimationEvents() override {
@@ -283,7 +276,7 @@ class ThreadedChannelTestLoseOutputSurface : public ThreadedChannelTest {
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- thread_proxy_->DidLoseOutputSurfaceOnImplThread();
+ GetProxyImpl()->DidLoseOutputSurfaceOnImplThread();
}
void ReceivedDidLoseOutputSurface() override {
@@ -300,7 +293,7 @@ class ThreadedChannelTestPageScaleAnimation : public ThreadedChannelTest {
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- thread_proxy_->DidCompletePageScaleAnimationOnImplThread();
+ GetProxyImpl()->DidCompletePageScaleAnimationOnImplThread();
}
void ReceivedDidCompletePageScaleAnimation() override {

Powered by Google App Engine
This is Rietveld 408576698