[email protected] | 7e34610 | 2013-05-16 18:03:57 | [diff] [blame] | 1 | // Copyright (c) 2013 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 | |
tommycli | a88b609 | 2015-05-14 17:54:01 | [diff] [blame] | 5 | #ifndef PPAPI_SHARED_IMPL_TEST_UTILS_H_ |
| 6 | #define PPAPI_SHARED_IMPL_TEST_UTILS_H_ |
| 7 | |
| 8 | #include <string> |
[email protected] | 7e34610 | 2013-05-16 18:03:57 | [diff] [blame] | 9 | |
| 10 | #include "ppapi/c/pp_var.h" |
| 11 | |
| 12 | namespace ppapi { |
| 13 | |
| 14 | // Compares two vars for equality. This is a deep comparison (the entire graph |
| 15 | // is traversed recursively). The function guarantees that the topology of the |
| 16 | // two PP_Var graphs being compared is identical, including graphs with cycles. |
[email protected] | 2c6b74d7 | 2014-03-26 05:04:16 | [diff] [blame] | 17 | // If |test_string_references| is set to true, then incoming references to |
| 18 | // string vars in the two graphs must be isomorphic. Otherwise only the content |
| 19 | // of the strings is tested for equality. |
| 20 | bool TestEqual(const PP_Var& expected, |
| 21 | const PP_Var& actual, |
| 22 | bool test_string_references); |
[email protected] | 7e34610 | 2013-05-16 18:03:57 | [diff] [blame] | 23 | |
tommycli | a88b609 | 2015-05-14 17:54:01 | [diff] [blame] | 24 | std::string StripTestPrefixes(const std::string& test_name); |
| 25 | |
[email protected] | 7e34610 | 2013-05-16 18:03:57 | [diff] [blame] | 26 | } // namespace ppapi |
| 27 | |
tommycli | a88b609 | 2015-05-14 17:54:01 | [diff] [blame] | 28 | #endif // PPAPI_SHARED_IMPL_TEST_UTILS_H_ |