| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/aura_desktop_capturer.h" | 5 #include "remoting/host/chromeos/aura_desktop_capturer.h" |
| 6 | 6 |
| 7 #include "cc/output/copy_output_result.h" | 7 #include "cc/output/copy_output_result.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 scoped_ptr<AuraDesktopCapturer> capturer_; | 59 scoped_ptr<AuraDesktopCapturer> capturer_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 void AuraDesktopCapturerTest::SetUp() { | 62 void AuraDesktopCapturerTest::SetUp() { |
| 63 capturer_.reset(new AuraDesktopCapturer()); | 63 capturer_.reset(new AuraDesktopCapturer()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 TEST_F(AuraDesktopCapturerTest, ConvertSkBitmapToDesktopFrame) { | 66 TEST_F(AuraDesktopCapturerTest, ConvertSkBitmapToDesktopFrame) { |
| 67 webrtc::DesktopFrame* captured_frame = NULL; | 67 webrtc::DesktopFrame* captured_frame = nullptr; |
| 68 | 68 |
| 69 EXPECT_CALL(*this, OnCaptureCompleted(_)).Times(1).WillOnce( | 69 EXPECT_CALL(*this, OnCaptureCompleted(_)).Times(1).WillOnce( |
| 70 SaveArg<0>(&captured_frame)); | 70 SaveArg<0>(&captured_frame)); |
| 71 capturer_->Start(this); | 71 capturer_->Start(this); |
| 72 | 72 |
| 73 SimulateFrameCapture(); | 73 SimulateFrameCapture(); |
| 74 | 74 |
| 75 ASSERT_TRUE(captured_frame != NULL); | 75 ASSERT_TRUE(captured_frame != nullptr); |
| 76 uint8_t* captured_data = captured_frame->data(); | 76 uint8_t* captured_data = captured_frame->data(); |
| 77 EXPECT_EQ( | 77 EXPECT_EQ( |
| 78 0, | 78 0, |
| 79 memcmp( | 79 memcmp( |
| 80 frame_data, captured_data, sizeof(frame_data))); | 80 frame_data, captured_data, sizeof(frame_data))); |
| 81 | 81 |
| 82 delete captured_frame; | 82 delete captured_frame; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace remoting | 85 } // namespace remoting |
| OLD | NEW |