mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 00:51:35 +00:00
commit
649b075cb6
@ -135,8 +135,6 @@ void IPCSpecificInterfaceFuzzTest2(sptr<IRemoteObject> proxy, MessageParcel& sen
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_GET_AVOID_AREA),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_SET_SESSION_PROPERTY),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_SET_ASPECT_RATIO),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_UPDATE_WINDOW_ANIMATION_FLAG),
|
||||
@ -196,7 +194,6 @@ void ProxyInterfaceFuzzTestPart1(const uint8_t* data, size_t size)
|
||||
|
||||
sptr<WindowSessionProperty> property = UnmarshallingDataTo<WindowSessionProperty>(data, size);
|
||||
proxy->Foreground(property);
|
||||
proxy->SetSessionProperty(property);
|
||||
proxy->Background();
|
||||
proxy->RaiseToAppTop();
|
||||
|
||||
|
@ -196,7 +196,7 @@ public:
|
||||
WSError SetAspectRatio(float ratio) override;
|
||||
void SetFocusedOnShow(bool focusedOnShow);
|
||||
bool IsFocusedOnShow() const;
|
||||
WSError SetSessionProperty(const sptr<WindowSessionProperty>& property) override;
|
||||
WSError SetSessionProperty(const sptr<WindowSessionProperty>& property);
|
||||
sptr<WindowSessionProperty> GetSessionProperty() const;
|
||||
void SetSessionRect(const WSRect& rect);
|
||||
WSRect GetSessionRect() const;
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
virtual WSError MarkProcessed(int32_t eventId) { return WSError::WS_OK; }
|
||||
virtual WSError SetGlobalMaximizeMode(MaximizeMode mode) { return WSError::WS_OK; }
|
||||
virtual WSError GetGlobalMaximizeMode(MaximizeMode& mode) { return WSError::WS_OK; }
|
||||
virtual WSError SetSessionProperty(const sptr<WindowSessionProperty>& property) { return WSError::WS_OK; }
|
||||
virtual WSError SetAspectRatio(float ratio) { return WSError::WS_OK; }
|
||||
virtual WSError UpdateWindowAnimationFlag(bool needDefaultAnimationFlag) { return WSError::WS_OK; }
|
||||
virtual WSError UpdateWindowSceneAfterCustomAnimation(bool isAdd) { return WSError::WS_OK; }
|
||||
|
@ -42,7 +42,6 @@ enum class SessionInterfaceCode {
|
||||
TRANS_ID_GET_MAXIMIZE_MODE,
|
||||
TRANS_ID_NEED_AVOID,
|
||||
TRANS_ID_GET_AVOID_AREA,
|
||||
TRANS_ID_SET_SESSION_PROPERTY,
|
||||
TRANS_ID_SET_ASPECT_RATIO,
|
||||
TRANS_ID_UPDATE_WINDOW_ANIMATION_FLAG,
|
||||
TRANS_ID_UPDATE_CUSTOM_ANIMATION,
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
WSError MarkProcessed(int32_t eventId) override;
|
||||
WSError SetGlobalMaximizeMode(MaximizeMode mode) override;
|
||||
WSError GetGlobalMaximizeMode(MaximizeMode& mode) override;
|
||||
WSError SetSessionProperty(const sptr<WindowSessionProperty>& property) override;
|
||||
WSError SetAspectRatio(float ratio) override;
|
||||
WSError UpdateWindowAnimationFlag(bool needDefaultAnimationFlag) override;
|
||||
WSError SetLandscapeMultiWindow(bool isLandscapeMultiWindow) override;
|
||||
|
@ -52,7 +52,6 @@ private:
|
||||
int HandleGetGlobalMaximizeMode(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleNeedAvoid(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleGetAvoidAreaByType(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetSessionProperty(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetAspectRatio(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleSetWindowAnimationFlag(MessageParcel& data, MessageParcel& reply);
|
||||
int HandleUpdateWindowSceneAfterCustomAnimation(MessageParcel& data, MessageParcel& reply);
|
||||
|
@ -714,28 +714,6 @@ WSError SessionProxy::GetGlobalMaximizeMode(MaximizeMode& mode)
|
||||
return static_cast<WSError>(ret);
|
||||
}
|
||||
|
||||
WSError SessionProxy::SetSessionProperty(const sptr<WindowSessionProperty>& property)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
if (!data.WriteParcelable(property.GetRefPtr())) {
|
||||
WLOGFE("Write property failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
if (Remote()->SendRequest(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_SET_SESSION_PROPERTY),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
return WSError::WS_ERROR_IPC_FAILED;
|
||||
}
|
||||
int32_t ret = reply.ReadInt32();
|
||||
return static_cast<WSError>(ret);
|
||||
}
|
||||
|
||||
WSError SessionProxy::SetAspectRatio(float ratio)
|
||||
{
|
||||
MessageParcel data;
|
||||
|
@ -71,8 +71,6 @@ const std::map<uint32_t, SessionStubFunc> SessionStub::stubFuncMap_ {
|
||||
&SessionStub::HandleNeedAvoid),
|
||||
std::make_pair(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_GET_AVOID_AREA),
|
||||
&SessionStub::HandleGetAvoidAreaByType),
|
||||
std::make_pair(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_SET_SESSION_PROPERTY),
|
||||
&SessionStub::HandleSetSessionProperty),
|
||||
std::make_pair(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_SET_ASPECT_RATIO),
|
||||
&SessionStub::HandleSetAspectRatio),
|
||||
std::make_pair(static_cast<uint32_t>(SessionInterfaceCode::TRANS_ID_UPDATE_WINDOW_ANIMATION_FLAG),
|
||||
@ -471,15 +469,6 @@ int SessionStub::HandleGetAvoidAreaByType(MessageParcel& data, MessageParcel& re
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int SessionStub::HandleSetSessionProperty(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("HandleSetSessionProperty!");
|
||||
auto property = data.ReadStrongParcelable<WindowSessionProperty>();
|
||||
auto errCode = SetSessionProperty(property);
|
||||
reply.WriteUint32(static_cast<uint32_t>(errCode));
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
int SessionStub::HandleSetAspectRatio(MessageParcel& data, MessageParcel& reply)
|
||||
{
|
||||
WLOGFD("HandleSetAspectRatio!");
|
||||
|
@ -346,23 +346,6 @@ HWTEST_F(SessionProxyTest, GetGlobalMaximizeMode, Function | SmallTest | Level2)
|
||||
GTEST_LOG_(INFO) << "SessionProxyTest: GetGlobalMaximizeMode end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetSessionProperty
|
||||
* @tc.desc: normal function
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(SessionProxyTest, SetSessionProperty, Function | SmallTest | Level2)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "SessionProxyTest: SetSessionProperty start";
|
||||
sptr<IRemoteObject> iRemoteObjectMocker = new IRemoteObjectMocker();
|
||||
SessionProxy* sProxy = new(std::nothrow) SessionProxy(iRemoteObjectMocker);
|
||||
sptr<WindowSessionProperty> property = new WindowSessionProperty();
|
||||
WSError res = sProxy->SetSessionProperty(property);
|
||||
ASSERT_EQ(res, WSError::WS_OK);
|
||||
|
||||
GTEST_LOG_(INFO) << "SessionProxyTest: SetSessionProperty end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetAspectRatio
|
||||
* @tc.desc: normal function
|
||||
|
@ -158,8 +158,6 @@ HWTEST_F(SessionStubTest, sessionStubTest02, Function | SmallTest | Level2)
|
||||
ASSERT_EQ(0, res);
|
||||
res = session_->HandleGetAvoidAreaByType(data, reply);
|
||||
ASSERT_EQ(0, res);
|
||||
res = session_->HandleSetSessionProperty(data, reply);
|
||||
ASSERT_EQ(0, res);
|
||||
res = session_->HandleSetAspectRatio(data, reply);
|
||||
ASSERT_EQ(0, res);
|
||||
res = session_->HandleUpdateWindowSceneAfterCustomAnimation(data, reply);
|
||||
|
Loading…
Reference in New Issue
Block a user