Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/shell/renderer/test_runner/mock_web_push_client.h

Issue 784873004: Push API: delete MockWebPushClient [switchover 2/6] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/renderer/test_runner/mock_web_push_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
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 CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_PUSH_CLIENT_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_PUSH_CLIENT_H_
7
8 #include <string>
9
10 #include "third_party/WebKit/public/platform/WebPushClient.h"
11
12 namespace blink {
13 class WebServiceWorkerProvider;
14 } // namespace blink
15
16 namespace content {
17
18 // MockWebPushClient is a mock implementation of WebPushClient to be able to
19 // test the Push Message API in Blink without depending on the content layer.
20 // The mock, for legacy reasons, automatically fails if it wasn't set to another
21 // state. Consumers can set its success values and error values by calling
22 // respectively SetMockSuccessValues and SetMockErrorValues. When
23 // SetMockSuccessValues is called, the mock will always succeed until
24 // SetMockErrorValues is called at which point it will always fail.
25 class MockWebPushClient : public blink::WebPushClient {
26 public:
27 MockWebPushClient();
28 virtual ~MockWebPushClient();
29
30 void SetMockSuccessValues(const std::string& end_point,
31 const std::string& registration_id);
32
33 void SetMockErrorValues(const std::string& message);
34
35 private:
36 // WebPushClient implementation.
37 virtual void registerPushMessaging(
38 blink::WebPushRegistrationCallbacks* callbacks,
39 blink::WebServiceWorkerProvider* service_worker_provider);
40 virtual void getPermissionStatus(
41 blink::WebPushPermissionStatusCallback* callback,
42 blink::WebServiceWorkerProvider* provider);
43
44 std::string end_point_;
45 std::string registration_id_;
46 std::string error_message_;
47
48 DISALLOW_COPY_AND_ASSIGN(MockWebPushClient);
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_PUSH_CLIENT_H_
OLDNEW
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/renderer/test_runner/mock_web_push_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698