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

Unified Diff: cc/trees/threaded_channel_unittest.cc

Issue 1506023008: [NOT LANDED] Revert of cc: Split ThreadProxy into ProxyMain and ProxyImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/threaded_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/threaded_channel_unittest.cc
diff --git a/cc/trees/threaded_channel_unittest.cc b/cc/trees/threaded_channel_unittest.cc
index 17350d8444b7c64cb111bd9dae8ae84f2ad8b423..152ff59bebbfb03b42006881d6ae9506afaf4304 100644
--- a/cc/trees/threaded_channel_unittest.cc
+++ b/cc/trees/threaded_channel_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2014 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,12 +13,13 @@
// The ThreadedChannel tests are run only for threaded and direct mode.
class ThreadedChannelTest : public LayerTreeTest {
protected:
- ThreadedChannelTest() : calls_received_(0) {}
+ ThreadedChannelTest() : thread_proxy_(nullptr), calls_received_(0) {}
~ThreadedChannelTest() override {}
void BeginTest() override {
DCHECK(HasImplThread());
+ thread_proxy_ = static_cast<ThreadProxy*>(proxy());
BeginChannelTest();
};
virtual void BeginChannelTest() {}
@@ -35,6 +36,9 @@
void AfterTest() override {}
+ // TODO(khushalsagar): Remove this once ProxyImpl is added to the
+ // LayerTreeTest.
+ ThreadProxy* thread_proxy_;
int calls_received_;
private:
@@ -43,6 +47,8 @@
class ThreadedChannelTestInitializationAndShutdown
: public ThreadedChannelTest {
+ void InitializeImplOnImpl() override { calls_received_++; }
+
void SetVisibleOnImpl(bool visible) override { calls_received_++; }
void ReceivedRequestNewOutputSurface() override { calls_received_++; }
@@ -63,9 +69,10 @@
EndTest();
}
+ void WillCloseLayerTreeHostOnImpl() override { calls_received_++; }
void FinishGLOnImpl() override { calls_received_++; }
- void AfterTest() override { EXPECT_EQ(6, calls_received_); }
+ void AfterTest() override { EXPECT_EQ(8, calls_received_); }
};
MULTI_THREAD_DIRECT_RENDERER_TEST_F(
@@ -239,7 +246,7 @@
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- GetProxyImplForTest()->SendBeginMainFrameNotExpectedSoon();
+ thread_proxy_->SendBeginMainFrameNotExpectedSoon();
}
void ReceivedBeginMainFrameNotExpectedSoon() override {
@@ -259,7 +266,7 @@
void StartTestOnImplThread() override {
scoped_ptr<AnimationEventsVector> events(
make_scoped_ptr(new AnimationEventsVector));
- GetProxyImplForTest()->PostAnimationEventsToMainThreadOnImplThread(
+ thread_proxy_->PostAnimationEventsToMainThreadOnImplThread(
std::move(events));
}
@@ -277,7 +284,7 @@
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- GetProxyImplForTest()->DidLoseOutputSurfaceOnImplThread();
+ thread_proxy_->DidLoseOutputSurfaceOnImplThread();
}
void ReceivedDidLoseOutputSurface() override {
@@ -294,7 +301,7 @@
void BeginChannelTest() override { PostOnImplThread(); }
void StartTestOnImplThread() override {
- GetProxyImplForTest()->DidCompletePageScaleAnimationOnImplThread();
+ thread_proxy_->DidCompletePageScaleAnimationOnImplThread();
}
void ReceivedDidCompletePageScaleAnimation() override {
« 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