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

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

Issue 2597853002: Unit test for PresentationDispatcher (Closed)
Patch Set: Address Mark's comments 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 91dba496d155dc24794d8787758765810999181c..6b6e1b337219f98aabc8e2708eeaabe167d340fa 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,21 @@ class CONTENT_EXPORT PresentationDispatcher
~PresentationDispatcher() override;
private:
+ friend class TestPresentationDispatcher;
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSession);
mark a. foltz 2017/01/03 18:39:19 Do these test cases actually use private members o
takumif 2017/01/03 23:29:50 Yes, PresentationDispatcher implements the methods
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSessionError);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestJoinSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestJoinSessionError);
+ 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);
@@ -137,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