Chromium Code Reviews| Index: cc/test/layer_tree_test_common.cc |
| diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc |
| index e9be315ff0d790709fe6ecfbe2af67aacb63e4c6..d73367007b494a11458e670888c8a98449370a55 100644 |
| --- a/cc/test/layer_tree_test_common.cc |
| +++ b/cc/test/layer_tree_test_common.cc |
| @@ -316,10 +316,13 @@ void ThreadedTest::endTest() |
| { |
| // For the case where we endTest during beginTest(), set a flag to indicate that |
| // the test should end the second beginTest regains control. |
| - if (m_beginning) |
| + if (m_beginning) { |
| m_endWhenBeginReturns = true; |
| - else |
| - proxy()->MainThread()->PostTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); |
| + } else { |
| + // Racy timeouts and explicit endTest calls might have cleaned up the tree host. |
| + if (proxy()) |
|
Leandro GraciĆ” Gil
2013/03/19 17:30:58
Found flakiness here when creating the new layer-b
|
| + proxy()->MainThread()->PostTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); |
| + } |
| } |
| void ThreadedTest::endTestAfterDelay(int delayMilliseconds) |