blob: 48049f00ee0281f8348b3ebb35c57d2769fdd675 [file] [log] [blame]
Kevin McNee5994d732025-03-26 15:55:371// Copyright 2025 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_ACTOR_ACTOR_TEST_UTIL_H_
6#define CHROME_BROWSER_ACTOR_ACTOR_TEST_UTIL_H_
7
mark a. foltza48aecb2025-05-09 21:58:358#include "base/test/test_future.h"
David Bokanf64ca03e2025-04-22 21:21:049#include "base/time/time.h"
mark a. foltza48aecb2025-05-09 21:58:3510#include "chrome/common/actor.mojom-forward.h"
Kevin McNee5994d732025-03-26 15:55:3711#include "components/optimization_guide/proto/features/actions_data.pb.h"
David Bokanc4f1aea2025-04-16 14:02:1712#include "ui/gfx/geometry/point.h"
Kevin McNee5994d732025-03-26 15:55:3713
14namespace actor {
15
16optimization_guide::proto::BrowserAction MakeClick(int content_node_id);
Rodney Dingd2733382025-05-15 17:42:5117optimization_guide::proto::BrowserAction MakeClick(
18 const gfx::Point& click_point);
David Bokana7da0672025-04-01 02:51:4119optimization_guide::proto::BrowserAction MakeHistoryBack();
20optimization_guide::proto::BrowserAction MakeHistoryForward();
Rodney Dinga8548d52025-04-01 13:03:5921optimization_guide::proto::BrowserAction MakeMouseMove(int content_node_id);
Rodney Ding33b5bffe2025-05-15 17:43:2522optimization_guide::proto::BrowserAction MakeMouseMove(
23 const gfx::Point& move_point);
Jason Chasec037459e2025-04-09 00:53:4424optimization_guide::proto::BrowserAction MakeNavigate(
25 std::string_view target_url);
Rodney Ding182593f92025-04-08 18:33:1326optimization_guide::proto::BrowserAction MakeType(int content_node_id,
27 std::string_view text,
28 bool follow_by_enter);
Rodney Ding0fb8cb62025-05-20 19:58:1129optimization_guide::proto::BrowserAction MakeType(const gfx::Point& type_point,
30 std::string_view text,
31 bool follow_by_enter);
David Bokan647b3ba62025-04-15 20:27:2332optimization_guide::proto::BrowserAction MakeSelect(int content_node_id,
33 std::string_view value);
34
Lan Wei4bf7d0b2025-04-08 21:59:1135optimization_guide::proto::BrowserAction MakeScroll(
36 std::optional<int> content_node_id,
37 float scroll_offset_x,
38 float scroll_offset_y);
David Bokanc4f1aea2025-04-16 14:02:1739optimization_guide::proto::BrowserAction MakeDragAndRelease(
40 const gfx::Point& from_point,
41 const gfx::Point& to_point);
Kevin McNee2ff058f2025-04-23 03:00:0242optimization_guide::proto::BrowserAction MakeWait();
Kevin McNee5994d732025-03-26 15:55:3743
David Bokanf64ca03e2025-04-22 21:21:0444void OverrideActionObservationDelay(const base::TimeDelta& delta);
45
mark a. foltza48aecb2025-05-09 21:58:3546void ExpectOkResult(base::test::TestFuture<mojom::ActionResultPtr>& future);
47void ExpectErrorResult(base::test::TestFuture<mojom::ActionResultPtr>& future,
48 mojom::ActionResultCode expected_code);
49
Kevin McNee5994d732025-03-26 15:55:3750} // namespace actor
51
52#endif // CHROME_BROWSER_ACTOR_ACTOR_TEST_UTIL_H_