Index: media/cast/net/frame_id_wrap_helper_test.cc |
diff --git a/media/cast/net/frame_id_wrap_helper_test.cc b/media/cast/net/frame_id_wrap_helper_test.cc |
index 92a84435334913406ecc9baba45114e816779715..e48b4fa6dd9736534e738e89b48eccd4cd0c92e4 100644 |
--- a/media/cast/net/frame_id_wrap_helper_test.cc |
+++ b/media/cast/net/frame_id_wrap_helper_test.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include <gtest/gtest.h> |
+#include "media/cast/cast_defines.h" |
#include "media/cast/net/cast_transport_defines.h" |
namespace media { |
@@ -46,5 +47,22 @@ TEST_F(FrameIdWrapHelperTest, OutOfOrder) { |
EXPECT_EQ(257u, new_frame_id); |
} |
+TEST_F(FrameIdWrapHelperTest, Windowed) { |
+ srand(0); |
miu
2014/08/13 18:38:57
For the normal, consecutive case, consider adding:
|
+ const int window_size = 64; |
+ uint32 window_base = 0; |
+ for (int i = 0; i < 100000; i++) { |
+ int offset = rand() % window_size; |
+ uint32 frame_id = window_base + offset; |
+ uint32 mapped_frame_id = |
+ frame_id_wrap_helper_.MapTo32bitsFrameId(frame_id & 0xff); |
+ EXPECT_EQ(frame_id, mapped_frame_id); |
+ if (frame_id != mapped_frame_id) { |
+ break; |
+ } |
+ window_base += rand() % window_size; |
+ } |
+} |
+ |
} // namespace cast |
} // namespace media |