OLD | NEW |
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 #ifndef REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ | 5 #ifndef REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ |
6 #define REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ | 6 #define REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class DesktopRect; | 23 class DesktopRect; |
24 } | 24 } |
25 | 25 |
26 namespace remoting { | 26 namespace remoting { |
27 namespace test { | 27 namespace test { |
28 | 28 |
29 struct RemoteApplicationDetails; | 29 struct RemoteApplicationDetails; |
30 class AppRemotingConnectionHelper; | 30 class AppRemotingConnectionHelper; |
31 class TestVideoRenderer; | 31 class TestVideoRenderer; |
32 | 32 |
33 typedef uint32 RgbaColor; | |
34 | |
35 // Creates a connection to a remote host which is available for tests to use. | 33 // Creates a connection to a remote host which is available for tests to use. |
36 // Provides convenient methods to create test cases to measure the input and | 34 // Provides convenient methods to create test cases to measure the input and |
37 // rendering latency between client and the remote host. | 35 // rendering latency between client and the remote host. |
38 // NOTE: This is an abstract class. To use it, please derive from this class | 36 // NOTE: This is an abstract class. To use it, please derive from this class |
39 // and initialize the application names in constructor. | 37 // and initialize the application names in constructor. |
40 class AppRemotingLatencyTestFixture : public testing::Test { | 38 class AppRemotingLatencyTestFixture : public testing::Test { |
41 public: | 39 public: |
42 AppRemotingLatencyTestFixture(); | 40 AppRemotingLatencyTestFixture(); |
43 ~AppRemotingLatencyTestFixture() override; | 41 ~AppRemotingLatencyTestFixture() override; |
44 | 42 |
45 protected: | 43 protected: |
46 // Set expected image pattern for comparison and a matched reply will be | 44 // Set expected image pattern for comparison and a matched reply will be |
47 // called when the pattern is matched. | 45 // called when the pattern is matched. |
48 void SetExpectedImagePattern(const webrtc::DesktopRect& expected_rect, | 46 void SetExpectedImagePattern(const webrtc::DesktopRect& expected_rect, |
49 const RgbaColor& expected_color); | 47 uint32_t expected_avg_color); |
50 | 48 |
51 // Waits for an image pattern matched reply up to |max_wait_time|. Returns | 49 // Waits for an image pattern matched reply up to |max_wait_time|. Returns |
52 // true if we received a response within the maximum time limit. | 50 // true if we received a response within the maximum time limit. |
53 // NOTE: SetExpectedImagePattern() must be called before calling this method. | 51 // NOTE: SetExpectedImagePattern() must be called before calling this method. |
54 bool WaitForImagePatternMatched(const base::TimeDelta& max_wait_time); | 52 bool WaitForImagePatternMatched(const base::TimeDelta& max_wait_time); |
55 | 53 |
56 // Name of the application being tested. | 54 // Name of the application being tested. |
57 // NOTE: must be initialized in the constructor of derived class. | 55 // NOTE: Must be initialized in the constructor of derived class. |
58 std::string application_name_; | 56 std::string application_name_; |
59 | 57 |
60 private: | 58 private: |
61 // testing::Test interface. | 59 // testing::Test interface. |
62 void SetUp() override; | 60 void SetUp() override; |
63 void TearDown() override; | 61 void TearDown() override; |
64 | 62 |
65 // Contains the details for the application being tested. | 63 // Contains the details for the application being tested. |
66 const RemoteApplicationDetails& application_details_; | 64 const RemoteApplicationDetails& application_details_; |
67 | 65 |
(...skipping 14 matching lines...) Expand all Loading... |
82 // TestChromotingClient own its lifetime. | 80 // TestChromotingClient own its lifetime. |
83 base::WeakPtr<TestVideoRenderer> test_video_renderer_; | 81 base::WeakPtr<TestVideoRenderer> test_video_renderer_; |
84 | 82 |
85 DISALLOW_COPY_AND_ASSIGN(AppRemotingLatencyTestFixture); | 83 DISALLOW_COPY_AND_ASSIGN(AppRemotingLatencyTestFixture); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace test | 86 } // namespace test |
89 } // namespace remoting | 87 } // namespace remoting |
90 | 88 |
91 #endif // REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ | 89 #endif // REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ |
OLD | NEW |