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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 { | 663 { |
664 ::testing::ScopedFakeTestPartResultReporter gtest_reporter( | 664 ::testing::ScopedFakeTestPartResultReporter gtest_reporter( |
665 ::testing::ScopedFakeTestPartResultReporter:: | 665 ::testing::ScopedFakeTestPartResultReporter:: |
666 INTERCEPT_ONLY_CURRENT_THREAD, | 666 INTERCEPT_ONLY_CURRENT_THREAD, |
667 >est_failures); | 667 >est_failures); |
668 AssertSyncWriteEquals(kMsg1, kLen1 - 1); | 668 AssertSyncWriteEquals(kMsg1, kLen1 - 1); |
669 } | 669 } |
670 | 670 |
671 static const char* kExpectedFailures[] = { | 671 static const char* kExpectedFailures[] = { |
672 "Expected: (data.length()) >= (expected_data.length())", | 672 "Expected: (data.length()) >= (expected_data.length())", |
673 "Value of: actual_data", | 673 "To be equal to: actual_data", |
674 "Value of: sock_->Write(buf.get(), len, failing_callback_)"}; | 674 "To be equal to: sock_->Write(buf.get(), len, failing_callback_)"}; |
675 ASSERT_EQ(arraysize(kExpectedFailures), | 675 ASSERT_EQ(arraysize(kExpectedFailures), |
676 static_cast<size_t>(gtest_failures.size())); | 676 static_cast<size_t>(gtest_failures.size())); |
677 | 677 |
678 for (int i = 0; i < gtest_failures.size(); ++i) { | 678 for (int i = 0; i < gtest_failures.size(); ++i) { |
679 const ::testing::TestPartResult& result = | 679 const ::testing::TestPartResult& result = |
680 gtest_failures.GetTestPartResult(i); | 680 gtest_failures.GetTestPartResult(i); |
681 EXPECT_TRUE(strstr(result.message(), kExpectedFailures[i]) != NULL); | 681 EXPECT_TRUE(strstr(result.message(), kExpectedFailures[i]) != NULL); |
682 } | 682 } |
683 | 683 |
684 set_expect_eof(false); | 684 set_expect_eof(false); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 | 1247 |
1248 Resume(); | 1248 Resume(); |
1249 ASSERT_FALSE(IsPaused()); | 1249 ASSERT_FALSE(IsPaused()); |
1250 ASSERT_TRUE(write_callback_.have_result()); | 1250 ASSERT_TRUE(write_callback_.have_result()); |
1251 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); | 1251 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); |
1252 } | 1252 } |
1253 | 1253 |
1254 } // namespace | 1254 } // namespace |
1255 | 1255 |
1256 } // namespace net | 1256 } // namespace net |
OLD | NEW |