Move fake-handle frame creation into test target.

Renames CreateFakeNativeHandleFrame to FakeNativeHandle::CreateFrame and
moves into test.gyp target 'fake_video_frames' which contains previous
frame_generator target.

Removes unused warnings from includers of
webrtc/test/fake_texture_frame.h which did not use the function above.

BUG=webrtc:5398
R=kjellander@webrtc.org
TBR=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1554223002 .

Cr-Original-Commit-Position: refs/heads/master@{#11149}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 13f61dfea59a546e4e0081eb79e38c542ec51cf6
diff --git a/common_video/common_video_unittests.gyp b/common_video/common_video_unittests.gyp
index beeab5dd..b5e892c 100644
--- a/common_video/common_video_unittests.gyp
+++ b/common_video/common_video_unittests.gyp
@@ -17,6 +17,7 @@
          '<(DEPTH)/testing/gtest.gyp:gtest',
          '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
          '<(webrtc_root)/test/test.gyp:test_support_main',
+         '<(webrtc_root)/test/test.gyp:fake_video_frames',
       ],
       'sources': [
         'i420_buffer_pool_unittest.cc',
diff --git a/common_video/i420_video_frame_unittest.cc b/common_video/i420_video_frame_unittest.cc
index e1b103f..926a5ee 100644
--- a/common_video/i420_video_frame_unittest.cc
+++ b/common_video/i420_video_frame_unittest.cc
@@ -243,7 +243,7 @@
 
 TEST(TestVideoFrame, TextureInitialValues) {
   test::FakeNativeHandle* handle = new test::FakeNativeHandle();
-  VideoFrame frame = test::CreateFakeNativeHandleFrame(
+  VideoFrame frame = test::FakeNativeHandle::CreateFrame(
       handle, 640, 480, 100, 10, webrtc::kVideoRotation_0);
   EXPECT_EQ(640, frame.width());
   EXPECT_EQ(480, frame.height());
diff --git a/modules/modules.gyp b/modules/modules.gyp
index d1fcebb..e3698e2 100644
--- a/modules/modules.gyp
+++ b/modules/modules.gyp
@@ -148,7 +148,7 @@
                 '<(webrtc_root)/modules/video_coding/codecs/vp8/vp8.gyp:webrtc_vp8',
                 '<(webrtc_root)/modules/video_coding/codecs/vp9/vp9.gyp:webrtc_vp9',
                 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
-                '<(webrtc_root)/test/test.gyp:frame_generator',
+                '<(webrtc_root)/test/test.gyp:fake_video_frames',
                 '<(webrtc_root)/test/test.gyp:rtp_test_utils',
                 '<(webrtc_root)/test/test.gyp:test_support_main',
                 '<(webrtc_root)/test/webrtc_test_common.gyp:webrtc_test_common',
diff --git a/test/fake_texture_frame.cc b/test/fake_texture_frame.cc
new file mode 100644
index 0000000..5d46eec
--- /dev/null
+++ b/test/fake_texture_frame.cc
@@ -0,0 +1,27 @@
+/*
+ *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/test/fake_texture_frame.h"
+
+namespace webrtc {
+namespace test {
+
+VideoFrame FakeNativeHandle::CreateFrame(FakeNativeHandle* native_handle,
+                                         int width,
+                                         int height,
+                                         uint32_t timestamp,
+                                         int64_t render_time_ms,
+                                         VideoRotation rotation) {
+  return VideoFrame(new rtc::RefCountedObject<FakeNativeHandleBuffer>(
+                        native_handle, width, height),
+                    timestamp, render_time_ms, rotation);
+}
+}  // namespace test
+}  // namespace webrtc
diff --git a/test/fake_texture_frame.h b/test/fake_texture_frame.h
index bc911cc..9575fae 100644
--- a/test/fake_texture_frame.h
+++ b/test/fake_texture_frame.h
@@ -17,7 +17,15 @@
 namespace webrtc {
 namespace test {
 
-class FakeNativeHandle {};
+class FakeNativeHandle {
+ public:
+  static VideoFrame CreateFrame(FakeNativeHandle* native_handle,
+                                int width,
+                                int height,
+                                uint32_t timestamp,
+                                int64_t render_time_ms,
+                                VideoRotation rotation);
+};
 
 class FakeNativeHandleBuffer : public NativeHandleBuffer {
  public:
@@ -41,16 +49,6 @@
   }
 };
 
-static VideoFrame CreateFakeNativeHandleFrame(FakeNativeHandle* native_handle,
-                                              int width,
-                                              int height,
-                                              uint32_t timestamp,
-                                              int64_t render_time_ms,
-                                              VideoRotation rotation) {
-  return VideoFrame(new rtc::RefCountedObject<FakeNativeHandleBuffer>(
-                        native_handle, width, height),
-                    timestamp, render_time_ms, rotation);
-}
 }  // namespace test
 }  // namespace webrtc
 #endif  //  WEBRTC_TEST_FAKE_TEXTURE_FRAME_H_
diff --git a/test/test.gyp b/test/test.gyp
index f7a5a42..82c8c25 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -59,9 +59,11 @@
       ],  # conditions.
     },
     {
-      'target_name': 'frame_generator',
+      'target_name': 'fake_video_frames',
       'type': 'static_library',
       'sources': [
+        'fake_texture_frame.cc',
+        'fake_texture_frame.h',
         'frame_generator.cc',
         'frame_generator.h',
       ],
diff --git a/test/webrtc_test_common.gyp b/test/webrtc_test_common.gyp
index ad2448e..07ea2c9 100644
--- a/test/webrtc_test_common.gyp
+++ b/test/webrtc_test_common.gyp
@@ -67,7 +67,7 @@
         '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/modules/modules.gyp:media_file',
         '<(webrtc_root)/modules/modules.gyp:video_render',
-        '<(webrtc_root)/test/test.gyp:frame_generator',
+        '<(webrtc_root)/test/test.gyp:fake_video_frames',
         '<(webrtc_root)/test/test.gyp:test_support',
         '<(webrtc_root)/test/test.gyp:rtp_test_utils',
         '<(webrtc_root)/webrtc.gyp:webrtc',
@@ -132,7 +132,7 @@
       'dependencies': [
         '<(DEPTH)/testing/gtest.gyp:gtest',
         '<(webrtc_root)/modules/modules.gyp:media_file',
-        '<(webrtc_root)/test/test.gyp:frame_generator',
+        '<(webrtc_root)/test/test.gyp:fake_video_frames',
         '<(webrtc_root)/test/test.gyp:test_support',
       ],
       'direct_dependent_settings': {
diff --git a/video/video_capture_input_unittest.cc b/video/video_capture_input_unittest.cc
index ed9c73a..9d720e2 100644
--- a/video/video_capture_input_unittest.cc
+++ b/video/video_capture_input_unittest.cc
@@ -191,7 +191,7 @@
   for (int i = 0 ; i < kNumFrame; ++i) {
     test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
     // Add one to |i| so that width/height > 0.
-    input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+    input_frames_.push_back(new VideoFrame(test::FakeNativeHandle::CreateFrame(
         dummy_handle, i + 1, i + 1, i + 1, i + 1, webrtc::kVideoRotation_0)));
     AddInputFrame(input_frames_[i]);
     WaitOutputFrame();
@@ -220,7 +220,7 @@
 
 TEST_F(VideoCaptureInputTest, TestI420FrameAfterTextureFrame) {
   test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
-  input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+  input_frames_.push_back(new VideoFrame(test::FakeNativeHandle::CreateFrame(
       dummy_handle, 1, 1, 1, 1, webrtc::kVideoRotation_0)));
   AddInputFrame(input_frames_[0]);
   WaitOutputFrame();
@@ -239,7 +239,7 @@
   WaitOutputFrame();
 
   test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
-  input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+  input_frames_.push_back(new VideoFrame(test::FakeNativeHandle::CreateFrame(
       dummy_handle, 1, 1, 2, 2, webrtc::kVideoRotation_0)));
   AddInputFrame(input_frames_[1]);
   WaitOutputFrame();
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index 14230e5..db7ca41 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -1158,13 +1158,13 @@
   test::FakeNativeHandle* handle1 = new test::FakeNativeHandle();
   test::FakeNativeHandle* handle2 = new test::FakeNativeHandle();
   test::FakeNativeHandle* handle3 = new test::FakeNativeHandle();
-  input_frames.push_back(test::CreateFakeNativeHandleFrame(
+  input_frames.push_back(test::FakeNativeHandle::CreateFrame(
       handle1, width, height, 1, 1, kVideoRotation_0));
-  input_frames.push_back(test::CreateFakeNativeHandleFrame(
+  input_frames.push_back(test::FakeNativeHandle::CreateFrame(
       handle2, width, height, 2, 2, kVideoRotation_0));
   input_frames.push_back(CreateVideoFrame(width, height, 3));
   input_frames.push_back(CreateVideoFrame(width, height, 4));
-  input_frames.push_back(test::CreateFakeNativeHandleFrame(
+  input_frames.push_back(test::FakeNativeHandle::CreateFrame(
       handle3, width, height, 5, 5, kVideoRotation_0));
 
   video_send_stream_->Start();