diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-06-22 09:53:13 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-06-22 10:23:17 +0000 |
commit | c5dbcb143405a38088d78b4b760d64aaff5157ab (patch) | |
tree | b37edca540b35f898e212bebfa6ded0806988122 /chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc | |
parent | 774f54339e5db91f785733232d3950366db65d07 (diff) | |
download | qtwebengine-chromium-c5dbcb143405a38088d78b4b760d64aaff5157ab.tar.gz |
BASELINE: Update Chromium to 102.0.5005.137
Change-Id: I162cdc7f56760218868e000a4c8ea92573344036
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc')
-rw-r--r-- | chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc b/chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc new file mode 100644 index 00000000000..f2a16a58418 --- /dev/null +++ b/chromium/components/policy/test_support/request_handler_for_status_upload_unittest.cc @@ -0,0 +1,49 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/policy/test_support/request_handler_for_status_upload.h" + +#include <utility> + +#include "components/policy/core/common/cloud/cloud_policy_constants.h" +#include "components/policy/test_support/embedded_policy_test_server_test_base.h" +#include "components/policy/test_support/policy_storage.h" +#include "net/http/http_status_code.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace policy { + +namespace { + +constexpr char kDeviceId[] = "fake_device_id"; + +} // namespace + +class RequestHandlerForStatusUploadTest + : public EmbeddedPolicyTestServerTestBase { + public: + RequestHandlerForStatusUploadTest() = default; + ~RequestHandlerForStatusUploadTest() override = default; + + void SetUp() override { + EmbeddedPolicyTestServerTestBase::SetUp(); + + SetRequestTypeParam(dm_protocol::kValueRequestUploadStatus); + SetAppType(dm_protocol::kValueAppType); + SetDeviceIdParam(kDeviceId); + SetDeviceType(dm_protocol::kValueDeviceType); + } +}; + +TEST_F(RequestHandlerForStatusUploadTest, HandleRequest) { + StartRequestAndWait(); + + EXPECT_EQ(GetResponseCode(), net::HTTP_OK); + ASSERT_TRUE(HasResponseBody()); + auto response = GetDeviceManagementResponse(); + EXPECT_TRUE(response.has_device_status_report_response()); + EXPECT_TRUE(response.has_session_status_report_response()); +} + +} // namespace policy |