Confirmed users
214
edits
| Line 74: | Line 74: | ||
Note that the media pipeline and signaling_unittests do not test video, due to the linkage reasons mentioned below. | Note that the media pipeline and signaling_unittests do not test video, due to the linkage reasons mentioned below. | ||
==== Technical Notes on use of GTest ==== | |||
WebRTC's use of gtest is different from the conventional Firefox usage of gtest (the WebRTC tests | |||
were written first). | |||
* We need to start XPCOM. This is done using code from <code>mtransport_test_utils.h</code>. You | |||
invoke it as: | |||
int main(int argc, char **argv) { | |||
test_utils = new MtransportTestUtils(); | |||
// Start the tests | |||
::testing::InitGoogleTest(&argc, argv); | |||
int rv = RUN_ALL_TESTS(); | |||
delete test_utils; | |||
return rv; | |||
} | |||
* The thread derived from <code>main()</code> isn't used as the "main thread". We often spin up a separate | |||
thread to act as the main thread. This lets us wait for events while that thread ostensibly runs. | |||
* Due to Firefox's internal compilation, we have to separately compile a lot of files without <code>MOZILLA_INTERNAL_API</code>. This means that a number of | |||
files are compiled twice, e.g., in <code>mtransport/build</code> and <code>mtransport/standalone</code>. We still had problems linking with some elements of Firefox and so, for instance, parts of the video system are not available from the unit tests. | |||
=== Mochitests and Crashtests === | === Mochitests and Crashtests === | ||