OLD | NEW |
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 <list> | 5 #include <list> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "remoting/host/desktop_resizer.h" | 9 #include "remoting/host/desktop_resizer.h" |
10 #include "remoting/host/resizing_host_observer.h" | 10 #include "remoting/host/resizing_host_observer.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const SkISize* supported_sizes, int num_supported_sizes) | 23 const SkISize* supported_sizes, int num_supported_sizes) |
24 : initial_size_(initial_size), | 24 : initial_size_(initial_size), |
25 current_size_(initial_size), | 25 current_size_(initial_size), |
26 exact_size_supported_(exact_size_supported), | 26 exact_size_supported_(exact_size_supported), |
27 set_size_call_count_(0) { | 27 set_size_call_count_(0) { |
28 for (int i = 0; i < num_supported_sizes; ++i) { | 28 for (int i = 0; i < num_supported_sizes; ++i) { |
29 supported_sizes_.push_back(supported_sizes[i]); | 29 supported_sizes_.push_back(supported_sizes[i]); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 ~FakeDesktopResizer() { | 33 virtual ~FakeDesktopResizer() { |
34 EXPECT_EQ(initial_size_, GetCurrentSize()); | 34 EXPECT_EQ(initial_size_, GetCurrentSize()); |
35 } | 35 } |
36 | 36 |
37 int set_size_call_count() { return set_size_call_count_; } | 37 int set_size_call_count() { return set_size_call_count_; } |
38 | 38 |
39 // remoting::DesktopResizer interface | 39 // remoting::DesktopResizer interface |
40 virtual SkISize GetCurrentSize() OVERRIDE { | 40 virtual SkISize GetCurrentSize() OVERRIDE { |
41 return current_size_; | 41 return current_size_; |
42 } | 42 } |
43 virtual std::list<SkISize> GetSupportedSizes( | 43 virtual std::list<SkISize> GetSupportedSizes( |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 supported_sizes, arraysize(supported_sizes)); | 179 supported_sizes, arraysize(supported_sizes)); |
180 SetDesktopResizer(scoped_ptr<FakeDesktopResizer>(desktop_resizer)); | 180 SetDesktopResizer(scoped_ptr<FakeDesktopResizer>(desktop_resizer)); |
181 | 181 |
182 SkISize client_sizes[] = { { 640, 640 }, { 1024, 768 }, { 640, 480 } }; | 182 SkISize client_sizes[] = { { 640, 640 }, { 1024, 768 }, { 640, 480 } }; |
183 SkISize expected_sizes[] = { { 640, 480 }, { 640, 480 }, { 640, 480 } }; | 183 SkISize expected_sizes[] = { { 640, 480 }, { 640, 480 }, { 640, 480 } }; |
184 VerifySizes(client_sizes, expected_sizes, arraysize(client_sizes)); | 184 VerifySizes(client_sizes, expected_sizes, arraysize(client_sizes)); |
185 EXPECT_EQ(desktop_resizer->set_size_call_count(), 0); | 185 EXPECT_EQ(desktop_resizer->set_size_call_count(), 0); |
186 } | 186 } |
187 | 187 |
188 } // namespace remoting | 188 } // namespace remoting |
OLD | NEW |