Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[ci] Manually roll master #6418

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4cd734ae3a1cc0c8f132ba07e6d2e0a3253c53e7
4930444f4afe85272bbdc84b43196d59dad71166
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST(CaptureController, InitCaptureEngineReportsFailure) {
EXPECT_CALL(*engine.Get(), Initialize).Times(1).WillOnce(Return(E_FAIL));

EXPECT_CALL(*texture_registrar, RegisterTexture).Times(0);
EXPECT_CALL(*texture_registrar, UnregisterTexture).Times(0);
EXPECT_CALL(*texture_registrar, UnregisterTexture(_)).Times(0);
EXPECT_CALL(*camera, OnCreateCaptureEngineSucceeded).Times(0);
EXPECT_CALL(*camera,
OnCreateCaptureEngineFailed(Eq(CameraResult::kError),
Expand Down Expand Up @@ -335,7 +335,7 @@ TEST(CaptureController, InitCaptureEngineReportsAccessDenied) {
.WillOnce(Return(E_ACCESSDENIED));

EXPECT_CALL(*texture_registrar, RegisterTexture).Times(0);
EXPECT_CALL(*texture_registrar, UnregisterTexture).Times(0);
EXPECT_CALL(*texture_registrar, UnregisterTexture(_)).Times(0);
EXPECT_CALL(*camera, OnCreateCaptureEngineSucceeded).Times(0);
EXPECT_CALL(*camera,
OnCreateCaptureEngineFailed(Eq(CameraResult::kAccessDenied),
Expand Down
21 changes: 20 additions & 1 deletion packages/camera/camera_windows/windows/test/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class MockTextureRegistrar : public flutter::TextureRegistrar {
return this->texture_id_;
});

ON_CALL(*this, UnregisterTexture)
// Deprecated pre-Flutter-3.4 version.
ON_CALL(*this, UnregisterTexture(_))
.WillByDefault([this](int64_t tid) -> bool {
if (tid == this->texture_id_) {
texture_ = nullptr;
Expand All @@ -77,6 +78,18 @@ class MockTextureRegistrar : public flutter::TextureRegistrar {
return false;
});

// Flutter 3.4+ version.
ON_CALL(*this, UnregisterTexture(_, _))
.WillByDefault(
[this](int64_t tid, std::function<void()> callback) -> void {
// Forward to the pre-3.4 implementation so that expectations can
// be the same for all versions.
this->UnregisterTexture(tid);
if (callback) {
callback();
}
});

ON_CALL(*this, MarkTextureFrameAvailable)
.WillByDefault([this](int64_t tid) -> bool {
if (tid == this->texture_id_) {
Expand All @@ -91,7 +104,13 @@ class MockTextureRegistrar : public flutter::TextureRegistrar {
MOCK_METHOD(int64_t, RegisterTexture, (flutter::TextureVariant * texture),
(override));

// Pre-Flutter-3.4 version.
MOCK_METHOD(bool, UnregisterTexture, (int64_t), (override));
// Flutter 3.4+ version.
// TODO(cbracken): Add an override annotation to this once 3.4+ is the
// minimum version tested in CI.
MOCK_METHOD(void, UnregisterTexture,
(int64_t, std::function<void()> callback), ());
MOCK_METHOD(bool, MarkTextureFrameAvailable, (int64_t), (override));

int64_t texture_id_ = -1;
Expand Down