blob: e5b278c5a5e8272abddc8a9f3a8c9509a7120b1e [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2010 The Chromium Authors
[email protected]51a9ec42009-12-14 21:42:572// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Devlin Cronine458a222019-12-30 22:39:375#ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_TEST_HELPER_H_
6#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_TEST_HELPER_H_
[email protected]51a9ec42009-12-14 21:42:577
avia2f4804a2015-12-24 23:11:138#include <stddef.h>
9
dchengc963c7142016-04-08 03:55:2210#include <memory>
[email protected]51a9ec42009-12-14 21:42:5711#include <string>
12
Devlin Cronin5ce7d582021-05-05 23:01:0313#include "extensions/common/extension_id.h"
[email protected]2e0a1502014-05-14 02:59:4314#include "ui/gfx/native_widget_types.h"
[email protected]a39f1a92010-03-10 18:36:5815
[email protected]51a9ec42009-12-14 21:42:5716class Browser;
17
[email protected]733337862009-12-19 01:27:5118namespace gfx {
[email protected]866d940a2012-09-10 23:02:0219class Image;
[email protected]733337862009-12-19 01:27:5120class Size;
21} // namespace gfx
22
Alison Gale91301922024-04-15 19:35:2723// TODO(crbug.com/40177062): A lot of this class can be cleaned up for
Devlin Cronin5ce7d582021-05-05 23:01:0324// the new toolbar UI. Some of it may also be removable, since we now have
25// the platform-abstract ExtensionsContainer class.
Devlin Cronine458a222019-12-30 22:39:3726class ExtensionActionTestHelper {
[email protected]51a9ec42009-12-14 21:42:5727 public:
EmiliaPazb48d0992024-10-22 22:25:1228 static std::unique_ptr<ExtensionActionTestHelper> Create(Browser* browser);
rdevlin.cronin0c1c08b2015-04-27 21:35:1829
Peter Boström53c6c5952021-09-17 09:41:2630 ExtensionActionTestHelper(const ExtensionActionTestHelper&) = delete;
31 ExtensionActionTestHelper& operator=(const ExtensionActionTestHelper&) =
32 delete;
33
Sorin Jianuadfd3bf2024-12-05 22:32:4334 virtual ~ExtensionActionTestHelper() = default;
[email protected]51a9ec42009-12-14 21:42:5735
36 // Returns the number of browser action buttons in the window toolbar.
Elly Fong-Jones914e0d52018-03-09 16:50:1437 virtual int NumberOfBrowserActions() = 0;
[email protected]51a9ec42009-12-14 21:42:5738
Devlin Cronin5ce7d582021-05-05 23:01:0339 // Returns true if there is an action for the given `id`.
40 virtual bool HasAction(const extensions::ExtensionId& id) = 0;
[email protected]53a7d2d2010-03-10 07:50:0641
Keren Zhu321371e2024-05-15 19:49:5242 // Simulates a user click on the action button for the given `id`.
43 virtual void Press(const extensions::ExtensionId& id) = 0;
44
Devlin Cronin5ce7d582021-05-05 23:01:0345 // Inspects the extension popup for the action with the given `id`.
46 virtual void InspectPopup(const extensions::ExtensionId& id) = 0;
[email protected]51a9ec42009-12-14 21:42:5747
Devlin Cronin5ce7d582021-05-05 23:01:0348 // Returns icon for the action for the given `id`.
49 virtual gfx::Image GetIcon(const extensions::ExtensionId& id) = 0;
[email protected]51a9ec42009-12-14 21:42:57