diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-19 23:36:22 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-19 23:36:22 +0000 |
commit | 76aa16e46dae43c3ebb9c9b2818e7d25e5b34806 (patch) | |
tree | 29007161ec33f2d0aeccd9712c53c7f35bf22bab /ppapi/tests/test_input_event.cc | |
parent | ddf6f55c37ef48e717803e059b8e836fefd1d418 (diff) | |
download | chromium_src-76aa16e46dae43c3ebb9c9b2818e7d25e5b34806.zip chromium_src-76aa16e46dae43c3ebb9c9b2818e7d25e5b34806.tar.gz chromium_src-76aa16e46dae43c3ebb9c9b2818e7d25e5b34806.tar.bz2 |
PPAPI/NaCl: Make related tests run in 1 fixture
I've only converted WebSockets tests in this CL. The idea is that the bulk of the test time is actually from starting up the test:
- Starting HTTP and/or WebSocket and/or SSL server
- Launching the renderer
- Launching the NaCl loader
- Downloading, validating, launching the .nexe
Now this all happens once for all WebSocket sub-tests (times 4: in-process, out-of-process, NaCl Newlib, NaCl Glibc). Locally, the time goes from about 5 minutes to less than 20 seconds.
The trick is now we can still enable/disable the individual tests from within ppapi_browsertest.cc.
BUG=
Review URL: https://chromiumcodereview.appspot.com/12193015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests/test_input_event.cc')
-rw-r--r-- | ppapi/tests/test_input_event.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/ppapi/tests/test_input_event.cc b/ppapi/tests/test_input_event.cc index c55912d..8aa8340 100644 --- a/ppapi/tests/test_input_event.cc +++ b/ppapi/tests/test_input_event.cc @@ -32,20 +32,16 @@ pp::Point GetCenter(const pp::Rect& rect) { void TestInputEvent::RunTests(const std::string& filter) { RUN_TEST(Events, filter); -// Like RUN_TEST, but does an exact match with the filter (which means it does -// not run the test if filter is empty). -#define RUN_TEST_EXACT_MATCH(name, test_filter) \ - if (test_filter == #name) { \ - set_callback_type(PP_OPTIONAL); \ - instance_->LogTest(#name, CheckResourcesAndVars(Test##name())); \ + // The AcceptTouchEvent_N tests should not be run when the filter is empty; + // they can only be run one at a time. + // TODO(dmichael): Figure out a way to make these run in the same test fixture + // instance. + if (!ShouldRunAllTests(filter)) { + RUN_TEST(AcceptTouchEvent_1, filter); + RUN_TEST(AcceptTouchEvent_2, filter); + RUN_TEST(AcceptTouchEvent_3, filter); + RUN_TEST(AcceptTouchEvent_4, filter); } - - RUN_TEST_EXACT_MATCH(AcceptTouchEvent_1, filter); - RUN_TEST_EXACT_MATCH(AcceptTouchEvent_2, filter); - RUN_TEST_EXACT_MATCH(AcceptTouchEvent_3, filter); - RUN_TEST_EXACT_MATCH(AcceptTouchEvent_4, filter); - -#undef RUN_TEST_EXACT_MATCH } TestInputEvent::TestInputEvent(TestingInstance* instance) |