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

Side by Side Diff: remoting/host/resizing_host_observer_unittest.cc

Issue 12386035: Moving host status events monitoring to a separate interface (HostStatusMonitor). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/resizing_host_observer.h" 5 #include "remoting/host/resizing_host_observer.h"
6 #include "remoting/host/desktop_resizer.h" 6 #include "remoting/host/desktop_resizer.h"
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 bool exact_size_supported_; 60 bool exact_size_supported_;
61 std::list<SkISize> supported_sizes_; 61 std::list<SkISize> supported_sizes_;
62 62
63 int set_size_call_count_; 63 int set_size_call_count_;
64 }; 64 };
65 65
66 class ResizingHostObserverTest : public testing::Test { 66 class ResizingHostObserverTest : public testing::Test {
67 public: 67 public:
68 void SetDesktopResizer(FakeDesktopResizer* desktop_resizer) { 68 void SetDesktopResizer(FakeDesktopResizer* desktop_resizer) {
69 CHECK(!desktop_resizer_.get()) << "Call SetDeskopResizer once per test"; 69 CHECK(!desktop_resizer_.get()) << "Call SetDeskopResizer once per test";
70 resizing_host_observer_.reset(new ResizingHostObserver(desktop_resizer, 70 resizing_host_observer_.reset(
71 NULL)); 71 new ResizingHostObserver(desktop_resizer,
72 base::WeakPtr<HostStatusMonitor>()));
72 desktop_resizer_.reset(desktop_resizer); 73 desktop_resizer_.reset(desktop_resizer);
73 resizing_host_observer_->OnClientAuthenticated(""); 74 resizing_host_observer_->OnClientAuthenticated("");
74 } 75 }
75 76
76 SkISize GetBestSize(const SkISize& client_size) { 77 SkISize GetBestSize(const SkISize& client_size) {
77 resizing_host_observer_->OnClientResolutionChanged( 78 resizing_host_observer_->OnClientResolutionChanged(
78 "", client_size, SkIPoint()); 79 "", client_size, SkIPoint());
79 return desktop_resizer_->GetCurrentSize(); 80 return desktop_resizer_->GetCurrentSize();
80 } 81 }
81 82
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 new FakeDesktopResizer(SkISize::Make(640, 480), false, 177 new FakeDesktopResizer(SkISize::Make(640, 480), false,
177 supported_sizes, arraysize(supported_sizes)); 178 supported_sizes, arraysize(supported_sizes));
178 SetDesktopResizer(desktop_resizer); 179 SetDesktopResizer(desktop_resizer);
179 SkISize client_sizes[] = { { 640, 640 }, { 1024, 768 }, { 640, 480 } }; 180 SkISize client_sizes[] = { { 640, 640 }, { 1024, 768 }, { 640, 480 } };
180 SkISize expected_sizes[] = { { 640, 480 }, { 640, 480 }, { 640, 480 } }; 181 SkISize expected_sizes[] = { { 640, 480 }, { 640, 480 }, { 640, 480 } };
181 VerifySizes(client_sizes, expected_sizes, arraysize(client_sizes)); 182 VerifySizes(client_sizes, expected_sizes, arraysize(client_sizes));
182 EXPECT_EQ(desktop_resizer->set_size_call_count(), 0); 183 EXPECT_EQ(desktop_resizer->set_size_call_count(), 0);
183 } 184 }
184 185
185 } // namespace remoting 186 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698