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

Unified Diff: remoting/test/app_remoting_latency_test_fixture.cc

Issue 1253613002: Updated latency fixture and refactored connection helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
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..05a7af829a550cb0eeb3df8826299c91de46811d 100644
--- a/remoting/test/app_remoting_latency_test_fixture.cc
+++ b/remoting/test/app_remoting_latency_test_fixture.cc
@@ -36,6 +36,10 @@ void AppRemotingLatencyTestFixture::SetUp() {
scoped_ptr<TestChromotingClient> test_chromoting_client(
new TestChromotingClient(test_video_renderer.Pass()));
+ test_chromoting_client_ = test_chromoting_client->GetWeakPtr();
+
+ test_chromoting_client_->AddRemoteConnectionObserver(this);
+
connection_helper_.reset(
new AppRemotingConnectionHelper(GetApplicationDetails()));
connection_helper_->Initialize(test_chromoting_client.Pass());
@@ -44,6 +48,11 @@ void AppRemotingLatencyTestFixture::SetUp() {
LOG(ERROR) << "Remote host connection could not be established.";
FAIL();
}
+
+ if (!CreateNewDocument()) {
+ LOG(ERROR) << "New document could not be created.";
+ FAIL();
joedow 2015/07/23 20:26:56 Have you run this through the try-bots yet? I see
liaoyuke 2015/07/24 02:07:28 Yeah, I'll run try-bots on my next patch.
+ }
}
void AppRemotingLatencyTestFixture::TearDown() {
@@ -52,6 +61,7 @@ void AppRemotingLatencyTestFixture::TearDown() {
ResetApplicationState();
}
+ test_chromoting_client_->RemoveRemoteConnectionObserver(this);
connection_helper_.reset();
}
@@ -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;

Powered by Google App Engine
This is Rietveld 408576698