diff --git a/webrtc/base/filerotatingstream_unittest.cc b/webrtc/base/filerotatingstream_unittest.cc index bac2a3a3e3..2a0e8589f4 100644 --- a/webrtc/base/filerotatingstream_unittest.cc +++ b/webrtc/base/filerotatingstream_unittest.cc @@ -19,7 +19,14 @@ namespace rtc { -class FileRotatingStreamTest : public ::testing::Test { +#if defined (WEBRTC_ANDROID) +// Fails on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=4364. +#define MAYBE_FileRotatingStreamTest DISABLED_FileRotatingStreamTest +#else +#define MAYBE_FileRotatingStreamTest FileRotatingStreamTest +#endif + +class MAYBE_FileRotatingStreamTest : public ::testing::Test { protected: static const char* kFilePrefix; static const size_t kMaxFileSize; @@ -94,11 +101,12 @@ class FileRotatingStreamTest : public ::testing::Test { std::string dir_path_; }; -const char* FileRotatingStreamTest::kFilePrefix = "FileRotatingStreamTest"; -const size_t FileRotatingStreamTest::kMaxFileSize = 2; +const char* MAYBE_FileRotatingStreamTest::kFilePrefix = + "FileRotatingStreamTest"; +const size_t MAYBE_FileRotatingStreamTest::kMaxFileSize = 2; // Tests that stream state is correct before and after Open / Close. -TEST_F(FileRotatingStreamTest, State) { +TEST_F(MAYBE_FileRotatingStreamTest, State) { Init("FileRotatingStreamTestState", kFilePrefix, kMaxFileSize, 3); EXPECT_EQ(SS_CLOSED, stream_->GetState()); @@ -109,7 +117,7 @@ TEST_F(FileRotatingStreamTest, State) { } // Tests that nothing is written to file when data of length zero is written. -TEST_F(FileRotatingStreamTest, EmptyWrite) { +TEST_F(MAYBE_FileRotatingStreamTest, EmptyWrite) { Init("FileRotatingStreamTestEmptyWrite", kFilePrefix, kMaxFileSize, 3); ASSERT_TRUE(stream_->Open()); @@ -124,7 +132,7 @@ TEST_F(FileRotatingStreamTest, EmptyWrite) { // Tests that a write operation followed by a read returns the expected data // and writes to the expected files. -TEST_F(FileRotatingStreamTest, WriteAndRead) { +TEST_F(MAYBE_FileRotatingStreamTest, WriteAndRead) { Init("FileRotatingStreamTestWriteAndRead", kFilePrefix, kMaxFileSize, 3); ASSERT_TRUE(stream_->Open()); @@ -158,7 +166,7 @@ TEST_F(FileRotatingStreamTest, WriteAndRead) { // Tests that writing data greater than the total capacity of the files // overwrites the files correctly and is read correctly after. -TEST_F(FileRotatingStreamTest, WriteOverflowAndRead) { +TEST_F(MAYBE_FileRotatingStreamTest, WriteOverflowAndRead) { Init("FileRotatingStreamTestWriteOverflowAndRead", kFilePrefix, kMaxFileSize, 3); ASSERT_TRUE(stream_->Open()); @@ -175,7 +183,7 @@ TEST_F(FileRotatingStreamTest, WriteOverflowAndRead) { } // Tests that the returned file paths have the right folder and prefix. -TEST_F(FileRotatingStreamTest, GetFilePath) { +TEST_F(MAYBE_FileRotatingStreamTest, GetFilePath) { Init("FileRotatingStreamTestGetFilePath", kFilePrefix, kMaxFileSize, 20); for (auto i = 0; i < 20; ++i) { Pathname path(stream_->GetFilePath(i)); @@ -184,7 +192,16 @@ TEST_F(FileRotatingStreamTest, GetFilePath) { } } -class CallSessionFileRotatingStreamTest : public ::testing::Test { +#if defined (WEBRTC_ANDROID) +// Fails on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=4364. +#define MAYBE_CallSessionFileRotatingStreamTest \ + DISABLED_CallSessionFileRotatingStreamTest +#else +#define MAYBE_CallSessionFileRotatingStreamTest \ + CallSessionFileRotatingStreamTest +#endif + +class MAYBE_CallSessionFileRotatingStreamTest : public ::testing::Test { protected: void Init(const std::string& dir_name, size_t max_total_log_size) { Pathname test_path; @@ -237,7 +254,7 @@ class CallSessionFileRotatingStreamTest : public ::testing::Test { // Tests that writing and reading to a stream with the smallest possible // capacity works. -TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadSmallest) { +TEST_F(MAYBE_CallSessionFileRotatingStreamTest, WriteAndReadSmallest) { Init("CallSessionFileRotatingStreamTestWriteAndReadSmallest", 4); ASSERT_TRUE(stream_->Open()); @@ -250,7 +267,7 @@ TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadSmallest) { // Tests that writing and reading to a stream with capacity lesser than 4MB // behaves correctly. -TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadSmall) { +TEST_F(MAYBE_CallSessionFileRotatingStreamTest, WriteAndReadSmall) { Init("CallSessionFileRotatingStreamTestWriteAndReadSmall", 8); ASSERT_TRUE(stream_->Open()); @@ -263,7 +280,7 @@ TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadSmall) { // Tests that writing and reading to a stream with capacity greater than 4MB // behaves correctly. -TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadLarge) { +TEST_F(MAYBE_CallSessionFileRotatingStreamTest, WriteAndReadLarge) { Init("CallSessionFileRotatingStreamTestWriteAndReadLarge", 6 * 1024 * 1024); ASSERT_TRUE(stream_->Open()); @@ -290,7 +307,7 @@ TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadLarge) { // Tests that writing and reading to a stream where only the first file is // written to behaves correctly. -TEST_F(CallSessionFileRotatingStreamTest, WriteAndReadFirstHalf) { +TEST_F(MAYBE_CallSessionFileRotatingStreamTest, WriteAndReadFirstHalf) { Init("CallSessionFileRotatingStreamTestWriteAndReadFirstHalf", 6 * 1024 * 1024); ASSERT_TRUE(stream_->Open()); diff --git a/webrtc/base/fileutils_unittest.cc b/webrtc/base/fileutils_unittest.cc index 51396caefb..756f511f7a 100644 --- a/webrtc/base/fileutils_unittest.cc +++ b/webrtc/base/fileutils_unittest.cc @@ -17,14 +17,21 @@ namespace rtc { +#if defined (WEBRTC_ANDROID) +// Fails on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=4364. +#define MAYBE_FilesystemTest DISABLED_FilesystemTest +#else +#define MAYBE_FilesystemTest FilesystemTest +#endif + // Make sure we can get a temp folder for the later tests. -TEST(FilesystemTest, GetTemporaryFolder) { +TEST(MAYBE_FilesystemTest, GetTemporaryFolder) { Pathname path; EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, NULL)); } // Test creating a temp file, reading it back in, and deleting it. -TEST(FilesystemTest, TestOpenFile) { +TEST(MAYBE_FilesystemTest, TestOpenFile) { Pathname path; EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, NULL)); path.SetPathname(Filesystem::TempFilename(path, "ut")); @@ -52,7 +59,7 @@ TEST(FilesystemTest, TestOpenFile) { } // Test opening a non-existent file. -TEST(FilesystemTest, TestOpenBadFile) { +TEST(MAYBE_FilesystemTest, TestOpenBadFile) { Pathname path; EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, NULL)); path.SetFilename("not an actual file"); @@ -65,7 +72,7 @@ TEST(FilesystemTest, TestOpenBadFile) { // Test that CreatePrivateFile fails for existing files and succeeds for // non-existent ones. -TEST(FilesystemTest, TestCreatePrivateFile) { +TEST(MAYBE_FilesystemTest, TestCreatePrivateFile) { Pathname path; EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, NULL)); path.SetFilename("private_file_test"); @@ -86,7 +93,7 @@ TEST(FilesystemTest, TestCreatePrivateFile) { } // Test checking for free disk space. -TEST(FilesystemTest, TestGetDiskFreeSpace) { +TEST(MAYBE_FilesystemTest, TestGetDiskFreeSpace) { // Note that we should avoid picking any file/folder which could be located // at the remotely mounted drive/device. Pathname path; @@ -119,12 +126,12 @@ TEST(FilesystemTest, TestGetDiskFreeSpace) { } // Tests that GetCurrentDirectory() returns something. -TEST(FilesystemTest, TestGetCurrentDirectory) { +TEST(MAYBE_FilesystemTest, TestGetCurrentDirectory) { EXPECT_FALSE(Filesystem::GetCurrentDirectory().empty()); } // Tests that GetAppPathname returns something. -TEST(FilesystemTest, TestGetAppPathname) { +TEST(MAYBE_FilesystemTest, TestGetAppPathname) { Pathname path; EXPECT_TRUE(Filesystem::GetAppPathname(&path)); EXPECT_FALSE(path.empty()); diff --git a/webrtc/base/logging_unittest.cc b/webrtc/base/logging_unittest.cc index d5bd9d4a00..c08b1efd4a 100644 --- a/webrtc/base/logging_unittest.cc +++ b/webrtc/base/logging_unittest.cc @@ -128,7 +128,14 @@ TEST(LogTest, WallClockStartTime) { } // Test the time required to write 1000 80-character logs to an unbuffered file. -TEST(LogTest, Perf) { +#if defined (WEBRTC_ANDROID) +// Fails on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=4364. +#define MAYBE_Perf DISABLED_Perf +#else +#define MAYBE_Perf Perf +#endif + +TEST(LogTest, MAYBE_Perf) { Pathname path; EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, NULL)); path.SetPathname(Filesystem::TempFilename(path, "ut")); diff --git a/webrtc/base/optionsfile_unittest.cc b/webrtc/base/optionsfile_unittest.cc index f22a2f1f07..bc3d38ee1b 100644 --- a/webrtc/base/optionsfile_unittest.cc +++ b/webrtc/base/optionsfile_unittest.cc @@ -35,16 +35,23 @@ static int kTestInt2 = 67890; static int kNegInt = -634; static int kZero = 0; -class OptionsFileTest : public testing::Test { +#if defined (WEBRTC_ANDROID) +// Fails on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=4364. +#define MAYBE_OptionsFileTest DISABLED_OptionsFileTest +#else +#define MAYBE_OptionsFileTest OptionsFileTest +#endif + +class MAYBE_OptionsFileTest : public testing::Test { public: - OptionsFileTest() { + MAYBE_OptionsFileTest() { Pathname dir; ASSERT(Filesystem::GetTemporaryFolder(dir, true, NULL)); test_file_ = Filesystem::TempFilename(dir, ".testfile"); OpenStore(); } - ~OptionsFileTest() override { + ~MAYBE_OptionsFileTest() override { remove(test_file_.c_str()); } @@ -59,7 +66,7 @@ class OptionsFileTest : public testing::Test { std::string test_file_; }; -TEST_F(OptionsFileTest, GetSetString) { +TEST_F(MAYBE_OptionsFileTest, GetSetString) { // Clear contents of the file on disk. EXPECT_TRUE(store_->Save()); std::string out1, out2; @@ -85,7 +92,7 @@ TEST_F(OptionsFileTest, GetSetString) { EXPECT_FALSE(store_->GetStringValue(kTestOptionB, &out2)); } -TEST_F(OptionsFileTest, GetSetInt) { +TEST_F(MAYBE_OptionsFileTest, GetSetInt) { // Clear contents of the file on disk. EXPECT_TRUE(store_->Save()); int out1, out2; @@ -117,7 +124,7 @@ TEST_F(OptionsFileTest, GetSetInt) { EXPECT_EQ(kZero, out1); } -TEST_F(OptionsFileTest, Persist) { +TEST_F(MAYBE_OptionsFileTest, Persist) { // Clear contents of the file on disk. EXPECT_TRUE(store_->Save()); EXPECT_TRUE(store_->SetStringValue(kTestOptionA, kTestString1)); @@ -135,7 +142,7 @@ TEST_F(OptionsFileTest, Persist) { EXPECT_EQ(kNegInt, out2); } -TEST_F(OptionsFileTest, SpecialCharacters) { +TEST_F(MAYBE_OptionsFileTest, SpecialCharacters) { // Clear contents of the file on disk. EXPECT_TRUE(store_->Save()); std::string out;