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

Unified Diff: cc/layers/video_layer_impl_unittest.cc

Issue 214543011: Initialize cc::VideoFrameProviderClientImpl::active_video_layer_ to NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/video_frame_provider_client_impl.cc ('k') | cc/test/fake_video_frame_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/video_layer_impl_unittest.cc
diff --git a/cc/layers/video_layer_impl_unittest.cc b/cc/layers/video_layer_impl_unittest.cc
index dc9c6fbefaa0ed8d575e044623ad56fe95b5a8ed..11cb6140d841c6d916fded164e624914aaed9c2a 100644
--- a/cc/layers/video_layer_impl_unittest.cc
+++ b/cc/layers/video_layer_impl_unittest.cc
@@ -4,6 +4,7 @@
#include "cc/layers/video_layer_impl.h"
+#include "cc/layers/video_frame_provider_client_impl.h"
#include "cc/output/context_provider.h"
#include "cc/output/output_surface.h"
#include "cc/test/fake_video_frame_provider.h"
@@ -76,5 +77,22 @@ TEST(VideoLayerImplTest, Occlusion) {
}
}
+TEST(VideoLayerImplTest, DidBecomeActiveShouldSetActiveVideoLayer) {
+ LayerTestCommon::LayerImplTest impl;
+ DebugScopedSetImplThreadAndMainThreadBlocked thread(impl.proxy());
+
+ FakeVideoFrameProvider provider;
+ VideoLayerImpl* video_layer_impl =
+ impl.AddChildToRoot<VideoLayerImpl>(&provider);
+
+ VideoFrameProviderClientImpl* client =
+ static_cast<VideoFrameProviderClientImpl*>(provider.client());
+ ASSERT_TRUE(client);
+ EXPECT_FALSE(client->active_video_layer());
+
+ video_layer_impl->DidBecomeActive();
+ EXPECT_TRUE(client->active_video_layer());
scherkus (not reviewing) 2014/03/28 21:37:29 this should probably be an EXPECT_EQ()
enne (OOO) 2014/03/28 21:39:35 If it fails, then you know it's NULL. So, maybe n
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/video_frame_provider_client_impl.cc ('k') | cc/test/fake_video_frame_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698