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

Side by Side Diff: content/renderer/presentation/presentation_dispatcher_unittest.cc

Issue 2874483002: [Presentation API] Remove closed connections from PresentationConnectionList (Closed)
Patch Set: rebase with master Created 3 years, 7 months 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/public/common/presentation_connection_message.h" 9 #include "content/public/common/presentation_connection_message.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 class TestPresentationReceiver : public blink::WebPresentationReceiver { 113 class TestPresentationReceiver : public blink::WebPresentationReceiver {
114 public: 114 public:
115 blink::WebPresentationConnection* OnReceiverConnectionAvailable( 115 blink::WebPresentationConnection* OnReceiverConnectionAvailable(
116 const blink::WebPresentationInfo&) override { 116 const blink::WebPresentationInfo&) override {
117 return &connection_; 117 return &connection_;
118 } 118 }
119 119
120 MOCK_METHOD1(DidChangeConnectionState, 120 MOCK_METHOD1(DidChangeConnectionState,
121 void(blink::WebPresentationConnectionState)); 121 void(blink::WebPresentationConnectionState));
122 MOCK_METHOD0(TerminateConnection, void()); 122 MOCK_METHOD0(TerminateConnection, void());
123 MOCK_METHOD1(RemoveConnection, void(blink::WebPresentationConnection*));
123 124
124 TestPresentationConnection connection_; 125 TestPresentationConnection connection_;
125 }; 126 };
126 127
127 class MockPresentationAvailabilityCallbacks 128 class MockPresentationAvailabilityCallbacks
128 : public blink::WebCallbacks<bool, const blink::WebPresentationError&> { 129 : public blink::WebCallbacks<bool, const blink::WebPresentationError&> {
129 public: 130 public:
130 MOCK_METHOD1(OnSuccess, void(bool value)); 131 MOCK_METHOD1(OnSuccess, void(bool value));
131 MOCK_METHOD1(OnError, void(const blink::WebPresentationError&)); 132 MOCK_METHOD1(OnError, void(const blink::WebPresentationError&));
132 }; 133 };
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 787
787 for (auto* mock_observer : mock_observers_) 788 for (auto* mock_observer : mock_observers_)
788 EXPECT_CALL(*mock_observer, AvailabilityChanged(false)); 789 EXPECT_CALL(*mock_observer, AvailabilityChanged(false));
789 790
790 base::RunLoop run_loop_2; 791 base::RunLoop run_loop_2;
791 ChangeURLState(gurl2_, URLState::Unavailable); 792 ChangeURLState(gurl2_, URLState::Unavailable);
792 run_loop_2.RunUntilIdle(); 793 run_loop_2.RunUntilIdle();
793 } 794 }
794 795
795 } // namespace content 796 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698