OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 { | 664 { |
665 ::testing::ScopedFakeTestPartResultReporter gtest_reporter( | 665 ::testing::ScopedFakeTestPartResultReporter gtest_reporter( |
666 ::testing::ScopedFakeTestPartResultReporter:: | 666 ::testing::ScopedFakeTestPartResultReporter:: |
667 INTERCEPT_ONLY_CURRENT_THREAD, | 667 INTERCEPT_ONLY_CURRENT_THREAD, |
668 >est_failures); | 668 >est_failures); |
669 AssertSyncWriteEquals(kMsg1, kLen1 - 1); | 669 AssertSyncWriteEquals(kMsg1, kLen1 - 1); |
670 } | 670 } |
671 | 671 |
672 static const char* kExpectedFailures[] = { | 672 static const char* kExpectedFailures[] = { |
673 "Expected: (data.length()) >= (expected_data.length())", | 673 "Expected: (data.length()) >= (expected_data.length())", |
674 "Value of: actual_data", | 674 "To be equal to: actual_data", |
675 "Value of: sock_->Write(buf.get(), len, failing_callback_)"}; | 675 "To be equal to: sock_->Write(buf.get(), len, failing_callback_)"}; |
676 ASSERT_EQ(arraysize(kExpectedFailures), | 676 ASSERT_EQ(arraysize(kExpectedFailures), |
677 static_cast<size_t>(gtest_failures.size())); | 677 static_cast<size_t>(gtest_failures.size())); |
678 | 678 |
679 for (int i = 0; i < gtest_failures.size(); ++i) { | 679 for (int i = 0; i < gtest_failures.size(); ++i) { |
680 const ::testing::TestPartResult& result = | 680 const ::testing::TestPartResult& result = |
681 gtest_failures.GetTestPartResult(i); | 681 gtest_failures.GetTestPartResult(i); |
682 EXPECT_TRUE(strstr(result.message(), kExpectedFailures[i]) != NULL); | 682 EXPECT_TRUE(strstr(result.message(), kExpectedFailures[i]) != NULL); |
683 } | 683 } |
684 | 684 |
685 set_expect_eof(false); | 685 set_expect_eof(false); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 | 1251 |
1252 Resume(); | 1252 Resume(); |
1253 ASSERT_FALSE(IsPaused()); | 1253 ASSERT_FALSE(IsPaused()); |
1254 ASSERT_TRUE(write_callback_.have_result()); | 1254 ASSERT_TRUE(write_callback_.have_result()); |
1255 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); | 1255 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); |
1256 } | 1256 } |
1257 | 1257 |
1258 } // namespace | 1258 } // namespace |
1259 | 1259 |
1260 } // namespace net | 1260 } // namespace net |
OLD | NEW |