Commit a4b4fe57 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Rename *Fake to Fake*

Normally fake interface implementations use Fake prefix, but there
were some with Fake suffix, namely SignalStrategyFake and
HostStatusMonitorFake. Renamed them to use Fake prefix.

R=rmsousa@chromium.org

Review URL: https://codereview.chromium.org/393703002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283925 0039d316-1c4b-4281-b951-d872f2087c98
parent 77290750
......@@ -11,8 +11,8 @@
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/errors.h"
#include "remoting/protocol/protocol_mock_objects.h"
......@@ -267,7 +267,7 @@ class ChromotingHostTest : public testing::Test {
// Creates a fake webrtc::ScreenCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
webrtc::ScreenCapturer* CreateVideoCapturer() {
return new ScreenCapturerFake();
return new FakeScreenCapturer();
}
void DisconnectAllClients() {
......
......@@ -14,9 +14,9 @@
#include "remoting/host/audio_capturer.h"
#include "remoting/host/client_session.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_extension.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gmock_mutant.h"
......@@ -347,7 +347,7 @@ InputInjector* ClientSessionTest::CreateInputInjector() {
}
webrtc::ScreenCapturer* ClientSessionTest::CreateVideoCapturer() {
return new ScreenCapturerFake();
return new FakeScreenCapturer();
}
void ClientSessionTest::ConnectClientSession() {
......@@ -645,9 +645,9 @@ TEST_F(ClientSessionTest, ClampMouseEvents) {
Expectation connected = authenticated;
int input_x[3] = { -999, 100, 999 };
int expected_x[3] = { 0, 100, ScreenCapturerFake::kWidth - 1 };
int expected_x[3] = { 0, 100, FakeScreenCapturer::kWidth - 1 };
int input_y[3] = { -999, 50, 999 };
int expected_y[3] = { 0, 50, ScreenCapturerFake::kHeight - 1 };
int expected_y[3] = { 0, 50, FakeScreenCapturer::kHeight - 1 };
protocol::MouseEvent expected_event;
for (int j = 0; j < 3; j++) {
......
......@@ -19,9 +19,9 @@
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/chromoting_messages.h"
#include "remoting/host/desktop_process.h"
#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/host/screen_resolution.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
......@@ -219,7 +219,7 @@ InputInjector* DesktopProcessTest::CreateInputInjector() {
}
webrtc::ScreenCapturer* DesktopProcessTest::CreateVideoCapturer() {
return new ScreenCapturerFake();
return new FakeScreenCapturer();
}
void DesktopProcessTest::DisconnectChannels() {
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_HOST_HOST_STATUS_MONITOR_FAKE_H_
#define REMOTING_HOST_HOST_STATUS_MONITOR_FAKE_H_
#ifndef REMOTING_HOST_FAKE_HOST_STATUS_MONITOR_H_
#define REMOTING_HOST_FAKE_HOST_STATUS_MONITOR_H_
#include "base/memory/weak_ptr.h"
#include "remoting/host/host_status_monitor.h"
......@@ -11,11 +11,11 @@
namespace remoting {
// An implementation of HostStatusMonitor that does nothing.
class HostStatusMonitorFake
: public base::SupportsWeakPtr<HostStatusMonitorFake>,
class FakeHostStatusMonitor
: public base::SupportsWeakPtr<FakeHostStatusMonitor>,
public HostStatusMonitor {
public:
virtual ~HostStatusMonitorFake() {}
virtual ~FakeHostStatusMonitor() {}
// HostStatusMonitor interface.
virtual void AddStatusObserver(HostStatusObserver* observer) OVERRIDE {}
......@@ -24,4 +24,4 @@ class HostStatusMonitorFake
} // namespace remoting
#endif // REMOTING_HOST_HOST_STATUS_MONITOR_FAKE_H_
#endif // REMOTING_HOST_FAKE_HOST_STATUS_MONITOR_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/host/fake_screen_capturer.h"
#include "base/logging.h"
#include "base/time/time.h"
......@@ -10,11 +10,11 @@
namespace remoting {
// ScreenCapturerFake generates a white picture of size kWidth x kHeight
// FakeScreenCapturer generates a white picture of size kWidth x kHeight
// with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed
// pixels per frame along both axes, and bounces off the sides of the screen.
static const int kWidth = ScreenCapturerFake::kWidth;
static const int kHeight = ScreenCapturerFake::kHeight;
static const int kWidth = FakeScreenCapturer::kWidth;
static const int kHeight = FakeScreenCapturer::kHeight;
static const int kBoxWidth = 140;
static const int kBoxHeight = 140;
static const int kSpeed = 20;
......@@ -24,7 +24,7 @@ COMPILE_ASSERT((kBoxWidth % kSpeed == 0) && (kWidth % kSpeed == 0) &&
(kBoxHeight % kSpeed == 0) && (kHeight % kSpeed == 0),
sizes_must_be_multiple_of_kSpeed);
ScreenCapturerFake::ScreenCapturerFake()
FakeScreenCapturer::FakeScreenCapturer()
: callback_(NULL),
mouse_shape_observer_(NULL),
bytes_per_row_(0),
......@@ -35,16 +35,16 @@ ScreenCapturerFake::ScreenCapturerFake()
ScreenConfigurationChanged();
}
ScreenCapturerFake::~ScreenCapturerFake() {
FakeScreenCapturer::~FakeScreenCapturer() {
}
void ScreenCapturerFake::Start(Callback* callback) {
void FakeScreenCapturer::Start(Callback* callback) {
DCHECK(!callback_);
DCHECK(callback);
callback_ = callback;
}
void ScreenCapturerFake::Capture(const webrtc::DesktopRegion& region) {
void FakeScreenCapturer::Capture(const webrtc::DesktopRegion& region) {
base::Time capture_start_time = base::Time::Now();
queue_.MoveToNextFrame();
......@@ -75,24 +75,24 @@ void ScreenCapturerFake::Capture(const webrtc::DesktopRegion& region) {
callback_->OnCaptureCompleted(queue_.current_frame()->Share());
}
void ScreenCapturerFake::SetMouseShapeObserver(
void FakeScreenCapturer::SetMouseShapeObserver(
MouseShapeObserver* mouse_shape_observer) {
DCHECK(!mouse_shape_observer_);
DCHECK(mouse_shape_observer);
mouse_shape_observer_ = mouse_shape_observer;
}
bool ScreenCapturerFake::GetScreenList(ScreenList* screens) {
bool FakeScreenCapturer::GetScreenList(ScreenList* screens) {
NOTIMPLEMENTED();
return false;
}
bool ScreenCapturerFake::SelectScreen(webrtc::ScreenId id) {
bool FakeScreenCapturer::SelectScreen(webrtc::ScreenId id) {
NOTIMPLEMENTED();
return false;
}
void ScreenCapturerFake::GenerateImage() {
void FakeScreenCapturer::GenerateImage() {
webrtc::DesktopFrame* frame = queue_.current_frame();
const int kBytesPerPixel = webrtc::DesktopFrame::kBytesPerPixel;
......@@ -129,7 +129,7 @@ void ScreenCapturerFake::GenerateImage() {
}
}
void ScreenCapturerFake::ScreenConfigurationChanged() {
void FakeScreenCapturer::ScreenConfigurationChanged() {
size_.set(kWidth, kHeight);
queue_.Reset();
bytes_per_row_ = size_.width() * webrtc::DesktopFrame::kBytesPerPixel;
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_HOST_SCREEN_CAPTURER_FAKE_H_
#define REMOTING_HOST_SCREEN_CAPTURER_FAKE_H_
#ifndef REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
#define REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
......@@ -13,17 +13,17 @@
namespace remoting {
// A ScreenCapturerFake generates artificial image for testing purpose.
// A FakeScreenCapturer generates artificial image for testing purpose.
//
// ScreenCapturerFake is double-buffered as required by ScreenCapturer.
class ScreenCapturerFake : public webrtc::ScreenCapturer {
// FakeScreenCapturer is double-buffered as required by ScreenCapturer.
class FakeScreenCapturer : public webrtc::ScreenCapturer {
public:
// ScreenCapturerFake generates a picture of size kWidth x kHeight.
// FakeScreenCapturer generates a picture of size kWidth x kHeight.
static const int kWidth = 800;
static const int kHeight = 600;
ScreenCapturerFake();
virtual ~ScreenCapturerFake();
FakeScreenCapturer();
virtual ~FakeScreenCapturer();
// webrtc::DesktopCapturer interface.
virtual void Start(Callback* callback) OVERRIDE;
......@@ -54,9 +54,9 @@ class ScreenCapturerFake : public webrtc::ScreenCapturer {
webrtc::ScreenCaptureFrameQueue queue_;
DISALLOW_COPY_AND_ASSIGN(ScreenCapturerFake);
DISALLOW_COPY_AND_ASSIGN(FakeScreenCapturer);
};
} // namespace remoting
#endif // REMOTING_HOST_SCREEN_CAPTURER_FAKE_H_
#endif // REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
......@@ -6,7 +6,7 @@
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "remoting/host/host_status_monitor_fake.h"
#include "remoting/host/fake_host_status_monitor.h"
#include "remoting/signaling/mock_signal_strategy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gmock_mutant.h"
......@@ -141,7 +141,7 @@ class HostStatusLoggerTest : public testing::Test {
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
MockSignalStrategy signal_strategy_;
scoped_ptr<HostStatusLogger> host_status_logger_;
HostStatusMonitorFake host_status_monitor_;
FakeHostStatusMonitor host_status_monitor_;
};
TEST_F(HostStatusLoggerTest, SendNow) {
......
......@@ -24,9 +24,9 @@
#include "remoting/host/desktop_session.h"
#include "remoting/host/desktop_session_connector.h"
#include "remoting/host/desktop_session_proxy.h"
#include "remoting/host/fake_screen_capturer.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/ipc_desktop_environment.h"
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -344,7 +344,7 @@ InputInjector* IpcDesktopEnvironmentTest::CreateInputInjector() {
}
webrtc::ScreenCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
return new ScreenCapturerFake();
return new FakeScreenCapturer();
}
void IpcDesktopEnvironmentTest::DeleteDesktopEnvironment() {
......
......@@ -5,6 +5,7 @@
#include "remoting/host/shaped_screen_capturer.h"
#include "remoting/host/desktop_shape_tracker.h"
#include "remoting/host/fake_screen_capturer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
......@@ -12,38 +13,6 @@
namespace remoting {
const int kScreenSize = 10;
class FakeScreenCapturer : public webrtc::ScreenCapturer {
public:
FakeScreenCapturer() {}
virtual ~FakeScreenCapturer() {}
virtual void Start(Callback* callback) OVERRIDE {
callback_ = callback;
}
virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE {
webrtc::DesktopFrame* frame = new webrtc::BasicDesktopFrame(
webrtc::DesktopSize(kScreenSize, kScreenSize));
memset(frame->data(), 0, frame->stride() * kScreenSize);
callback_->OnCaptureCompleted(frame);
}
virtual void SetMouseShapeObserver(
MouseShapeObserver* mouse_shape_observer) OVERRIDE {
}
virtual bool GetScreenList(ScreenList* screens) OVERRIDE {
return false;
}
virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE {
return false;
}
private:
Callback* callback_;
};
class FakeDesktopShapeTracker : public DesktopShapeTracker {
public:
FakeDesktopShapeTracker() {}
......
......@@ -11,7 +11,7 @@
#include "remoting/base/auto_thread.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/codec/video_encoder_verbatim.h"
#include "remoting/host/screen_capturer_fake.h"
#include "remoting/host/fake_screen_capturer.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
......@@ -83,7 +83,7 @@ class ThreadCheckVideoEncoder : public VideoEncoderVerbatim {
DISALLOW_COPY_AND_ASSIGN(ThreadCheckVideoEncoder);
};
class ThreadCheckScreenCapturer : public ScreenCapturerFake {
class ThreadCheckScreenCapturer : public FakeScreenCapturer {
public:
ThreadCheckScreenCapturer(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
......
......@@ -77,12 +77,14 @@
'host/daemon_process_unittest.cc',
'host/desktop_process_unittest.cc',
'host/desktop_shape_tracker_unittest.cc',
'host/fake_host_status_monitor.h',
'host/fake_screen_capturer.cc',
'host/fake_screen_capturer.h',
'host/gnubby_auth_handler_posix_unittest.cc',
'host/heartbeat_sender_unittest.cc',
'host/host_change_notification_listener_unittest.cc',
'host/host_mock_objects.cc',
'host/host_status_logger_unittest.cc',
'host/host_status_monitor_fake.h',
'host/host_status_sender_unittest.cc',
'host/ipc_desktop_environment_unittest.cc',
'host/it2me/it2me_native_messaging_host_unittest.cc',
......@@ -104,8 +106,6 @@
'host/register_support_host_request_unittest.cc',
'host/remote_input_filter_unittest.cc',
'host/resizing_host_observer_unittest.cc',
'host/screen_capturer_fake.cc',
'host/screen_capturer_fake.h',
'host/screen_resolution_unittest.cc',
'host/server_log_entry_host_unittest.cc',
'host/setup/me2me_native_messaging_host.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment