| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "remoting/host/shaped_screen_capturer.h" | 5 #include "remoting/host/shaped_screen_capturer.h" |
| 6 | 6 |
| 7 #include "remoting/host/desktop_shape_tracker.h" | 7 #include "remoting/host/desktop_shape_tracker.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE { | 26 virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE { |
| 27 webrtc::DesktopFrame* frame = new webrtc::BasicDesktopFrame( | 27 webrtc::DesktopFrame* frame = new webrtc::BasicDesktopFrame( |
| 28 webrtc::DesktopSize(kScreenSize, kScreenSize)); | 28 webrtc::DesktopSize(kScreenSize, kScreenSize)); |
| 29 memset(frame->data(), 0, frame->stride() * kScreenSize); | 29 memset(frame->data(), 0, frame->stride() * kScreenSize); |
| 30 callback_->OnCaptureCompleted(frame); | 30 callback_->OnCaptureCompleted(frame); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual void SetMouseShapeObserver( | 33 virtual void SetMouseShapeObserver( |
| 34 MouseShapeObserver* mouse_shape_observer) OVERRIDE { | 34 MouseShapeObserver* mouse_shape_observer) OVERRIDE { |
| 35 } | 35 } |
| 36 virtual bool GetScreenList(ScreenList* screens) OVERRIDE { |
| 37 return false; |
| 38 } |
| 39 virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE { |
| 40 return false; |
| 41 } |
| 36 | 42 |
| 37 private: | 43 private: |
| 38 Callback* callback_; | 44 Callback* callback_; |
| 39 }; | 45 }; |
| 40 | 46 |
| 41 class FakeDesktopShapeTracker : public DesktopShapeTracker { | 47 class FakeDesktopShapeTracker : public DesktopShapeTracker { |
| 42 public: | 48 public: |
| 43 FakeDesktopShapeTracker() {} | 49 FakeDesktopShapeTracker() {} |
| 44 virtual ~FakeDesktopShapeTracker() {} | 50 virtual ~FakeDesktopShapeTracker() {} |
| 45 | 51 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 scoped_ptr<DesktopShapeTracker>(new FakeDesktopShapeTracker())); | 92 scoped_ptr<DesktopShapeTracker>(new FakeDesktopShapeTracker())); |
| 87 capturer.Start(this); | 93 capturer.Start(this); |
| 88 capturer.Capture(webrtc::DesktopRegion()); | 94 capturer.Capture(webrtc::DesktopRegion()); |
| 89 ASSERT_TRUE(last_frame_.get()); | 95 ASSERT_TRUE(last_frame_.get()); |
| 90 ASSERT_TRUE(last_frame_->shape()); | 96 ASSERT_TRUE(last_frame_->shape()); |
| 91 EXPECT_TRUE( | 97 EXPECT_TRUE( |
| 92 FakeDesktopShapeTracker::CreateShape().Equals(*last_frame_->shape())); | 98 FakeDesktopShapeTracker::CreateShape().Equals(*last_frame_->shape())); |
| 93 } | 99 } |
| 94 | 100 |
| 95 } // namespace remoting | 101 } // namespace remoting |
| OLD | NEW |