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

Side by Side Diff: content/shell/renderer/test_runner/mock_presentation_service.cc

Issue 938033002: Fix Presentation API mocks: do not eagerly drop clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/shell/renderer/test_runner/mock_presentation_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/shell/renderer/test_runner/mock_presentation_service.h" 5 #include "content/shell/renderer/test_runner/mock_presentation_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 10 matching lines...) Expand all
21 return; 21 return;
22 screen_availability_ = available; 22 screen_availability_ = available;
23 23
24 FOR_EACH_OBSERVER( 24 FOR_EACH_OBSERVER(
25 MockPresentationClient, 25 MockPresentationClient,
26 presentation_clients_, 26 presentation_clients_,
27 SetScreenAvailability(available)); 27 SetScreenAvailability(available));
28 } 28 }
29 29
30 void MockPresentationService::Reset() { 30 void MockPresentationService::Reset() {
31 FOR_EACH_OBSERVER(MockPresentationClient, presentation_clients_, Reset());
whywhat 2015/02/19 14:30:35 I think you need to leave this line as presentatio
mlamouri (slow - plz ping) 2015/02/19 14:44:31 Indeed. Didn't mean to remove it.
32 presentation_clients_.Clear();
33 screen_availability_ = false; 31 screen_availability_ = false;
34 } 32 }
35 33
36 void MockPresentationService::RegisterPresentationClientMock( 34 void MockPresentationService::RegisterPresentationClientMock(
37 MockPresentationClient* client) { 35 MockPresentationClient* client) {
38 DCHECK(client); 36 DCHECK(client);
39 presentation_clients_.AddObserver(client); 37 presentation_clients_.AddObserver(client);
40 } 38 }
41 39
42 void MockPresentationService::UnregisterPresentationClientMock( 40 void MockPresentationService::UnregisterPresentationClientMock(
43 MockPresentationClient* client) { 41 MockPresentationClient* client) {
44 DCHECK(client); 42 DCHECK(client);
45 presentation_clients_.RemoveObserver(client); 43 presentation_clients_.RemoveObserver(client);
46 } 44 }
47 45
48 } // namespace content 46 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/mock_presentation_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698