| 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/content_layer.h" | 9 #include "cc/content_layer.h" |
| 10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 TestHooks* m_testHooks; | 283 TestHooks* m_testHooks; |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 ThreadedTest::ThreadedTest() | 286 ThreadedTest::ThreadedTest() |
| 287 : m_beginning(false) | 287 : m_beginning(false) |
| 288 , m_endWhenBeginReturns(false) | 288 , m_endWhenBeginReturns(false) |
| 289 , m_timedOut(false) | 289 , m_timedOut(false) |
| 290 , m_scheduled(false) | 290 , m_scheduled(false) |
| 291 , m_started(false) | 291 , m_started(false) |
| 292 , m_ended(false) |
| 292 , m_implThread(0) | 293 , m_implThread(0) |
| 293 , m_weakFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) | 294 , m_weakFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) |
| 294 { | 295 { |
| 295 m_mainThreadWeakPtr = m_weakFactory.GetWeakPtr(); | 296 m_mainThreadWeakPtr = m_weakFactory.GetWeakPtr(); |
| 296 } | 297 } |
| 297 | 298 |
| 298 ThreadedTest::~ThreadedTest() | 299 ThreadedTest::~ThreadedTest() |
| 299 { | 300 { |
| 300 } | 301 } |
| 301 | 302 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 void ThreadedTest::scheduleComposite() | 393 void ThreadedTest::scheduleComposite() |
| 393 { | 394 { |
| 394 if (!m_started || m_scheduled) | 395 if (!m_started || m_scheduled) |
| 395 return; | 396 return; |
| 396 m_scheduled = true; | 397 m_scheduled = true; |
| 397 proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchComposite,
m_mainThreadWeakPtr)); | 398 proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchComposite,
m_mainThreadWeakPtr)); |
| 398 } | 399 } |
| 399 | 400 |
| 400 void ThreadedTest::realEndTest() | 401 void ThreadedTest::realEndTest() |
| 401 { | 402 { |
| 403 m_ended = true; |
| 404 |
| 402 if (m_layerTreeHost && proxy()->commitPendingForTesting()) { | 405 if (m_layerTreeHost && proxy()->commitPendingForTesting()) { |
| 403 proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m
_mainThreadWeakPtr)); | 406 proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m
_mainThreadWeakPtr)); |
| 404 return; | 407 return; |
| 405 } | 408 } |
| 406 | 409 |
| 407 MessageLoop::current()->Quit(); | 410 MessageLoop::current()->Quit(); |
| 408 } | 411 } |
| 409 | 412 |
| 410 void ThreadedTest::dispatchAddInstantAnimation() | 413 void ThreadedTest::dispatchAddInstantAnimation() |
| 411 { | 414 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 ASSERT_FALSE(m_layerTreeHost.get()); | 489 ASSERT_FALSE(m_layerTreeHost.get()); |
| 487 m_client.reset(); | 490 m_client.reset(); |
| 488 if (m_timedOut) { | 491 if (m_timedOut) { |
| 489 FAIL() << "Test timed out"; | 492 FAIL() << "Test timed out"; |
| 490 return; | 493 return; |
| 491 } | 494 } |
| 492 afterTest(); | 495 afterTest(); |
| 493 } | 496 } |
| 494 | 497 |
| 495 } // namespace cc | 498 } // namespace cc |
| OLD | NEW |