OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/test/layer_tree_test_common.h" | 5 #include "cc/test/layer_tree_test_common.h" |
6 | 6 |
7 #include "cc/animation.h" | 7 #include "cc/animation.h" |
8 #include "cc/animation_registrar.h" | 8 #include "cc/animation_registrar.h" |
9 #include "cc/base/thread_impl.h" | 9 #include "cc/base/thread_impl.h" |
10 #include "cc/content_layer.h" | 10 #include "cc/content_layer.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 m_implThread.reset(new base::Thread("ThreadedTest")); | 503 m_implThread.reset(new base::Thread("ThreadedTest")); |
504 ASSERT_TRUE(m_implThread->Start()); | 504 ASSERT_TRUE(m_implThread->Start()); |
505 } | 505 } |
506 | 506 |
507 m_mainCCThread = cc::ThreadImpl::CreateForCurrentThread(); | 507 m_mainCCThread = cc::ThreadImpl::CreateForCurrentThread(); |
508 | 508 |
509 initializeSettings(m_settings); | 509 initializeSettings(m_settings); |
510 | 510 |
511 m_mainCCThread->PostTask(base::Bind(&ThreadedTest::doBeginTest, base::Unreta
ined(this))); | 511 m_mainCCThread->PostTask(base::Bind(&ThreadedTest::doBeginTest, base::Unreta
ined(this))); |
512 m_timeout.Reset(base::Bind(&ThreadedTest::timeout, base::Unretained(this))); | 512 m_timeout.Reset(base::Bind(&ThreadedTest::timeout, base::Unretained(this))); |
513 m_mainCCThread->PostDelayedTask(m_timeout.callback(), 5000); | 513 m_mainCCThread->PostDelayedTask(m_timeout.callback(), base::TimeDelta::FromS
econds(5)); |
514 MessageLoop::current()->Run(); | 514 MessageLoop::current()->Run(); |
515 if (m_layerTreeHost.get() && m_layerTreeHost->root_layer()) | 515 if (m_layerTreeHost.get() && m_layerTreeHost->root_layer()) |
516 m_layerTreeHost->root_layer()->SetLayerTreeHost(NULL); | 516 m_layerTreeHost->root_layer()->SetLayerTreeHost(NULL); |
517 m_layerTreeHost.reset(); | 517 m_layerTreeHost.reset(); |
518 | 518 |
519 m_timeout.Cancel(); | 519 m_timeout.Cancel(); |
520 | 520 |
521 ASSERT_FALSE(m_layerTreeHost.get()); | 521 ASSERT_FALSE(m_layerTreeHost.get()); |
522 m_client.reset(); | 522 m_client.reset(); |
523 if (m_timedOut) { | 523 if (m_timedOut) { |
524 FAIL() << "Test timed out"; | 524 FAIL() << "Test timed out"; |
525 return; | 525 return; |
526 } | 526 } |
527 afterTest(); | 527 afterTest(); |
528 } | 528 } |
529 | 529 |
530 } // namespace cc | 530 } // namespace cc |
OLD | NEW |