| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
| 10 #include "cc/layers/io_surface_layer.h" | 10 #include "cc/layers/io_surface_layer.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 recovered_context_ = false; | 279 recovered_context_ = false; |
| 280 if (NextTestCase()) | 280 if (NextTestCase()) |
| 281 InvalidateAndSetNeedsCommit(); | 281 InvalidateAndSetNeedsCommit(); |
| 282 else | 282 else |
| 283 EndTest(); | 283 EndTest(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 virtual void InvalidateAndSetNeedsCommit() { | 286 virtual void InvalidateAndSetNeedsCommit() { |
| 287 // Cause damage so we try to draw. | 287 // Cause damage so we try to draw. |
| 288 layer_tree_host()->root_layer()->SetNeedsDisplay(); | 288 layer_tree_host()->root_layer()->SetNeedsDisplay(); |
| 289 layer_tree_host()->SetNeedsCommit(); |
| 289 } | 290 } |
| 290 | 291 |
| 291 bool NextTestCase() { | 292 bool NextTestCase() { |
| 292 static const TestCase kTests[] = { | 293 static const TestCase kTests[] = { |
| 293 // Losing the context and failing to recreate it (or losing it again | 294 // Losing the context and failing to recreate it (or losing it again |
| 294 // immediately) a small number of times should succeed. | 295 // immediately) a small number of times should succeed. |
| 295 { 1, // times_to_lose_during_commit | 296 { 1, // times_to_lose_during_commit |
| 296 0, // times_to_lose_during_draw | 297 0, // times_to_lose_during_draw |
| 297 3, // times_to_fail_reinitialize | 298 3, // times_to_fail_reinitialize |
| 298 0, // times_to_fail_recreate | 299 0, // times_to_fail_recreate |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 impl_thread ? impl_thread->message_loop_proxy() : NULL); | 1598 impl_thread ? impl_thread->message_loop_proxy() : NULL); |
| 1598 EXPECT_FALSE(layer_tree_host); | 1599 EXPECT_FALSE(layer_tree_host); |
| 1599 } | 1600 } |
| 1600 }; | 1601 }; |
| 1601 | 1602 |
| 1602 SINGLE_AND_MULTI_THREAD_TEST_F( | 1603 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1603 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); | 1604 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); |
| 1604 | 1605 |
| 1605 } // namespace | 1606 } // namespace |
| 1606 } // namespace cc | 1607 } // namespace cc |
| OLD | NEW |