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; | 33 typedef uint32 RGBA32; |
Sergey Ulanov
2015/07/09 19:43:13
Please don't duplicate type definition. I might be
liaoyuke
2015/07/09 23:21:00
Done.
| |
34 | 34 |
35 // Creates a connection to a remote host which is available for tests to use. | 35 // 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 | 36 // Provides convenient methods to create test cases to measure the input and |
37 // rendering latency between client and the remote host. | 37 // rendering latency between client and the remote host. |
38 // NOTE: This is an abstract class. To use it, please derive from this class | 38 // NOTE: This is an abstract class. To use it, please derive from this class |
39 // and initialize the application names in constructor. | 39 // and initialize the application names in constructor. |
40 class AppRemotingLatencyTestFixture : public testing::Test { | 40 class AppRemotingLatencyTestFixture : public testing::Test { |
41 public: | 41 public: |
42 AppRemotingLatencyTestFixture(); | 42 AppRemotingLatencyTestFixture(); |
43 ~AppRemotingLatencyTestFixture() override; | 43 ~AppRemotingLatencyTestFixture() override; |
44 | 44 |
45 protected: | 45 protected: |
46 // Set expected image pattern for comparison and a matched reply will be | 46 // Set expected image pattern for comparison and a matched reply will be |
47 // called when the pattern is matched. | 47 // called when the pattern is matched. |
48 void SetExpectedImagePattern(const webrtc::DesktopRect& expected_rect, | 48 void SetExpectedImagePattern(const webrtc::DesktopRect& expected_rect, |
49 const RgbaColor& expected_color); | 49 const RGBA32& expected_color); |
50 | 50 |
51 // Waits for an image pattern matched reply up to |max_wait_time|. Returns | 51 // 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. | 52 // true if we received a response within the maximum time limit. |
53 // NOTE: SetExpectedImagePattern() must be called before calling this method. | 53 // NOTE: SetExpectedImagePattern() must be called before calling this method. |
54 bool WaitForImagePatternMatched(const base::TimeDelta& max_wait_time); | 54 bool WaitForImagePatternMatched(const base::TimeDelta& max_wait_time); |
55 | 55 |
56 // Name of the application being tested. | 56 // Name of the application being tested. |
57 // NOTE: must be initialized in the constructor of derived class. | 57 // NOTE: Must be initialized in the constructor of derived class. |
58 std::string application_name_; | 58 std::string application_name_; |
59 | 59 |
60 private: | 60 private: |
61 // testing::Test interface. | 61 // testing::Test interface. |
62 void SetUp() override; | 62 void SetUp() override; |
63 void TearDown() override; | 63 void TearDown() override; |
64 | 64 |
65 // Contains the details for the application being tested. | 65 // Contains the details for the application being tested. |
66 const RemoteApplicationDetails& application_details_; | 66 const RemoteApplicationDetails& application_details_; |
67 | 67 |
(...skipping 14 matching lines...) Expand all Loading... | |
82 // TestChromotingClient own its lifetime. | 82 // TestChromotingClient own its lifetime. |
83 base::WeakPtr<TestVideoRenderer> test_video_renderer_; | 83 base::WeakPtr<TestVideoRenderer> test_video_renderer_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(AppRemotingLatencyTestFixture); | 85 DISALLOW_COPY_AND_ASSIGN(AppRemotingLatencyTestFixture); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace test | 88 } // namespace test |
89 } // namespace remoting | 89 } // namespace remoting |
90 | 90 |
91 #endif // REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ | 91 #endif // REMOTING_TEST_APP_REMOTING_LATENCY_TEST_FIXTURE_H_ |
OLD | NEW |