OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chromecast/base/component/component.h" | 5 #include "chromecast/base/component/component.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace chromecast { | 15 namespace chromecast { |
16 | 16 |
17 class ComponentTest : public ::testing::Test { | 17 class ComponentTest : public ::testing::Test { |
18 protected: | 18 protected: |
19 ComponentTest() : message_loop_(new base::MessageLoop()) {} | 19 ComponentTest() : message_loop_(new base::MessageLoop()) {} |
20 | 20 |
21 const std::unique_ptr<base::MessageLoop> message_loop_; | 21 const std::unique_ptr<base::MessageLoop> message_loop_; |
22 }; | 22 }; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // The held ref keeps |a| enabled until it goes out of scope. | 370 // The held ref keeps |a| enabled until it goes out of scope. |
371 EXPECT_TRUE(a->enabled()); | 371 EXPECT_TRUE(a->enabled()); |
372 } | 372 } |
373 message_loop_->RunUntilIdle(); | 373 message_loop_->RunUntilIdle(); |
374 EXPECT_FALSE(a->enabled()); | 374 EXPECT_FALSE(a->enabled()); |
375 EXPECT_FALSE(weak.Try()); | 375 EXPECT_FALSE(weak.Try()); |
376 a.release()->Destroy(); | 376 a.release()->Destroy(); |
377 } | 377 } |
378 | 378 |
379 } // namespace chromecast | 379 } // namespace chromecast |
OLD | NEW |