From 28a0426533b147ba33c08c931e273db297a228c8 Mon Sep 17 00:00:00 2001 From: "gregoryd@google.com" Date: Thu, 8 Apr 2010 23:47:16 +0000 Subject: Make NaCl tests not flaky on Windows, add npapi_hw test BUG=28176,40669 Review URL: http://codereview.chromium.org/1613003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44018 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/nacl/nacl_test.cc | 54 ++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'chrome/test/nacl/nacl_test.cc') diff --git a/chrome/test/nacl/nacl_test.cc b/chrome/test/nacl/nacl_test.cc index 71623e8..4a65896 100644 --- a/chrome/test/nacl/nacl_test.cc +++ b/chrome/test/nacl/nacl_test.cc @@ -52,6 +52,10 @@ const FilePath::CharType kSrpcNrdServerNexeFileName[] = const FilePath::CharType kServerHtmlFileName[] = FILE_PATH_LITERAL("server_test.html"); +const FilePath::CharType kNpapiHwHtmlFileName[] = + FILE_PATH_LITERAL("npapi_hw.html"); +const FilePath::CharType kNpapiHwNexeFileName[] = + FILE_PATH_LITERAL("npapi_hw.nexe"); } // anonymous namespace NaClTest::NaClTest() @@ -231,6 +235,22 @@ void NaClTest::PrepareSrpcNrdXferTest(FilePath test_root_dir) { test_root_dir.Append(kSrpcNrdServerNexeFileName))); } +void NaClTest::PrepareNpapiHwTest(FilePath test_root_dir) { + FilePath test_dir = test_root_dir.AppendASCII("npapi_hw"); + FilePath html_file = test_dir.Append(kNpapiHwHtmlFileName); + FilePath nexe_file = GetTestBinariesDir().Append(kNpapiHwNexeFileName); + ASSERT_TRUE(file_util::PathExists(html_file)); + ASSERT_TRUE(file_util::PathExists(nexe_file)); + // Now copy the files into the test directory + ASSERT_TRUE(file_util::CopyFile( + html_file, + test_root_dir.Append(kNpapiHwHtmlFileName))); + ASSERT_TRUE(file_util::CopyFile( + nexe_file, + test_root_dir.Append(kNpapiHwNexeFileName))); +} + + void NaClTest::SetUp() { FilePath nacl_test_dir = GetTestRootDir(); PrepareSrpcHwTest(nacl_test_dir); @@ -240,6 +260,7 @@ void NaClTest::SetUp() { PrepareSrpcShmTest(nacl_test_dir); PrepareSrpcPluginTest(nacl_test_dir); PrepareSrpcNrdXferTest(nacl_test_dir); + PrepareNpapiHwTest(nacl_test_dir); UITest::SetUp(); @@ -256,58 +277,39 @@ TEST_F(NaClTest, ServerTest) { RunTest(test_file, action_max_timeout_ms()); } -// Those tests are disabled because they don't work on Windows. -// BUG:28176 -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcHelloWorld) { -#else TEST_F(NaClTest, SrpcHelloWorld) { -#endif FilePath test_file(kSrpcHwHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcBasicTest) { -#else TEST_F(NaClTest, SrpcBasicTest) { -#endif FilePath test_file(kSrpcBasicHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcSockAddrTest) { -#else TEST_F(NaClTest, SrpcSockAddrTest) { -#endif FilePath test_file(kSrpcSockAddrHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcShmTest) { -#else TEST_F(NaClTest, SrpcShmTest) { -#endif FilePath test_file(kSrpcShmHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcPluginTest) { -#else TEST_F(NaClTest, SrpcPluginTest) { -#endif FilePath test_file(kSrpcPluginHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } -#if defined(OS_WIN) -TEST_F(NaClTest, FLAKY_SrpcNrdXferTest) { -#else TEST_F(NaClTest, SrpcNrdXferTest) { -#endif FilePath test_file(kSrpcNrdXferHtmlFileName); RunTest(test_file, action_max_timeout_ms()); } + +// The test seems to be flaky. +// http://code.google.com/p/chromium/issues/detail?id=40669 +TEST_F(NaClTest, FLAKY_NpapiHwTest) { + FilePath test_file(kNpapiHwHtmlFileName); + RunTest(test_file, action_max_timeout_ms()); +} -- cgit v1.1