 Chromium Code Reviews
 Chromium Code Reviews Issue 1253613002:
  Updated latency fixture and refactored connection helper  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1253613002:
  Updated latency fixture and refactored connection helper  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: remoting/test/app_remoting_latency_test_fixture.cc | 
| diff --git a/remoting/test/app_remoting_latency_test_fixture.cc b/remoting/test/app_remoting_latency_test_fixture.cc | 
| index 95b8e07d43162c30a30c87ac3767e7cbfe23cd7a..f3f0249c3acb12cbe2ec29d3c65c00d7c2dca97b 100644 | 
| --- a/remoting/test/app_remoting_latency_test_fixture.cc | 
| +++ b/remoting/test/app_remoting_latency_test_fixture.cc | 
| @@ -13,6 +13,7 @@ | 
| #include "remoting/protocol/usb_key_codes.h" | 
| #include "remoting/test/app_remoting_connection_helper.h" | 
| #include "remoting/test/app_remoting_test_driver_environment.h" | 
| +#include "remoting/test/rgb_value.h" | 
| #include "remoting/test/test_chromoting_client.h" | 
| #include "remoting/test/test_video_renderer.h" | 
| @@ -36,6 +37,8 @@ void AppRemotingLatencyTestFixture::SetUp() { | 
| scoped_ptr<TestChromotingClient> test_chromoting_client( | 
| new TestChromotingClient(test_video_renderer.Pass())); | 
| + test_chromoting_client->AddRemoteConnectionObserver(this); | 
| + | 
| connection_helper_.reset( | 
| new AppRemotingConnectionHelper(GetApplicationDetails())); | 
| connection_helper_->Initialize(test_chromoting_client.Pass()); | 
| @@ -44,6 +47,11 @@ void AppRemotingLatencyTestFixture::SetUp() { | 
| LOG(ERROR) << "Remote host connection could not be established."; | 
| FAIL(); | 
| } | 
| + | 
| + if (!PrepareApplicationForTesting()) { | 
| + LOG(ERROR) << "New document could not be created."; | 
| 
joedow
2015/07/24 13:50:58
Please fix error message, we don't know if creatin
 
liaoyuke
2015/07/25 01:43:49
I don't think so, the error message should come fr
 | 
| + FAIL(); | 
| + } | 
| } | 
| void AppRemotingLatencyTestFixture::TearDown() { | 
| @@ -52,13 +60,15 @@ void AppRemotingLatencyTestFixture::TearDown() { | 
| ResetApplicationState(); | 
| } | 
| + connection_helper_->GetTestChromotingClient()->RemoveRemoteConnectionObserver( | 
| + this); | 
| connection_helper_.reset(); | 
| } | 
| WaitForImagePatternMatchCallback | 
| AppRemotingLatencyTestFixture::SetExpectedImagePattern( | 
| const webrtc::DesktopRect& expected_rect, | 
| - uint32_t expected_color) { | 
| + const RGBValue& expected_color) { | 
| DCHECK(thread_checker_.CalledOnValidThread()); | 
| scoped_ptr<base::RunLoop> run_loop(new base::RunLoop()); | 
| @@ -91,6 +101,15 @@ bool AppRemotingLatencyTestFixture::WaitForImagePatternMatch( | 
| return image_pattern_is_matched; | 
| } | 
| +void AppRemotingLatencyTestFixture::HostMessageReceived( | 
| + const protocol::ExtensionMessage& message) { | 
| + DCHECK(thread_checker_.CalledOnValidThread()); | 
| + | 
| + if (!host_message_received_callback_.is_null()) { | 
| + host_message_received_callback_.Run(message); | 
| + } | 
| +} | 
| + | 
| void AppRemotingLatencyTestFixture::PressKey(uint32_t usb_keycode, | 
| bool pressed) { | 
| remoting::protocol::KeyEvent event; |