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

Unified Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 2597853002: Unit test for PresentationDispatcher (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/presentation/presentation_dispatcher.h
diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
index 03cdf46eb009d9283eb4406b8139aad28336af7e..0bdf60385b20f8b51e08e59b5fdf5e393aa622d9 100644
--- a/content/renderer/presentation/presentation_dispatcher.h
+++ b/content/renderer/presentation/presentation_dispatcher.h
@@ -36,6 +36,8 @@ class WebVector;
namespace content {
+class TestPresentationDispatcher;
+
// PresentationDispatcher is a delegate for Presentation API messages used by
// Blink. It forwards the calls to the Mojo PresentationService.
class CONTENT_EXPORT PresentationDispatcher
@@ -47,6 +49,19 @@ class CONTENT_EXPORT PresentationDispatcher
~PresentationDispatcher() override;
private:
+ friend class TestPresentationDispatcher;
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestJoinSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendString);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendArrayBuffer);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendBlobData);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestCloseSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestTerminateSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestListenForScreenAvailability);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestSetDefaultPresentationUrls);
+
struct SendMessageRequest {
SendMessageRequest(blink::mojom::PresentationSessionInfoPtr session_info,
blink::mojom::ConnectionMessagePtr message);
@@ -139,7 +154,7 @@ class CONTENT_EXPORT PresentationDispatcher
void DoSendMessage(SendMessageRequest* request);
void HandleSendMessageRequests(bool success);
- void ConnectToPresentationServiceIfNeeded();
+ virtual void ConnectToPresentationServiceIfNeeded();
void UpdateListeningState();

Powered by Google App Engine
This is Rietveld 408576698