| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
| 6 | 6 |
| 7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
| 8 #include "cc/resources/resource_provider.h" | 8 #include "cc/resources/resource_provider.h" |
| 9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
| 10 #include "cc/test/fake_output_surface_client.h" | 10 #include "cc/test/fake_output_surface_client.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 TEST_F(VideoResourceUpdaterTest, SoftwareFrame) { | 60 TEST_F(VideoResourceUpdaterTest, SoftwareFrame) { |
| 61 VideoResourceUpdater updater(output_surface3d_->context_provider().get(), | 61 VideoResourceUpdater updater(output_surface3d_->context_provider().get(), |
| 62 resource_provider3d_.get()); | 62 resource_provider3d_.get()); |
| 63 scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame(); | 63 scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame(); |
| 64 | 64 |
| 65 VideoFrameExternalResources resources = | 65 VideoFrameExternalResources resources = |
| 66 updater.CreateExternalResourcesFromVideoFrame(video_frame); | 66 updater.CreateExternalResourcesFromVideoFrame(video_frame); |
| 67 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); | 67 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); |
| 68 } | 68 } |
| 69 | 69 |
| 70 TEST_F(VideoResourceUpdaterTest, LostContextForSoftwareFrame) { | |
| 71 VideoResourceUpdater updater(output_surface3d_->context_provider().get(), | |
| 72 resource_provider3d_.get()); | |
| 73 scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame(); | |
| 74 | |
| 75 // Fail while creating the mailbox for the second YUV plane. | |
| 76 context3d_->set_times_gen_mailbox_succeeds(1); | |
| 77 | |
| 78 VideoFrameExternalResources resources = | |
| 79 updater.CreateExternalResourcesFromVideoFrame(video_frame); | |
| 80 EXPECT_EQ(VideoFrameExternalResources::NONE, resources.type); | |
| 81 } | |
| 82 | |
| 83 } // namespace | 70 } // namespace |
| 84 } // namespace cc | 71 } // namespace cc |
| OLD | NEW |