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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
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/layers/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include "cc/layers/video_frame_provider_client_impl.h"
7 #include "cc/output/context_provider.h" 8 #include "cc/output/context_provider.h"
8 #include "cc/output/output_surface.h" 9 #include "cc/output/output_surface.h"
9 #include "cc/test/fake_video_frame_provider.h" 10 #include "cc/test/fake_video_frame_provider.h"
10 #include "cc/test/layer_test_common.h" 11 #include "cc/test/layer_test_common.h"
11 #include "cc/trees/single_thread_proxy.h" 12 #include "cc/trees/single_thread_proxy.h"
12 #include "media/base/video_frame.h" 13 #include "media/base/video_frame.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace cc { 16 namespace cc {
16 namespace { 17 namespace {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 impl.quad_list(), 70 impl.quad_list(),
70 gfx::Rect(layer_size), 71 gfx::Rect(layer_size),
71 occluded, 72 occluded,
72 &partially_occluded_count); 73 &partially_occluded_count);
73 // The layer outputs one quad, which is partially occluded. 74 // The layer outputs one quad, which is partially occluded.
74 EXPECT_EQ(1u, impl.quad_list().size()); 75 EXPECT_EQ(1u, impl.quad_list().size());
75 EXPECT_EQ(1u, partially_occluded_count); 76 EXPECT_EQ(1u, partially_occluded_count);
76 } 77 }
77 } 78 }
78 79
80 TEST(VideoLayerImplTest, DidBecomeActiveShouldSetActiveVideoLayer) {
81 LayerTestCommon::LayerImplTest impl;
82 DebugScopedSetImplThreadAndMainThreadBlocked thread(impl.proxy());
83
84 FakeVideoFrameProvider provider;
85 VideoLayerImpl* video_layer_impl =
86 impl.AddChildToRoot<VideoLayerImpl>(&provider);
87
88 VideoFrameProviderClientImpl* client =
89 static_cast<VideoFrameProviderClientImpl*>(provider.client());
90 ASSERT_TRUE(client);
91 EXPECT_FALSE(client->active_video_layer());
92
93 video_layer_impl->DidBecomeActive();
94 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
95 }
96
79 } // namespace 97 } // namespace
80 } // namespace cc 98 } // namespace cc
OLDNEW
« 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