Commit 7d1e977e authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Verify that MOCK_METHOD() works now.

Bug: 989095
Change-Id: I238f929bcf655a2be953bbb4d65a560d1452937a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310189
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791037}
parent 5d6e8d14
......@@ -44,10 +44,10 @@ class SampleClass {
// Declare a mock for the class.
class MockSampleClass : public SampleClass {
public:
MOCK_METHOD0(ReturnSomething, int());
MOCK_CONST_METHOD0(ReturnNothingConstly, void());
MOCK_METHOD1(OutputParam, void(int* a));
MOCK_METHOD2(ReturnSecond, int(int a, int b));
MOCK_METHOD(int, ReturnSomething, ());
MOCK_METHOD(void, ReturnNothingConstly, (), (const));
MOCK_METHOD(void, OutputParam, (int* a));
MOCK_METHOD(int, ReturnSecond, (int a, int b));
};
// Create a couple of custom actions. Custom actions can be used for adding
......
......@@ -33,20 +33,26 @@ class MockManagerWithRequests : public MockPermissionManager {
public:
MockManagerWithRequests() {}
~MockManagerWithRequests() override {}
MOCK_METHOD5(
MOCK_METHOD(
int,
RequestPermissions,
int(const std::vector<PermissionType>& permission,
(const std::vector<PermissionType>& permission,
RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::OnceCallback<void(
const std::vector<blink::mojom::PermissionStatus>&)> callback));
MOCK_METHOD2(SetPermissionOverridesForDevTools,
void(const base::Optional<url::Origin>& origin,
const PermissionOverrides& overrides));
MOCK_METHOD0(ResetPermissionOverridesForDevTools, void());
MOCK_METHOD2(IsPermissionOverridableByDevTools,
bool(PermissionType, const base::Optional<url::Origin>&));
const base::OnceCallback<
void(const std::vector<blink::mojom::PermissionStatus>&)> callback),
(override));
MOCK_METHOD(void,
SetPermissionOverridesForDevTools,
(const base::Optional<url::Origin>& origin,
const PermissionOverrides& overrides),
(override));
MOCK_METHOD(void, ResetPermissionOverridesForDevTools, (), (override));
MOCK_METHOD(bool,
IsPermissionOverridableByDevTools,
(PermissionType, const base::Optional<url::Origin>&),
(override));
private:
DISALLOW_COPY_AND_ASSIGN(MockManagerWithRequests);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment