Commit cdadb3ff4329ce9d3630efc615f6b3ee48d4a75d

Martin Radev 2017-06-09T15:13:30

Decouple ANGLETest functionality and test parameters ANGLETest provides useful functionality for end2end tests, but it cannot be used for tests which take other test parameters than the platform. The patch introduces another level of abstraction by moving all of ANGLETest's functionality to another class - ANGLETestBase - which does not inherit from ::testing::TestWithParam<>. New tests can either inherit from ANGLETest as before to have only platform parameters, or they can inherit from ANGLETestBase and add handling of custom test parameters. Example: // The new parameter type must inherit from PlatformParameters. struct MyCustomParameters : PlatformParameters { bool mWorkaroundState; }; class MyTest : public ANGLETestBase, public ::testing::TestWithParam<MyCustomParameters> { protected: void overrideWorkaroundsD3D( angle::WorkaroundsD3D *workaroundsD3D) override { workaroundsD3D->myCustomWorkaround = GetParam().mWorkaroundState; } }; ANGLE_INSTANTIATE_TEST(MyTest, MyCustomParameters(ES3_D3D11(), false), MyCustomParameters(ES3_D3D11(), true)); BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ia36e429cff8c4c291fc87a286a1d1a3004d6fad6 Reviewed-on: https://chromium-review.googlesource.com/530945 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>