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 3 // found in the LICENSE file. 4 5 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ 6 #define CC_TEST_LAYER_TEST_COMMON_H_ 7 8 #define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) \ 9 do { \ 10 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times((expect)); \ 11 code_to_test; \ 12 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ 13 } while (false) 14 15 #define EXPECT_SET_NEEDS_UPDATE(expect, code_to_test) \ 16 do { \ 17 EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times((expect)); \ 18 code_to_test; \ 19 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ 20 } while (false) 21 22 namespace gfx { class Rect; } 23 24 namespace cc { 25 class QuadList; 26 27 class LayerTestCommon { 28 public: 29 static const char* quad_string; 30 31 static void VerifyQuadsExactlyCoverRect(const cc::QuadList& quads, 32 gfx::Rect rect); 33 }; 34 35 } // namespace cc 36 37 #endif // CC_TEST_LAYER_TEST_COMMON_H_ 38