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

Unified Diff: third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp

Issue 2177243002: Use per-frame TaskRunner instead of thread's default in DataConsumerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_consumer_handle_unique_ptr
Patch Set: update Created 4 years, 5 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
Index: third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp
index d2f08ac53f684eac26f751216eeb66fd4d06a1ef..c6dc729c65dcb891ca73578db3778dfb35654b60 100644
--- a/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp
+++ b/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp
@@ -338,7 +338,7 @@ TEST(FetchDataConsumerTeeTest, Create)
Checkpoint checkpoint;
InSequence s;
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*src, obtainFetchDataReader(_)).WillOnce(Return(ByMove(WTF::wrapUnique(reader))));
+ EXPECT_CALL(*src, obtainFetchDataReaderMock(_)).WillOnce(Return(ByMove(WTF::wrapUnique(reader))));
EXPECT_CALL(*reader, drainAsBlobDataHandle(kAllowBlobWithInvalidSize)).WillOnce(Return(blobDataHandle));
EXPECT_CALL(*reader, destruct());
EXPECT_CALL(checkpoint, Call(2));
@@ -352,8 +352,8 @@ TEST(FetchDataConsumerTeeTest, Create)
ASSERT_TRUE(dest1);
ASSERT_TRUE(dest2);
- EXPECT_EQ(blobDataHandle, dest1->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
- EXPECT_EQ(blobDataHandle, dest2->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_EQ(blobDataHandle, dest1->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_EQ(blobDataHandle, dest2->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
}
TEST(FetchDataConsumerTeeTest, CreateFromBlobWithInvalidSize)
@@ -367,7 +367,7 @@ TEST(FetchDataConsumerTeeTest, CreateFromBlobWithInvalidSize)
Checkpoint checkpoint;
InSequence s;
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*src, obtainFetchDataReader(_)).WillOnce(Return(ByMove(WTF::wrapUnique(reader))));
+ EXPECT_CALL(*src, obtainFetchDataReaderMock(_)).WillOnce(Return(ByMove(WTF::wrapUnique(reader))));
EXPECT_CALL(*reader, drainAsBlobDataHandle(kAllowBlobWithInvalidSize)).WillOnce(Return(blobDataHandle));
EXPECT_CALL(*reader, destruct());
EXPECT_CALL(checkpoint, Call(2));
@@ -381,10 +381,10 @@ TEST(FetchDataConsumerTeeTest, CreateFromBlobWithInvalidSize)
ASSERT_TRUE(dest1);
ASSERT_TRUE(dest2);
- EXPECT_FALSE(dest1->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kDisallowBlobWithInvalidSize));
- EXPECT_EQ(blobDataHandle, dest1->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
- EXPECT_FALSE(dest2->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kDisallowBlobWithInvalidSize));
- EXPECT_EQ(blobDataHandle, dest2->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_FALSE(dest1->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kDisallowBlobWithInvalidSize));
+ EXPECT_EQ(blobDataHandle, dest1->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_FALSE(dest2->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kDisallowBlobWithInvalidSize));
+ EXPECT_EQ(blobDataHandle, dest2->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
}
TEST(FetchDataConsumerTeeTest, CreateDone)
@@ -400,8 +400,8 @@ TEST(FetchDataConsumerTeeTest, CreateDone)
ASSERT_TRUE(dest1);
ASSERT_TRUE(dest2);
- EXPECT_FALSE(dest1->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
- EXPECT_FALSE(dest2->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_FALSE(dest1->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
+ EXPECT_FALSE(dest2->obtainFetchDataReader(nullptr, getCurrentTaskRunner())->drainAsBlobDataHandle(kAllowBlobWithInvalidSize));
HandleReaderRunner<HandleReader> r1(std::move(dest1)), r2(std::move(dest2));

Powered by Google App Engine
This is Rietveld 408576698