| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "cc/layers/delegated_frame_resource_collection.h" | 9 #include "cc/layers/delegated_frame_resource_collection.h" |
| 10 #include "cc/resources/returned_resource.h" | 10 #include "cc/resources/returned_resource.h" |
| 11 #include "cc/resources/transferable_resource.h" | 11 #include "cc/resources/transferable_resource.h" |
| 12 #include "cc/trees/blocking_task_runner.h" | 12 #include "cc/trees/blocking_task_runner.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class DelegatedFrameResourceCollectionTest | 18 class DelegatedFrameResourceCollectionTest |
| 19 : public testing::Test, | 19 : public testing::Test, |
| 20 public DelegatedFrameResourceCollectionClient { | 20 public DelegatedFrameResourceCollectionClient { |
| 21 protected: | 21 protected: |
| 22 DelegatedFrameResourceCollectionTest() : resources_available_(false) {} | 22 DelegatedFrameResourceCollectionTest() : resources_available_(false) {} |
| 23 | 23 |
| 24 virtual void SetUp() override { CreateResourceCollection(); } | 24 void SetUp() override { CreateResourceCollection(); } |
| 25 | 25 |
| 26 virtual void TearDown() override { DestroyResourceCollection(); } | 26 void TearDown() override { DestroyResourceCollection(); } |
| 27 | 27 |
| 28 void CreateResourceCollection() { | 28 void CreateResourceCollection() { |
| 29 DCHECK(!resource_collection_.get()); | 29 DCHECK(!resource_collection_.get()); |
| 30 resource_collection_ = new DelegatedFrameResourceCollection; | 30 resource_collection_ = new DelegatedFrameResourceCollection; |
| 31 resource_collection_->SetClient(this); | 31 resource_collection_->SetClient(this); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void DestroyResourceCollection() { | 34 void DestroyResourceCollection() { |
| 35 if (resource_collection_.get()) { | 35 if (resource_collection_.get()) { |
| 36 resource_collection_->SetClient(nullptr); | 36 resource_collection_->SetClient(nullptr); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 return_callback, | 157 return_callback, |
| 158 returned_resources, | 158 returned_resources, |
| 159 null_event, | 159 null_event, |
| 160 main_thread_task_runner.get())); | 160 main_thread_task_runner.get())); |
| 161 | 161 |
| 162 thread.Stop(); | 162 thread.Stop(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace | 165 } // namespace |
| 166 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |