| OLD | NEW |
| 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/surfaces/surface.h" | 5 #include "cc/surfaces/surface.h" |
| 6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
| 7 #include "cc/surfaces/local_surface_id_allocator.h" |
| 7 #include "cc/surfaces/surface_dependency_tracker.h" | 8 #include "cc/surfaces/surface_dependency_tracker.h" |
| 8 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
| 9 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
| 10 #include "cc/surfaces/surface_id_allocator.h" | |
| 11 #include "cc/surfaces/surface_manager.h" | 11 #include "cc/surfaces/surface_manager.h" |
| 12 #include "cc/test/begin_frame_args_test.h" | 12 #include "cc/test/begin_frame_args_test.h" |
| 13 #include "cc/test/fake_external_begin_frame_source.h" | 13 #include "cc/test/fake_external_begin_frame_source.h" |
| 14 #include "cc/test/scheduler_test_common.h" | 14 #include "cc/test/scheduler_test_common.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 47 factory.SubmitCompositorFrame(local_surface_id, CompositorFrame(), | 47 factory.SubmitCompositorFrame(local_surface_id, CompositorFrame(), |
| 48 SurfaceFactory::DrawCallback()); | 48 SurfaceFactory::DrawCallback()); |
| 49 EXPECT_TRUE(manager.GetSurfaceForId(surface_id)); | 49 EXPECT_TRUE(manager.GetSurfaceForId(surface_id)); |
| 50 factory.EvictSurface(); | 50 factory.EvictSurface(); |
| 51 | 51 |
| 52 EXPECT_EQ(NULL, manager.GetSurfaceForId(surface_id)); | 52 EXPECT_EQ(NULL, manager.GetSurfaceForId(surface_id)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TEST(SurfaceTest, SurfaceIds) { | 55 TEST(SurfaceTest, SurfaceIds) { |
| 56 for (size_t i = 0; i < 3; ++i) { | 56 for (size_t i = 0; i < 3; ++i) { |
| 57 SurfaceIdAllocator allocator; | 57 LocalSurfaceIdAllocator allocator; |
| 58 LocalSurfaceId id1 = allocator.GenerateId(); | 58 LocalSurfaceId id1 = allocator.GenerateId(); |
| 59 LocalSurfaceId id2 = allocator.GenerateId(); | 59 LocalSurfaceId id2 = allocator.GenerateId(); |
| 60 EXPECT_NE(id1, id2); | 60 EXPECT_NE(id1, id2); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 } // namespace cc | 65 } // namespace cc |
| OLD | NEW |