Skip to content

Commit 0a65874

Browse files
[ci] Manually roll master (flutter#6418)
Rolls Flutter master to the version that first failed due to flutter/engine#33688 Updates the camera_windows mocks to include the new method so that the tests will compile on master. Fixes the blocked roll.
1 parent 407a26d commit 0a65874

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

packages/camera/camera_windows/windows/test/capture_controller_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ TEST(CaptureController, InitCaptureEngineReportsFailure) {
291291
EXPECT_CALL(*engine.Get(), Initialize).Times(1).WillOnce(Return(E_FAIL));
292292

293293
EXPECT_CALL(*texture_registrar, RegisterTexture).Times(0);
294-
EXPECT_CALL(*texture_registrar, UnregisterTexture).Times(0);
294+
EXPECT_CALL(*texture_registrar, UnregisterTexture(_)).Times(0);
295295
EXPECT_CALL(*camera, OnCreateCaptureEngineSucceeded).Times(0);
296296
EXPECT_CALL(*camera,
297297
OnCreateCaptureEngineFailed(Eq(CameraResult::kError),
@@ -335,7 +335,7 @@ TEST(CaptureController, InitCaptureEngineReportsAccessDenied) {
335335
.WillOnce(Return(E_ACCESSDENIED));
336336

337337
EXPECT_CALL(*texture_registrar, RegisterTexture).Times(0);
338-
EXPECT_CALL(*texture_registrar, UnregisterTexture).Times(0);
338+
EXPECT_CALL(*texture_registrar, UnregisterTexture(_)).Times(0);
339339
EXPECT_CALL(*camera, OnCreateCaptureEngineSucceeded).Times(0);
340340
EXPECT_CALL(*camera,
341341
OnCreateCaptureEngineFailed(Eq(CameraResult::kAccessDenied),

packages/camera/camera_windows/windows/test/mocks.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class MockTextureRegistrar : public flutter::TextureRegistrar {
6767
return this->texture_id_;
6868
});
6969

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

81+
// Flutter 3.4+ version.
82+
ON_CALL(*this, UnregisterTexture(_, _))
83+
.WillByDefault(
84+
[this](int64_t tid, std::function<void()> callback) -> void {
85+
// Forward to the pre-3.4 implementation so that expectations can
86+
// be the same for all versions.
87+
this->UnregisterTexture(tid);
88+
if (callback) {
89+
callback();
90+
}
91+
});
92+
8093
ON_CALL(*this, MarkTextureFrameAvailable)
8194
.WillByDefault([this](int64_t tid) -> bool {
8295
if (tid == this->texture_id_) {
@@ -91,7 +104,13 @@ class MockTextureRegistrar : public flutter::TextureRegistrar {
91104
MOCK_METHOD(int64_t, RegisterTexture, (flutter::TextureVariant * texture),
92105
(override));
93106

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

97116
int64_t texture_id_ = -1;

0 commit comments

Comments
 (0)