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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/occlusion_tracker.h" | 7 #include "cc/occlusion_tracker.h" |
8 | 8 |
9 #include "Region.h" | 9 #include "Region.h" |
10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 TEST_F(ClassName##MainThreadOpaqueLayers, runTest) { runMyTest(); } | 418 TEST_F(ClassName##MainThreadOpaqueLayers, runTest) { runMyTest(); } |
419 #define RUN_TEST_MAIN_THREAD_OPAQUE_PAINTS(ClassName) \ | 419 #define RUN_TEST_MAIN_THREAD_OPAQUE_PAINTS(ClassName) \ |
420 class ClassName##MainThreadOpaquePaints : public ClassName<OcclusionTrackerT
estMainThreadTypes> { \ | 420 class ClassName##MainThreadOpaquePaints : public ClassName<OcclusionTrackerT
estMainThreadTypes> { \ |
421 public: \ | 421 public: \ |
422 ClassName##MainThreadOpaquePaints() : ClassName<OcclusionTrackerTestMain
ThreadTypes>(false) { } \ | 422 ClassName##MainThreadOpaquePaints() : ClassName<OcclusionTrackerTestMain
ThreadTypes>(false) { } \ |
423 }; \ | 423 }; \ |
424 TEST_F(ClassName##MainThreadOpaquePaints, runTest) { runMyTest(); } | 424 TEST_F(ClassName##MainThreadOpaquePaints, runTest) { runMyTest(); } |
425 | 425 |
426 #define RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) \ | 426 #define RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) \ |
427 class ClassName##ImplThreadOpaqueLayers : public ClassName<OcclusionTrackerT
estImplThreadTypes> { \ | 427 class ClassName##ImplThreadOpaqueLayers : public ClassName<OcclusionTrackerT
estImplThreadTypes> { \ |
428 DebugScopedSetImplThread impl; \ | |
429 public: \ | 428 public: \ |
430 ClassName##ImplThreadOpaqueLayers() : ClassName<OcclusionTrackerTestImpl
ThreadTypes>(true) { } \ | 429 ClassName##ImplThreadOpaqueLayers() : ClassName<OcclusionTrackerTestImpl
ThreadTypes>(true) { } \ |
431 }; \ | 430 }; \ |
432 TEST_F(ClassName##ImplThreadOpaqueLayers, runTest) { runMyTest(); } | 431 TEST_F(ClassName##ImplThreadOpaqueLayers, runTest) { runMyTest(); } |
433 #define RUN_TEST_IMPL_THREAD_OPAQUE_PAINTS(ClassName) \ | 432 #define RUN_TEST_IMPL_THREAD_OPAQUE_PAINTS(ClassName) \ |
434 class ClassName##ImplThreadOpaquePaints : public ClassName<OcclusionTrackerT
estImplThreadTypes> { \ | 433 class ClassName##ImplThreadOpaquePaints : public ClassName<OcclusionTrackerT
estImplThreadTypes> { \ |
435 DebugScopedSetImplThread impl; \ | |
436 public: \ | 434 public: \ |
437 ClassName##ImplThreadOpaquePaints() : ClassName<OcclusionTrackerTestImpl
ThreadTypes>(false) { } \ | 435 ClassName##ImplThreadOpaquePaints() : ClassName<OcclusionTrackerTestImpl
ThreadTypes>(false) { } \ |
438 }; \ | 436 }; \ |
439 TEST_F(ClassName##ImplThreadOpaquePaints, runTest) { runMyTest(); } | 437 TEST_F(ClassName##ImplThreadOpaquePaints, runTest) { runMyTest(); } |
440 | 438 |
441 #define ALL_OCCLUSIONTRACKER_TEST(ClassName) \ | 439 #define ALL_OCCLUSIONTRACKER_TEST(ClassName) \ |
442 RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ | 440 RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ |
443 RUN_TEST_MAIN_THREAD_OPAQUE_PAINTS(ClassName) \ | 441 RUN_TEST_MAIN_THREAD_OPAQUE_PAINTS(ClassName) \ |
444 RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) \ | 442 RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) \ |
445 RUN_TEST_IMPL_THREAD_OPAQUE_PAINTS(ClassName) | 443 RUN_TEST_IMPL_THREAD_OPAQUE_PAINTS(ClassName) |
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 EXPECT_RECT_EQ(gfx::Rect(gfx::Point(), trackingSize), occlusion.occlusio
nInScreenSpace().bounds()); | 3165 EXPECT_RECT_EQ(gfx::Rect(gfx::Point(), trackingSize), occlusion.occlusio
nInScreenSpace().bounds()); |
3168 EXPECT_EQ(1u, Region::Iterator(occlusion.occlusionInScreenSpace()).size(
)); | 3166 EXPECT_EQ(1u, Region::Iterator(occlusion.occlusionInScreenSpace()).size(
)); |
3169 EXPECT_RECT_EQ(gfx::Rect(gfx::Point(), trackingSize), occlusion.occlusio
nInTargetSurface().bounds()); | 3167 EXPECT_RECT_EQ(gfx::Rect(gfx::Point(), trackingSize), occlusion.occlusio
nInTargetSurface().bounds()); |
3170 EXPECT_EQ(1u, Region::Iterator(occlusion.occlusionInTargetSurface()).siz
e()); | 3168 EXPECT_EQ(1u, Region::Iterator(occlusion.occlusionInTargetSurface()).siz
e()); |
3171 } | 3169 } |
3172 }; | 3170 }; |
3173 | 3171 |
3174 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); | 3172 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); |
3175 | 3173 |
3176 } // anonymous namespace | 3174 } // anonymous namespace |
OLD | NEW |