1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef NWEB_COOKIE_TEST_CALLBACK_H 17 #define NWEB_COOKIE_TEST_CALLBACK_H 18 19 #include "nweb_cookie_manager.h" 20 #include "nweb_test_log.h" 21 22 namespace OHOS::NWeb { 23 class SetCookieTestCallback : public NWebValueCallback<bool> { 24 public: OnReceiveValue(bool value)25 void OnReceiveValue(bool value) 26 { 27 TESTLOG_I("SetCookieTestCallback result:%{public}d", value); 28 } 29 }; 30 31 class ExistCookieTestCallback : public NWebValueCallback<bool> { 32 public: OnReceiveValue(bool value)33 void OnReceiveValue(bool value) 34 { 35 TESTLOG_I("ExistCookieTestCallback result:%{public}d", value); 36 } 37 }; 38 39 class StoreCookieTestCallback : public NWebValueCallback<bool> { 40 public: OnReceiveValue(bool value)41 void OnReceiveValue(bool value) 42 { 43 TESTLOG_I("StoreCookieTestCallback result:%{public}d", value); 44 } 45 }; 46 47 class DeleteCookieTestCallback : public NWebValueCallback<bool> { 48 public: OnReceiveValue(bool value)49 void OnReceiveValue(bool value) 50 { 51 TESTLOG_I("DeleteCookieTestCallback result:%{public}d", value); 52 } 53 }; 54 55 class ReturnCookieTestCallback : public NWebValueCallback<std::string> { OnReceiveValue(std::string value)56 void OnReceiveValue(std::string value) 57 { 58 TESTLOG_I("ReturnCookieTestCallback result:%{public}s", value.c_str()); 59 } 60 }; 61 } // namespace OHOS::NWeb 62 63 #endif // NWEB_COOKIE_TEST_CALLBACK_H