| // Copyright 2021 The Fuchsia 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 "src/developer/debug/zxdb/debug_adapter/handlers/request_continue.h" |
| |
| #include <gtest/gtest.h> |
| |
| #include "src/developer/debug/zxdb/client/mock_remote_api.h" |
| #include "src/developer/debug/zxdb/debug_adapter/context_test.h" |
| |
| namespace zxdb { |
| |
| namespace { |
| |
| class RequestContinueTest : public DebugAdapterContextTest {}; |
| |
| } // namespace |
| |
| TEST_F(RequestContinueTest, ContinueThread) { |
| InitializeDebugging(); |
| |
| InjectProcess(kProcessKoid); |
| // Run client to receive process started event. |
| RunClient(); |
| InjectThread(kProcessKoid, kThreadKoid); |
| // Run client to receive threads started event. |
| RunClient(); |
| |
| // Send continue request from the client. |
| dap::ContinueRequest request = {}; |
| request.threadId = kThreadKoid; |
| auto response = client().send(request); |
| |
| // Read request and process it in server. |
| context().OnStreamReadable(); |
| EXPECT_EQ(1, mock_remote_api()->GetAndResetResumeCount()); |
| |
| // Run client to receive continue response. |
| RunClient(); |
| auto got = response.get(); |
| EXPECT_FALSE(got.error); |
| } |
| |
| } // namespace zxdb |