Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Unified Diff: net/base/upload_bytes_element_reader_unittest.cc

Issue 2109503009: Refactor net tests to use GMock matchers for checking net::Error results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to contents.txt files Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/static_cookie_policy_unittest.cc ('k') | net/base/upload_file_element_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_bytes_element_reader_unittest.cc
diff --git a/net/base/upload_bytes_element_reader_unittest.cc b/net/base/upload_bytes_element_reader_unittest.cc
index 59bd1eae8990db8cfe599b3949dd5fb419532fec..e93caed03d74aa60cba426074d54993300be7d76 100644
--- a/net/base/upload_bytes_element_reader_unittest.cc
+++ b/net/base/upload_bytes_element_reader_unittest.cc
@@ -8,9 +8,13 @@
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
+#include "net/test/gtest_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+using net::test::IsOk;
+
namespace net {
class UploadBytesElementReaderTest : public PlatformTest {
@@ -19,7 +23,7 @@ class UploadBytesElementReaderTest : public PlatformTest {
const char kData[] = "123abc";
bytes_.assign(kData, kData + arraysize(kData));
reader_.reset(new UploadBytesElementReader(&bytes_[0], bytes_.size()));
- ASSERT_EQ(OK, reader_->Init(CompletionCallback()));
+ ASSERT_THAT(reader_->Init(CompletionCallback()), IsOk());
EXPECT_EQ(bytes_.size(), reader_->GetContentLength());
EXPECT_EQ(bytes_.size(), reader_->BytesRemaining());
EXPECT_TRUE(reader_->IsInMemory());
@@ -78,7 +82,7 @@ TEST_F(UploadBytesElementReaderTest, MultipleInit) {
EXPECT_EQ(bytes_, buf);
// Call Init() again to reset the state.
- ASSERT_EQ(OK, reader_->Init(CompletionCallback()));
+ ASSERT_THAT(reader_->Init(CompletionCallback()), IsOk());
EXPECT_EQ(bytes_.size(), reader_->GetContentLength());
EXPECT_EQ(bytes_.size(), reader_->BytesRemaining());
« no previous file with comments | « net/base/static_cookie_policy_unittest.cc ('k') | net/base/upload_file_element_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698