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

Unified Diff: content/child/web_data_consumer_handle_impl_unittest.cc

Issue 2639873002: Handle correctly "ShouldWait" result of mojo::Wait() in WebDataConsumerHandleImpl. (Closed)
Patch Set: add NOTREACHED() Created 3 years, 11 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 | « content/child/web_data_consumer_handle_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_data_consumer_handle_impl_unittest.cc
diff --git a/content/child/web_data_consumer_handle_impl_unittest.cc b/content/child/web_data_consumer_handle_impl_unittest.cc
index 98e6c25171fd93c498301abb85c8f3b6eb46b725..b16075324cd36a09180e9bcbcafe37678b790571 100644
--- a/content/child/web_data_consumer_handle_impl_unittest.cc
+++ b/content/child/web_data_consumer_handle_impl_unittest.cc
@@ -282,8 +282,6 @@ TEST_F(WebDataConsumerHandleImplTest, TwoPhaseReadData) {
TEST_F(WebDataConsumerHandleImplTest, ZeroSizeRead) {
ASSERT_GT(kDataPipeCapacity - 1, 0);
constexpr size_t data_size = kDataPipeCapacity - 1;
- std::string expected = ProduceData(data_size);
- producer_.reset();
std::unique_ptr<WebDataConsumerHandleImpl> handle(
new WebDataConsumerHandleImpl(std::move(consumer_)));
std::unique_ptr<WebDataConsumerHandle::Reader> reader(
@@ -292,6 +290,12 @@ TEST_F(WebDataConsumerHandleImplTest, ZeroSizeRead) {
size_t read_size;
WebDataConsumerHandle::Result rv =
reader->read(nullptr, 0, WebDataConsumerHandle::FlagNone, &read_size);
+ EXPECT_EQ(WebDataConsumerHandle::Result::ShouldWait, rv);
+
+ std::string expected = ProduceData(data_size);
+ producer_.reset();
+
+ rv = reader->read(nullptr, 0, WebDataConsumerHandle::FlagNone, &read_size);
EXPECT_EQ(WebDataConsumerHandle::Result::Ok, rv);
char buffer[16];
@@ -300,6 +304,9 @@ TEST_F(WebDataConsumerHandleImplTest, ZeroSizeRead) {
EXPECT_EQ(WebDataConsumerHandle::Result::Ok, rv);
EXPECT_EQ(data_size, read_size);
EXPECT_EQ(expected, std::string(buffer, read_size));
+
+ rv = reader->read(nullptr, 0, WebDataConsumerHandle::FlagNone, &read_size);
+ EXPECT_EQ(WebDataConsumerHandle::Result::Done, rv);
}
} // namespace
« no previous file with comments | « content/child/web_data_consumer_handle_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698