diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-09 00:19:33 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-09 00:19:33 +0000 |
commit | c1371f576cde5075206434c94bd462397f6e6809 (patch) | |
tree | 10ba48876e42ae45d30d999aa948272b00738ac7 /ppapi | |
parent | b3dc82b6fd757ca2314990afcad0c4650c43845e (diff) | |
download | chromium_src-c1371f576cde5075206434c94bd462397f6e6809.zip chromium_src-c1371f576cde5075206434c94bd462397f6e6809.tar.gz chromium_src-c1371f576cde5075206434c94bd462397f6e6809.tar.bz2 |
Revert 109114
Turned Mac valgrind bots red:
OutOfProcessPPAPITest.PostMessage_MessageEvent
OutOfProcessPPAPITest.PostMessage_ExtraParam
PPAPITest.PostMessage_NoHandler
OutOfProcessPPAPITest.PostMessage_SendInInit
Probably others
- Make it possible to enable/disable specific ppapi tests. Migrate PostMessage tests.
Most of these files were changed by a sed script, so it's not as bad as it looks.
The testcase attribute now can include a 'filter'. If it's omitted, everything works the same as before. This way we can migrate tests over bit-by-bit if we want to. We can also still run the tests manually the same way as before.
This only runs PostMessage testss the new way, and re-enables all oop PostMessage tests that pass on Windows. I can do the other tests in this CL if desired, but it might be easier to land in a few pieces.
BUG=102885,95557
TEST=N/A
Review URL: http://codereview.chromium.org/8477015
TBR=dmichael@chromium.org
Review URL: http://codereview.chromium.org/8497030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
60 files changed, 215 insertions, 257 deletions
diff --git a/ppapi/tests/test_broker.cc b/ppapi/tests/test_broker.cc index cfc60fb..b1d5b02 100644 --- a/ppapi/tests/test_broker.cc +++ b/ppapi/tests/test_broker.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,8 +22,8 @@ bool TestBroker::Init() { return !!broker_interface_; } -void TestBroker::RunTests(const std::string& filter) { - RUN_TEST(Create, filter); +void TestBroker::RunTest() { + RUN_TEST(Create); } std::string TestBroker::TestCreate() { diff --git a/ppapi/tests/test_broker.h b/ppapi/tests/test_broker.h index c11d2f8..4cef9e5 100644 --- a/ppapi/tests/test_broker.h +++ b/ppapi/tests/test_broker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,7 @@ class TestBroker : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestCreate(); diff --git a/ppapi/tests/test_buffer.cc b/ppapi/tests/test_buffer.cc index 902bd2f..b44047b 100644 --- a/ppapi/tests/test_buffer.cc +++ b/ppapi/tests/test_buffer.cc @@ -19,7 +19,7 @@ bool TestBuffer::Init() { return !!buffer_interface_; } -void TestBuffer::RunTests(const std::string& filter) { +void TestBuffer::RunTest() { instance_->LogTest("InvalidSize", TestInvalidSize()); instance_->LogTest("InitToZero", TestInitToZero()); instance_->LogTest("IsBuffer", TestIsBuffer()); diff --git a/ppapi/tests/test_buffer.h b/ppapi/tests/test_buffer.h index 7dea017..ede075c 100644 --- a/ppapi/tests/test_buffer.h +++ b/ppapi/tests/test_buffer.h @@ -17,7 +17,7 @@ class TestBuffer : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestInvalidSize(); diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc index bcee6c3..8245c25 100644 --- a/ppapi/tests/test_case.cc +++ b/ppapi/tests/test_case.cc @@ -88,9 +88,3 @@ bool TestCase::EnsureRunningOverHTTP() { return true; } - -bool TestCase::MatchesFilter(const std::string& test_name, - const std::string& filter) { - return filter.empty() || (test_name == filter); -} - diff --git a/ppapi/tests/test_case.h b/ppapi/tests/test_case.h index e974c50..05e0d32 100644 --- a/ppapi/tests/test_case.h +++ b/ppapi/tests/test_case.h @@ -37,12 +37,9 @@ class TestCase { // Default implementation just returns true. virtual bool Init(); - // Override to implement the test case. It will be called after the plugin is - // first displayed, passing a string. If the string is empty, the - // should run all tests for this test case. Otherwise, it should run the test - // whose name matches test_filter exactly (if there is one). This should - // generally be implemented using the RUN_TEST* macros. - virtual void RunTests(const std::string& test_filter) = 0; + // Override to implement the test. It will be called after the plugin is + // first displayed. + virtual void RunTest() = 0; static std::string MakeFailureMessage(const char* file, int line, const char* cmd); @@ -86,10 +83,6 @@ class TestCase { // Makes sure the test is run over HTTP. bool EnsureRunningOverHTTP(); - // Return true if the given test name matches the filter. This is true if - // (a) filter is empty or (b) test_name and filter match exactly. - bool MatchesFilter(const std::string& test_name, const std::string& filter); - // Pointer to the instance that owns us. TestingInstance* instance_; @@ -147,24 +140,24 @@ class TestCaseFactory { // Helper macro for calling functions implementing specific tests in the // RunTest function. This assumes the function name is TestFoo where Foo is the // test |name|. -#define RUN_TEST(name, test_filter) \ - if (MatchesFilter(#name, test_filter)) { \ +#define RUN_TEST(name) \ + do { \ force_async_ = false; \ instance_->LogTest(#name, Test##name()); \ - } + } while (false) // Like RUN_TEST above but forces functions taking callbacks to complete // asynchronously on success or error. -#define RUN_TEST_FORCEASYNC(name, test_filter) \ - if (MatchesFilter(#name"ForceAsync", test_filter)) { \ +#define RUN_TEST_FORCEASYNC(name) \ + do { \ force_async_ = true; \ instance_->LogTest(#name"ForceAsync", Test##name()); \ - } + } while (false) -#define RUN_TEST_FORCEASYNC_AND_NOT(name, test_filter) \ +#define RUN_TEST_FORCEASYNC_AND_NOT(name) \ do { \ - RUN_TEST_FORCEASYNC(name, test_filter); \ - RUN_TEST(name, test_filter); \ + RUN_TEST_FORCEASYNC(name); \ + RUN_TEST(name); \ } while (false) diff --git a/ppapi/tests/test_char_set.cc b/ppapi/tests/test_char_set.cc index 05e32c9..5c7ae69 100644 --- a/ppapi/tests/test_char_set.cc +++ b/ppapi/tests/test_char_set.cc @@ -22,10 +22,10 @@ bool TestCharSet::Init() { return !!char_set_interface_; } -void TestCharSet::RunTests(const std::string& filter) { - RUN_TEST(UTF16ToCharSet, filter); - RUN_TEST(CharSetToUTF16, filter); - RUN_TEST(GetDefaultCharSet, filter); +void TestCharSet::RunTest() { + RUN_TEST(UTF16ToCharSet); + RUN_TEST(CharSetToUTF16); + RUN_TEST(GetDefaultCharSet); } std::string TestCharSet::TestUTF16ToCharSet() { diff --git a/ppapi/tests/test_char_set.h b/ppapi/tests/test_char_set.h index 3183e18..c6a14fe 100644 --- a/ppapi/tests/test_char_set.h +++ b/ppapi/tests/test_char_set.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,7 +19,7 @@ class TestCharSet : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestUTF16ToCharSet(); diff --git a/ppapi/tests/test_core.cc b/ppapi/tests/test_core.cc index 7686c30..82f93613 100644 --- a/ppapi/tests/test_core.cc +++ b/ppapi/tests/test_core.cc @@ -32,9 +32,9 @@ bool TestCore::Init() { return true; } -void TestCore::RunTests(const std::string& filter) { - RUN_TEST(Time, filter); - RUN_TEST(TimeTicks, filter); +void TestCore::RunTest() { + RUN_TEST(Time); + RUN_TEST(TimeTicks); } std::string TestCore::TestTime() { diff --git a/ppapi/tests/test_core.h b/ppapi/tests/test_core.h index 0c1632b..2b5899a 100644 --- a/ppapi/tests/test_core.h +++ b/ppapi/tests/test_core.h @@ -18,7 +18,7 @@ class TestCore : public TestCase { private: // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); std::string TestTime(); std::string TestTimeTicks(); diff --git a/ppapi/tests/test_crypto.cc b/ppapi/tests/test_crypto.cc index 8371e61..b91f3a8 100644 --- a/ppapi/tests/test_crypto.cc +++ b/ppapi/tests/test_crypto.cc @@ -21,8 +21,8 @@ bool TestCrypto::Init() { return !!crypto_interface_; } -void TestCrypto::RunTests(const std::string& filter) { - RUN_TEST(GetRandomBytes, filter); +void TestCrypto::RunTest() { + RUN_TEST(GetRandomBytes); } std::string TestCrypto::TestGetRandomBytes() { diff --git a/ppapi/tests/test_crypto.h b/ppapi/tests/test_crypto.h index 681e648..39ef600 100644 --- a/ppapi/tests/test_crypto.h +++ b/ppapi/tests/test_crypto.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,7 @@ class TestCrypto : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestGetRandomBytes(); diff --git a/ppapi/tests/test_cursor_control.cc b/ppapi/tests/test_cursor_control.cc index 55e5225..80aca34 100644 --- a/ppapi/tests/test_cursor_control.cc +++ b/ppapi/tests/test_cursor_control.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,8 +21,8 @@ bool TestCursorControl::Init() { return !!cursor_control_interface_; } -void TestCursorControl::RunTests(const std::string& filter) { - RUN_TEST(SetCursor, filter); +void TestCursorControl::RunTest() { + RUN_TEST(SetCursor); } std::string TestCursorControl::TestSetCursor() { diff --git a/ppapi/tests/test_cursor_control.h b/ppapi/tests/test_cursor_control.h index 0159660..65bc7a9 100644 --- a/ppapi/tests/test_cursor_control.h +++ b/ppapi/tests/test_cursor_control.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,7 @@ class TestCursorControl : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestSetCursor(); diff --git a/ppapi/tests/test_directory_reader.cc b/ppapi/tests/test_directory_reader.cc index 3823f29..17d2ae3 100644 --- a/ppapi/tests/test_directory_reader.cc +++ b/ppapi/tests/test_directory_reader.cc @@ -75,8 +75,8 @@ bool TestDirectoryReader::Init() { return InitTestingInterface() && EnsureRunningOverHTTP(); } -void TestDirectoryReader::RunTests(const std::string& filter) { - RUN_TEST(GetNextFile, filter); +void TestDirectoryReader::RunTest() { + RUN_TEST(GetNextFile); } std::string TestDirectoryReader::TestGetNextFile() { diff --git a/ppapi/tests/test_directory_reader.h b/ppapi/tests/test_directory_reader.h index 8f68530..932d1b3 100644 --- a/ppapi/tests/test_directory_reader.h +++ b/ppapi/tests/test_directory_reader.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,7 +16,7 @@ class TestDirectoryReader : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestGetNextFile(); diff --git a/ppapi/tests/test_file_io.cc b/ppapi/tests/test_file_io.cc index 79995ff..d245b87 100644 --- a/ppapi/tests/test_file_io.cc +++ b/ppapi/tests/test_file_io.cc @@ -111,15 +111,15 @@ bool TestFileIO::Init() { return InitTestingInterface() && EnsureRunningOverHTTP(); } -void TestFileIO::RunTests(const std::string& filter) { - RUN_TEST_FORCEASYNC_AND_NOT(Open, filter); - RUN_TEST_FORCEASYNC_AND_NOT(ReadWriteSetLength, filter); - RUN_TEST_FORCEASYNC_AND_NOT(TouchQuery, filter); - RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls, filter); - RUN_TEST_FORCEASYNC_AND_NOT(ParallelReads, filter); - RUN_TEST_FORCEASYNC_AND_NOT(ParallelWrites, filter); - RUN_TEST_FORCEASYNC_AND_NOT(NotAllowMixedReadWrite, filter); - RUN_TEST_FORCEASYNC_AND_NOT(WillWriteWillSetLength, filter); +void TestFileIO::RunTest() { + RUN_TEST_FORCEASYNC_AND_NOT(Open); + RUN_TEST_FORCEASYNC_AND_NOT(ReadWriteSetLength); + RUN_TEST_FORCEASYNC_AND_NOT(TouchQuery); + RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls); + RUN_TEST_FORCEASYNC_AND_NOT(ParallelReads); + RUN_TEST_FORCEASYNC_AND_NOT(ParallelWrites); + RUN_TEST_FORCEASYNC_AND_NOT(NotAllowMixedReadWrite); + RUN_TEST_FORCEASYNC_AND_NOT(WillWriteWillSetLength); // TODO(viettrungluu): add tests: // - that PP_ERROR_PENDING is correctly returned diff --git a/ppapi/tests/test_file_io.h b/ppapi/tests/test_file_io.h index b971105..016fdef 100644 --- a/ppapi/tests/test_file_io.h +++ b/ppapi/tests/test_file_io.h @@ -19,7 +19,7 @@ class TestFileIO : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: enum OpenExpectation { diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc index b17450d..d6b3b36 100644 --- a/ppapi/tests/test_file_ref.cc +++ b/ppapi/tests/test_file_ref.cc @@ -44,16 +44,16 @@ bool TestFileRef::Init() { return InitTestingInterface() && EnsureRunningOverHTTP(); } -void TestFileRef::RunTests(const std::string& filter) { - RUN_TEST_FORCEASYNC_AND_NOT(Create, filter); - RUN_TEST_FORCEASYNC_AND_NOT(GetFileSystemType, filter); - RUN_TEST_FORCEASYNC_AND_NOT(GetName, filter); - RUN_TEST_FORCEASYNC_AND_NOT(GetPath, filter); - RUN_TEST_FORCEASYNC_AND_NOT(GetParent, filter); - RUN_TEST_FORCEASYNC_AND_NOT(MakeDirectory, filter); - RUN_TEST_FORCEASYNC_AND_NOT(QueryAndTouchFile, filter); - RUN_TEST_FORCEASYNC_AND_NOT(DeleteFileAndDirectory, filter); - RUN_TEST_FORCEASYNC_AND_NOT(RenameFileAndDirectory, filter); +void TestFileRef::RunTest() { + RUN_TEST_FORCEASYNC_AND_NOT(Create); + RUN_TEST_FORCEASYNC_AND_NOT(GetFileSystemType); + RUN_TEST_FORCEASYNC_AND_NOT(GetName); + RUN_TEST_FORCEASYNC_AND_NOT(GetPath); + RUN_TEST_FORCEASYNC_AND_NOT(GetParent); + RUN_TEST_FORCEASYNC_AND_NOT(MakeDirectory); + RUN_TEST_FORCEASYNC_AND_NOT(QueryAndTouchFile); + RUN_TEST_FORCEASYNC_AND_NOT(DeleteFileAndDirectory); + RUN_TEST_FORCEASYNC_AND_NOT(RenameFileAndDirectory); } std::string TestFileRef::TestCreate() { diff --git a/ppapi/tests/test_file_ref.h b/ppapi/tests/test_file_ref.h index e162815..63df14e 100644 --- a/ppapi/tests/test_file_ref.h +++ b/ppapi/tests/test_file_ref.h @@ -15,7 +15,7 @@ class TestFileRef : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestCreate(); diff --git a/ppapi/tests/test_file_system.cc b/ppapi/tests/test_file_system.cc index 2b5a0c5..cb37284 100644 --- a/ppapi/tests/test_file_system.cc +++ b/ppapi/tests/test_file_system.cc @@ -17,9 +17,9 @@ bool TestFileSystem::Init() { return InitTestingInterface() && EnsureRunningOverHTTP(); } -void TestFileSystem::RunTests(const std::string& filter) { - RUN_TEST_FORCEASYNC_AND_NOT(Open, filter); - RUN_TEST_FORCEASYNC_AND_NOT(MultipleOpens, filter); +void TestFileSystem::RunTest() { + RUN_TEST_FORCEASYNC_AND_NOT(Open); + RUN_TEST_FORCEASYNC_AND_NOT(MultipleOpens); } std::string TestFileSystem::TestOpen() { diff --git a/ppapi/tests/test_file_system.h b/ppapi/tests/test_file_system.h index 3838a4a..3a200f2 100644 --- a/ppapi/tests/test_file_system.h +++ b/ppapi/tests/test_file_system.h @@ -15,7 +15,7 @@ class TestFileSystem : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestOpen(); diff --git a/ppapi/tests/test_flash_clipboard.cc b/ppapi/tests/test_flash_clipboard.cc index e112baf..600dad3 100644 --- a/ppapi/tests/test_flash_clipboard.cc +++ b/ppapi/tests/test_flash_clipboard.cc @@ -22,8 +22,8 @@ bool TestFlashClipboard::Init() { return !!clipboard_interface_; } -void TestFlashClipboard::RunTests(const std::string& filter) { - RUN_TEST(ReadWrite, filter); +void TestFlashClipboard::RunTest() { + RUN_TEST(ReadWrite); } std::string TestFlashClipboard::TestReadWrite() { diff --git a/ppapi/tests/test_flash_clipboard.h b/ppapi/tests/test_flash_clipboard.h index 06d3781..eacf933 100644 --- a/ppapi/tests/test_flash_clipboard.h +++ b/ppapi/tests/test_flash_clipboard.h @@ -17,7 +17,7 @@ class TestFlashClipboard : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestReadWrite(); diff --git a/ppapi/tests/test_flash_fullscreen.cc b/ppapi/tests/test_flash_fullscreen.cc index f7f122b..09e0b18 100644 --- a/ppapi/tests/test_flash_fullscreen.cc +++ b/ppapi/tests/test_flash_fullscreen.cc @@ -49,9 +49,9 @@ bool TestFlashFullscreen::Init() { return InitTestingInterface(); } -void TestFlashFullscreen::RunTests(const std::string& filter) { - RUN_TEST(GetScreenSize, filter); - RUN_TEST(NormalToFullscreenToNormal, filter); +void TestFlashFullscreen::RunTest() { + RUN_TEST(GetScreenSize); + RUN_TEST(NormalToFullscreenToNormal); } std::string TestFlashFullscreen::TestGetScreenSize() { diff --git a/ppapi/tests/test_flash_fullscreen.h b/ppapi/tests/test_flash_fullscreen.h index b5d6daf..539a84f 100644 --- a/ppapi/tests/test_flash_fullscreen.h +++ b/ppapi/tests/test_flash_fullscreen.h @@ -22,7 +22,7 @@ class TestFlashFullscreen : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip); private: diff --git a/ppapi/tests/test_fullscreen.cc b/ppapi/tests/test_fullscreen.cc index b16f694..db535d5 100644 --- a/ppapi/tests/test_fullscreen.cc +++ b/ppapi/tests/test_fullscreen.cc @@ -50,9 +50,9 @@ bool TestFullscreen::Init() { return InitTestingInterface(); } -void TestFullscreen::RunTests(const std::string& filter) { - RUN_TEST(GetScreenSize, filter); - RUN_TEST(NormalToFullscreenToNormal, filter); +void TestFullscreen::RunTest() { + RUN_TEST(GetScreenSize); + RUN_TEST(NormalToFullscreenToNormal); } bool TestFullscreen::GotError() { diff --git a/ppapi/tests/test_fullscreen.h b/ppapi/tests/test_fullscreen.h index b80607db..6f2f127 100644 --- a/ppapi/tests/test_fullscreen.h +++ b/ppapi/tests/test_fullscreen.h @@ -24,7 +24,7 @@ class TestFullscreen : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); virtual bool HandleInputEvent(const pp::InputEvent& event); virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip); diff --git a/ppapi/tests/test_graphics_2d.cc b/ppapi/tests/test_graphics_2d.cc index 38b5d11..e46bea9 100644 --- a/ppapi/tests/test_graphics_2d.cc +++ b/ppapi/tests/test_graphics_2d.cc @@ -41,16 +41,16 @@ bool TestGraphics2D::Init() { InitTestingInterface(); } -void TestGraphics2D::RunTests(const std::string& filter) { - RUN_TEST(InvalidResource, filter); - RUN_TEST(InvalidSize, filter); - RUN_TEST(Humongous, filter); - RUN_TEST(InitToZero, filter); - RUN_TEST(Describe, filter); - RUN_TEST_FORCEASYNC_AND_NOT(Paint, filter); - // RUN_TEST_FORCEASYNC_AND_NOT(Scroll); // TODO(brettw, filter) implement. - RUN_TEST_FORCEASYNC_AND_NOT(Replace, filter); - RUN_TEST_FORCEASYNC_AND_NOT(Flush, filter); +void TestGraphics2D::RunTest() { + RUN_TEST(InvalidResource); + RUN_TEST(InvalidSize); + RUN_TEST(Humongous); + RUN_TEST(InitToZero); + RUN_TEST(Describe); + RUN_TEST_FORCEASYNC_AND_NOT(Paint); + // RUN_TEST_FORCEASYNC_AND_NOT(Scroll); // TODO(brettw) implement. + RUN_TEST_FORCEASYNC_AND_NOT(Replace); + RUN_TEST_FORCEASYNC_AND_NOT(Flush); } void TestGraphics2D::QuitMessageLoop() { diff --git a/ppapi/tests/test_graphics_2d.h b/ppapi/tests/test_graphics_2d.h index 36e4415..95ba7ef 100644 --- a/ppapi/tests/test_graphics_2d.h +++ b/ppapi/tests/test_graphics_2d.h @@ -25,7 +25,7 @@ class TestGraphics2D : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); void QuitMessageLoop(); diff --git a/ppapi/tests/test_graphics_3d.cc b/ppapi/tests/test_graphics_3d.cc index 4bdd09d..ea6aa05 100644 --- a/ppapi/tests/test_graphics_3d.cc +++ b/ppapi/tests/test_graphics_3d.cc @@ -21,8 +21,8 @@ bool TestGraphics3D::Init() { return opengl_es2_ && InitTestingInterface(); } -void TestGraphics3D::RunTests(const std::string& filter) { - RUN_TEST(Frame, filter); +void TestGraphics3D::RunTest() { + RUN_TEST(Frame); } std::string TestGraphics3D::TestFrame() { diff --git a/ppapi/tests/test_graphics_3d.h b/ppapi/tests/test_graphics_3d.h index 7f694b5..e671230 100644 --- a/ppapi/tests/test_graphics_3d.h +++ b/ppapi/tests/test_graphics_3d.h @@ -20,7 +20,7 @@ class TestGraphics3D : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: // Various tests. diff --git a/ppapi/tests/test_image_data.cc b/ppapi/tests/test_image_data.cc index cd56a52..ed130cd 100644 --- a/ppapi/tests/test_image_data.cc +++ b/ppapi/tests/test_image_data.cc @@ -18,7 +18,7 @@ bool TestImageData::Init() { return !!image_data_interface_; } -void TestImageData::RunTests(const std::string& filter) { +void TestImageData::RunTest() { instance_->LogTest("InvalidFormat", TestInvalidFormat()); instance_->LogTest("InvalidSize", TestInvalidSize()); instance_->LogTest("HugeSize", TestHugeSize()); diff --git a/ppapi/tests/test_image_data.h b/ppapi/tests/test_image_data.h index e6fb969c..c3f7dcd 100644 --- a/ppapi/tests/test_image_data.h +++ b/ppapi/tests/test_image_data.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,7 +15,7 @@ class TestImageData : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestInvalidFormat(); diff --git a/ppapi/tests/test_instance_deprecated.cc b/ppapi/tests/test_instance_deprecated.cc index a62f202..9ff1e7e 100644 --- a/ppapi/tests/test_instance_deprecated.cc +++ b/ppapi/tests/test_instance_deprecated.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -77,8 +77,8 @@ bool TestInstance::Init() { return true; } -void TestInstance::RunTests(const std::string& filter) { - RUN_TEST(ExecuteScript, filter); +void TestInstance::RunTest() { + RUN_TEST(ExecuteScript); } pp::deprecated::ScriptableObject* TestInstance::CreateTestObject() { diff --git a/ppapi/tests/test_instance_deprecated.h b/ppapi/tests/test_instance_deprecated.h index 8b81501..fdd7174 100644 --- a/ppapi/tests/test_instance_deprecated.h +++ b/ppapi/tests/test_instance_deprecated.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,7 +16,7 @@ class TestInstance : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); void set_string(const std::string& s) { string_ = s; } diff --git a/ppapi/tests/test_memory.cc b/ppapi/tests/test_memory.cc index 4acbd5f..1dedbd4 100644 --- a/ppapi/tests/test_memory.cc +++ b/ppapi/tests/test_memory.cc @@ -24,9 +24,9 @@ bool TestMemory::Init() { return memory_dev_interface_ && InitTestingInterface(); } -void TestMemory::RunTests(const std::string& filter) { - RUN_TEST(MemAlloc, filter); - RUN_TEST(NullMemFree, filter); +void TestMemory::RunTest() { + RUN_TEST(MemAlloc); + RUN_TEST(NullMemFree); } std::string TestMemory::TestMemAlloc() { diff --git a/ppapi/tests/test_memory.h b/ppapi/tests/test_memory.h index 10c8d79..4215ba0 100644 --- a/ppapi/tests/test_memory.h +++ b/ppapi/tests/test_memory.h @@ -18,7 +18,7 @@ class TestMemory : public TestCase { private: // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); std::string TestMemAlloc(); std::string TestNullMemFree(); diff --git a/ppapi/tests/test_paint_aggregator.cc b/ppapi/tests/test_paint_aggregator.cc index 77e2174..be3f19c 100644 --- a/ppapi/tests/test_paint_aggregator.cc +++ b/ppapi/tests/test_paint_aggregator.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,27 +13,27 @@ bool TestPaintAggregator::Init() { return true; } -void TestPaintAggregator::RunTests(const std::string& filter) { - RUN_TEST(InitialState, filter); - RUN_TEST(SingleInvalidation, filter); - RUN_TEST(DoubleDisjointInvalidation, filter); - RUN_TEST(SingleScroll, filter); - RUN_TEST(DoubleOverlappingScroll, filter); - RUN_TEST(NegatingScroll, filter); - RUN_TEST(DiagonalScroll, filter); - RUN_TEST(ContainedPaintAfterScroll, filter); - RUN_TEST(ContainedPaintBeforeScroll, filter); - RUN_TEST(ContainedPaintsBeforeAndAfterScroll, filter); - RUN_TEST(LargeContainedPaintAfterScroll, filter); - RUN_TEST(LargeContainedPaintBeforeScroll, filter); - RUN_TEST(OverlappingPaintBeforeScroll, filter); - RUN_TEST(OverlappingPaintAfterScroll, filter); - RUN_TEST(DisjointPaintBeforeScroll, filter); - RUN_TEST(DisjointPaintAfterScroll, filter); - RUN_TEST(ContainedPaintTrimmedByScroll, filter); - RUN_TEST(ContainedPaintEliminatedByScroll, filter); - RUN_TEST(ContainedPaintAfterScrollTrimmedByScrollDamage, filter); - RUN_TEST(ContainedPaintAfterScrollEliminatedByScrollDamage, filter); +void TestPaintAggregator::RunTest() { + RUN_TEST(InitialState); + RUN_TEST(SingleInvalidation); + RUN_TEST(DoubleDisjointInvalidation); + RUN_TEST(SingleScroll); + RUN_TEST(DoubleOverlappingScroll); + RUN_TEST(NegatingScroll); + RUN_TEST(DiagonalScroll); + RUN_TEST(ContainedPaintAfterScroll); + RUN_TEST(ContainedPaintBeforeScroll); + RUN_TEST(ContainedPaintsBeforeAndAfterScroll); + RUN_TEST(LargeContainedPaintAfterScroll); + RUN_TEST(LargeContainedPaintBeforeScroll); + RUN_TEST(OverlappingPaintBeforeScroll); + RUN_TEST(OverlappingPaintAfterScroll); + RUN_TEST(DisjointPaintBeforeScroll); + RUN_TEST(DisjointPaintAfterScroll); + RUN_TEST(ContainedPaintTrimmedByScroll); + RUN_TEST(ContainedPaintEliminatedByScroll); + RUN_TEST(ContainedPaintAfterScrollTrimmedByScrollDamage); + RUN_TEST(ContainedPaintAfterScrollEliminatedByScrollDamage); } std::string TestPaintAggregator::TestInitialState() { diff --git a/ppapi/tests/test_paint_aggregator.h b/ppapi/tests/test_paint_aggregator.h index 9b83eec..8649ee2 100644 --- a/ppapi/tests/test_paint_aggregator.h +++ b/ppapi/tests/test_paint_aggregator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,7 +13,7 @@ class TestPaintAggregator : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestInitialState(); diff --git a/ppapi/tests/test_post_message.cc b/ppapi/tests/test_post_message.cc index 0f97b74..9d6e569 100644 --- a/ppapi/tests/test_post_message.cc +++ b/ppapi/tests/test_post_message.cc @@ -106,16 +106,16 @@ bool TestPostMessage::Init() { return success; } -void TestPostMessage::RunTests(const std::string& filter) { +void TestPostMessage::RunTest() { // Note: SendInInit must be first, because it expects to receive a message // that was sent in Init above. - RUN_TEST(SendInInit, filter); - RUN_TEST(SendingData, filter); - RUN_TEST(MessageEvent, filter); - RUN_TEST(NoHandler, filter); - RUN_TEST(ExtraParam, filter); + RUN_TEST(SendInInit); + RUN_TEST(SendingData); + RUN_TEST(MessageEvent); + RUN_TEST(NoHandler); + RUN_TEST(ExtraParam); if (testing_interface_->IsOutOfProcess()) - RUN_TEST(NonMainThread, filter); + RUN_TEST(NonMainThread); } void TestPostMessage::HandleMessage(const pp::Var& message_data) { @@ -186,13 +186,9 @@ std::string TestPostMessage::TestSendInInit() { } std::string TestPostMessage::TestSendingData() { - // Clean up after previous tests. This also swallows the message sent by Init - // if we didn't run the 'SendInInit' test. All tests other than 'SendInInit' - // should start with these. - WaitForMessages(); - ASSERT_TRUE(ClearListeners()); // Set up the JavaScript message event listener to echo the data part of the // message event back to us. + ASSERT_TRUE(ClearListeners()); ASSERT_TRUE(AddEchoingListener("message_event.data")); // Test sending a message to JavaScript for each supported type. The JS sends @@ -248,10 +244,9 @@ std::string TestPostMessage::TestMessageEvent() { // Set up the JavaScript message event listener to pass us some values from // the MessageEvent and make sure they match our expectations. - WaitForMessages(); - ASSERT_TRUE(ClearListeners()); // Have the listener pass back the type of message_event and make sure it's // "object". + ASSERT_TRUE(ClearListeners()); ASSERT_TRUE(AddEchoingListener("typeof(message_event)")); message_data_.clear(); instance_->PostMessage(pp::Var(kTestInt)); @@ -304,12 +299,13 @@ std::string TestPostMessage::TestMessageEvent() { ASSERT_DOUBLE_EQ(double_vec[1], 2.0); ASSERT_DOUBLE_EQ(double_vec[2], 3.0); + ASSERT_TRUE(ClearListeners()); + PASS(); } std::string TestPostMessage::TestNoHandler() { - // Delete any lingering messages and event listeners. - WaitForMessages(); + // Delete any lingering event listeners. ASSERT_TRUE(ClearListeners()); // Now send a message. We shouldn't get a response. @@ -322,8 +318,7 @@ std::string TestPostMessage::TestNoHandler() { } std::string TestPostMessage::TestExtraParam() { - // Delete any lingering messages and event listeners. - WaitForMessages(); + // Delete any lingering event listeners. ASSERT_TRUE(ClearListeners()); // Add a listener that will respond with 1 and an empty array (where the // message port array would appear if it was Worker postMessage). @@ -339,7 +334,6 @@ std::string TestPostMessage::TestExtraParam() { } std::string TestPostMessage::TestNonMainThread() { - WaitForMessages(); ASSERT_TRUE(ClearListeners()); ASSERT_TRUE(AddEchoingListener("message_event.data")); message_data_.clear(); diff --git a/ppapi/tests/test_post_message.h b/ppapi/tests/test_post_message.h index b8e6499..af1dc36 100644 --- a/ppapi/tests/test_post_message.h +++ b/ppapi/tests/test_post_message.h @@ -18,7 +18,7 @@ class TestPostMessage : public TestCase { private: // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); // A handler for JS->Native calls to postMessage. Simply pushes // the given value to the back of message_data_ diff --git a/ppapi/tests/test_scrollbar.cc b/ppapi/tests/test_scrollbar.cc index 61345d0..3b38dd8 100644 --- a/ppapi/tests/test_scrollbar.cc +++ b/ppapi/tests/test_scrollbar.cc @@ -26,7 +26,7 @@ bool TestScrollbar::Init() { return InitTestingInterface(); } -void TestScrollbar::RunTests(const std::string& filter) { +void TestScrollbar::RunTest() { instance_->LogTest("HandleEvent", TestHandleEvent()); } diff --git a/ppapi/tests/test_scrollbar.h b/ppapi/tests/test_scrollbar.h index 4025fbb4..a83194d 100644 --- a/ppapi/tests/test_scrollbar.h +++ b/ppapi/tests/test_scrollbar.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,7 +17,7 @@ class TestScrollbar : public TestCase, // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestHandleEvent(); diff --git a/ppapi/tests/test_transport.cc b/ppapi/tests/test_transport.cc index 5826f35..d2d2850 100644 --- a/ppapi/tests/test_transport.cc +++ b/ppapi/tests/test_transport.cc @@ -102,14 +102,14 @@ bool TestTransport::Init() { return transport_interface_ && InitTestingInterface(); } -void TestTransport::RunTests(const std::string& filter) { - RUN_TEST(Create, filter); - RUN_TEST_FORCEASYNC_AND_NOT(Connect, filter); - RUN_TEST(SetProperty, filter); - RUN_TEST_FORCEASYNC_AND_NOT(SendDataUdp, filter); - RUN_TEST_FORCEASYNC_AND_NOT(SendDataTcp, filter); - RUN_TEST_FORCEASYNC_AND_NOT(ConnectAndCloseUdp, filter); - RUN_TEST_FORCEASYNC_AND_NOT(ConnectAndCloseTcp, filter); +void TestTransport::RunTest() { + RUN_TEST(Create); + RUN_TEST_FORCEASYNC_AND_NOT(Connect); + RUN_TEST(SetProperty); + RUN_TEST_FORCEASYNC_AND_NOT(SendDataUdp); + RUN_TEST_FORCEASYNC_AND_NOT(SendDataTcp); + RUN_TEST_FORCEASYNC_AND_NOT(ConnectAndCloseUdp); + RUN_TEST_FORCEASYNC_AND_NOT(ConnectAndCloseTcp); } std::string TestTransport::InitTargets(PP_TransportType type) { diff --git a/ppapi/tests/test_transport.h b/ppapi/tests/test_transport.h index 7454232..b8f7426 100644 --- a/ppapi/tests/test_transport.h +++ b/ppapi/tests/test_transport.h @@ -23,7 +23,7 @@ class TestTransport : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string InitTargets(PP_TransportType type); diff --git a/ppapi/tests/test_uma.cc b/ppapi/tests/test_uma.cc index a780282..a310e8f 100644 --- a/ppapi/tests/test_uma.cc +++ b/ppapi/tests/test_uma.cc @@ -17,7 +17,7 @@ bool TestUMA::Init() { return !!uma_interface_; } -void TestUMA::RunTests(const std::string& filter) { +void TestUMA::RunTest() { instance_->LogTest("Count", TestCount()); instance_->LogTest("Time", TestTime()); instance_->LogTest("Enum", TestEnum()); diff --git a/ppapi/tests/test_uma.h b/ppapi/tests/test_uma.h index 367f7c45..0a60fde 100644 --- a/ppapi/tests/test_uma.h +++ b/ppapi/tests/test_uma.h @@ -17,7 +17,7 @@ class TestUMA : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestCount(); diff --git a/ppapi/tests/test_url_loader.cc b/ppapi/tests/test_url_loader.cc index 44f969c..a17cef6 100644 --- a/ppapi/tests/test_url_loader.cc +++ b/ppapi/tests/test_url_loader.cc @@ -77,27 +77,27 @@ bool TestURLLoader::Init() { return InitTestingInterface() && EnsureRunningOverHTTP(); } -void TestURLLoader::RunTests(const std::string& filter) { - RUN_TEST_FORCEASYNC_AND_NOT(BasicGET, filter); - RUN_TEST_FORCEASYNC_AND_NOT(BasicPOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(BasicFilePOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(BasicFileRangePOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(CompoundBodyPOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(EmptyDataPOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(BinaryDataPOST, filter); - RUN_TEST_FORCEASYNC_AND_NOT(CustomRequestHeader, filter); - RUN_TEST_FORCEASYNC_AND_NOT(FailsBogusContentLength, filter); - RUN_TEST_FORCEASYNC_AND_NOT(SameOriginRestriction, filter); - RUN_TEST_FORCEASYNC_AND_NOT(CrossOriginRequest, filter); - RUN_TEST_FORCEASYNC_AND_NOT(JavascriptURLRestriction, filter); - RUN_TEST_FORCEASYNC_AND_NOT(MethodRestriction, filter); - RUN_TEST_FORCEASYNC_AND_NOT(HeaderRestriction, filter); - RUN_TEST_FORCEASYNC_AND_NOT(CustomReferrer, filter); - RUN_TEST_FORCEASYNC_AND_NOT(CustomContentTransferEncoding, filter); - RUN_TEST_FORCEASYNC_AND_NOT(StreamToFile, filter); - RUN_TEST_FORCEASYNC_AND_NOT(AuditURLRedirect, filter); - RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls, filter); - RUN_TEST_FORCEASYNC_AND_NOT(UntendedLoad, filter); +void TestURLLoader::RunTest() { + RUN_TEST_FORCEASYNC_AND_NOT(BasicGET); + RUN_TEST_FORCEASYNC_AND_NOT(BasicPOST); + RUN_TEST_FORCEASYNC_AND_NOT(BasicFilePOST); + RUN_TEST_FORCEASYNC_AND_NOT(BasicFileRangePOST); + RUN_TEST_FORCEASYNC_AND_NOT(CompoundBodyPOST); + RUN_TEST_FORCEASYNC_AND_NOT(EmptyDataPOST); + RUN_TEST_FORCEASYNC_AND_NOT(BinaryDataPOST); + RUN_TEST_FORCEASYNC_AND_NOT(CustomRequestHeader); + RUN_TEST_FORCEASYNC_AND_NOT(FailsBogusContentLength); + RUN_TEST_FORCEASYNC_AND_NOT(SameOriginRestriction); + RUN_TEST_FORCEASYNC_AND_NOT(CrossOriginRequest); + RUN_TEST_FORCEASYNC_AND_NOT(JavascriptURLRestriction); + RUN_TEST_FORCEASYNC_AND_NOT(MethodRestriction); + RUN_TEST_FORCEASYNC_AND_NOT(HeaderRestriction); + RUN_TEST_FORCEASYNC_AND_NOT(CustomReferrer); + RUN_TEST_FORCEASYNC_AND_NOT(CustomContentTransferEncoding); + RUN_TEST_FORCEASYNC_AND_NOT(StreamToFile); + RUN_TEST_FORCEASYNC_AND_NOT(AuditURLRedirect); + RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls); + RUN_TEST_FORCEASYNC_AND_NOT(UntendedLoad); } std::string TestURLLoader::ReadEntireFile(pp::FileIO* file_io, diff --git a/ppapi/tests/test_url_loader.h b/ppapi/tests/test_url_loader.h index a31d09e..0939848 100644 --- a/ppapi/tests/test_url_loader.h +++ b/ppapi/tests/test_url_loader.h @@ -26,7 +26,7 @@ class TestURLLoader : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); diff --git a/ppapi/tests/test_url_util.cc b/ppapi/tests/test_url_util.cc index 179aeeb..dc6cb47 100644 --- a/ppapi/tests/test_url_util.cc +++ b/ppapi/tests/test_url_util.cc @@ -20,14 +20,14 @@ bool TestURLUtil::Init() { return !!util_; } -void TestURLUtil::RunTests(const std::string& filter) { - RUN_TEST(Canonicalize, filter); - RUN_TEST(ResolveRelative, filter); - RUN_TEST(IsSameSecurityOrigin, filter); - RUN_TEST(DocumentCanRequest, filter); - RUN_TEST(DocumentCanAccessDocument, filter); - RUN_TEST(GetDocumentURL, filter); - RUN_TEST(GetPluginInstanceURL, filter); +void TestURLUtil::RunTest() { + RUN_TEST(Canonicalize); + RUN_TEST(ResolveRelative); + RUN_TEST(IsSameSecurityOrigin); + RUN_TEST(DocumentCanRequest); + RUN_TEST(DocumentCanAccessDocument); + RUN_TEST(GetDocumentURL); + RUN_TEST(GetPluginInstanceURL); } std::string TestURLUtil::TestCanonicalize() { diff --git a/ppapi/tests/test_url_util.h b/ppapi/tests/test_url_util.h index b701271..0bb1f3f 100644 --- a/ppapi/tests/test_url_util.h +++ b/ppapi/tests/test_url_util.h @@ -14,7 +14,7 @@ class TestURLUtil : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); private: std::string TestCanonicalize(); diff --git a/ppapi/tests/test_var.cc b/ppapi/tests/test_var.cc index 6357737..9e91dc4 100644 --- a/ppapi/tests/test_var.cc +++ b/ppapi/tests/test_var.cc @@ -31,14 +31,14 @@ bool TestVar::Init() { return var_interface_ && InitTestingInterface(); } -void TestVar::RunTests(const std::string& filter) { - RUN_TEST(BasicString, filter); - RUN_TEST(InvalidAndEmpty, filter); - RUN_TEST(InvalidUtf8, filter); - RUN_TEST(NullInputInUtf8Conversion, filter); - RUN_TEST(ValidUtf8, filter); - RUN_TEST(Utf8WithEmbeddedNulls, filter); - RUN_TEST(VarToUtf8ForWrongType, filter); +void TestVar::RunTest() { + RUN_TEST(BasicString); + RUN_TEST(InvalidAndEmpty); + RUN_TEST(InvalidUtf8); + RUN_TEST(NullInputInUtf8Conversion); + RUN_TEST(ValidUtf8); + RUN_TEST(Utf8WithEmbeddedNulls); + RUN_TEST(VarToUtf8ForWrongType); } std::string TestVar::TestBasicString() { diff --git a/ppapi/tests/test_var.h b/ppapi/tests/test_var.h index a329c780..939e942 100644 --- a/ppapi/tests/test_var.h +++ b/ppapi/tests/test_var.h @@ -19,7 +19,7 @@ class TestVar : public TestCase { private: // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); std::string TestBasicString(); std::string TestInvalidAndEmpty(); diff --git a/ppapi/tests/test_var_deprecated.cc b/ppapi/tests/test_var_deprecated.cc index 66ef23a..253058d 100644 --- a/ppapi/tests/test_var_deprecated.cc +++ b/ppapi/tests/test_var_deprecated.cc @@ -73,16 +73,16 @@ bool TestVarDeprecated::Init() { return var_interface_ && InitTestingInterface(); } -void TestVarDeprecated::RunTests(const std::string& filter) { - RUN_TEST(BasicString, filter); - RUN_TEST(InvalidAndEmpty, filter); - RUN_TEST(InvalidUtf8, filter); - RUN_TEST(NullInputInUtf8Conversion, filter); - RUN_TEST(ValidUtf8, filter); - RUN_TEST(Utf8WithEmbeddedNulls, filter); - RUN_TEST(VarToUtf8ForWrongType, filter); - RUN_TEST(HasPropertyAndMethod, filter); - RUN_TEST(PassReference, filter); +void TestVarDeprecated::RunTest() { + RUN_TEST(BasicString); + RUN_TEST(InvalidAndEmpty); + RUN_TEST(InvalidUtf8); + RUN_TEST(NullInputInUtf8Conversion); + RUN_TEST(ValidUtf8); + RUN_TEST(Utf8WithEmbeddedNulls); + RUN_TEST(VarToUtf8ForWrongType); + RUN_TEST(HasPropertyAndMethod); + RUN_TEST(PassReference); } pp::deprecated::ScriptableObject* TestVarDeprecated::CreateTestObject() { diff --git a/ppapi/tests/test_var_deprecated.h b/ppapi/tests/test_var_deprecated.h index d8b86b8..8e64ece 100644 --- a/ppapi/tests/test_var_deprecated.h +++ b/ppapi/tests/test_var_deprecated.h @@ -18,7 +18,7 @@ class TestVarDeprecated : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); void set_var_from_page(const pp::VarPrivate& v) { var_from_page_ = v; } diff --git a/ppapi/tests/test_video_decoder.cc b/ppapi/tests/test_video_decoder.cc index faaa772..0be8d95 100644 --- a/ppapi/tests/test_video_decoder.cc +++ b/ppapi/tests/test_video_decoder.cc @@ -18,8 +18,8 @@ bool TestVideoDecoder::Init() { return video_decoder_interface_ && InitTestingInterface(); } -void TestVideoDecoder::RunTests(const std::string& filter) { - RUN_TEST(CreateFailure, filter); +void TestVideoDecoder::RunTest() { + RUN_TEST(CreateFailure); } void TestVideoDecoder::QuitMessageLoop() { diff --git a/ppapi/tests/test_video_decoder.h b/ppapi/tests/test_video_decoder.h index b20d6de..7409b4e 100644 --- a/ppapi/tests/test_video_decoder.h +++ b/ppapi/tests/test_video_decoder.h @@ -17,7 +17,7 @@ class TestVideoDecoder : public TestCase { // TestCase implementation. virtual bool Init(); - virtual void RunTests(const std::string& filter); + virtual void RunTest(); void QuitMessageLoop(); diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc index 056477d..e50bb5a3 100644 --- a/ppapi/tests/testing_instance.cc +++ b/ppapi/tests/testing_instance.cc @@ -56,7 +56,6 @@ bool TestingInstance::Init(uint32_t argc, if (argv[i][0] == '\0') break; current_case_ = CaseForTestName(argv[i]); - test_filter_ = FilterForTestName(argv[i]); if (!current_case_) errors_.append(std::string("Unknown test case ") + argv[i]); else if (!current_case_->Init()) @@ -145,7 +144,7 @@ void TestingInstance::ExecuteTests(int32_t unused) { LogAvailableTests(); errors_.append("FAIL: Only listed tests"); } else { - current_case_->RunTests(test_filter_); + current_case_->RunTest(); // Automated PyAuto tests rely on finding the exact strings below. LogHTML(errors_.empty() ? "<span class=\"pass\">[SHUTDOWN]</span> All tests passed." : @@ -157,24 +156,16 @@ void TestingInstance::ExecuteTests(int32_t unused) { PostMessage(pp::Var("TESTING_MESSAGE:DidExecuteTests")); } -TestCase* TestingInstance::CaseForTestName(const std::string& name) { - std::string case_name = name.substr(0, name.find_first_of('_')); +TestCase* TestingInstance::CaseForTestName(const char* name) { TestCaseFactory* iter = TestCaseFactory::head_; while (iter != NULL) { - if (case_name == iter->name_) + if (std::strcmp(name, iter->name_) == 0) return iter->method_(this); iter = iter->next_; } return NULL; } -std::string TestingInstance::FilterForTestName(const std::string& name) { - size_t delim = name.find_first_of('_'); - if (delim != std::string::npos) - return name.substr(delim+1); - return ""; -} - void TestingInstance::LogAvailableTests() { // Print out a listing of all tests. std::vector<std::string> test_cases; diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h index 8f6b7b1..0c79923 100644 --- a/ppapi/tests/testing_instance.h +++ b/ppapi/tests/testing_instance.h @@ -87,18 +87,8 @@ pp::InstancePrivate { void ExecuteTests(int32_t unused); // Creates a new TestCase for the give test name, or NULL if there is no such - // test. Ownership is passed to the caller. The given string is split by '_'. - // The test case name is the first part. - TestCase* CaseForTestName(const std::string& name); - // Returns the filter (second part) of the given string. If there is no '_', - // returns the empty string, which means 'run all tests for this test case'. - // E.g.: - // http://testserver/test_case.html?testcase=PostMessage - // Otherwise, the part of the testcase after '_' is returned, and the test - // whose name matches that string (if any) will be run: - // http://testserver/test_case.html?testcase=PostMessage_SendingData - // Runs 'PostMessage_SendingData. - std::string FilterForTestName(const std::string& name); + // test. Ownership is passed to the caller. + TestCase* CaseForTestName(const char* name); // Appends a list of available tests to the console in the document. void LogAvailableTests(); @@ -119,10 +109,6 @@ pp::InstancePrivate { // Owning pointer to the current test case. Valid after Init has been called. TestCase* current_case_; - // A filter to use when running tests. This is passed to 'RunTests', which - // runs only tests whose name contains test_filter_ as a substring. - std::string test_filter_; - // The current step we're on starting at 0. This is incremented every time we // report progress via a cookie. See comment above the class. int progress_cookie_number_; |