OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "media/base/android/media_player_bridge.h" | 7 #include "media/base/android/media_player_bridge.h" |
8 #include "media/base/android/media_player_manager.h" | 8 #include "media/base/android/media_player_manager.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 40 matching lines...) Loading... |
51 MediaPlayerBridgeTest() | 51 MediaPlayerBridgeTest() |
52 : bridge_(0, | 52 : bridge_(0, |
53 GURL(), | 53 GURL(), |
54 GURL(), | 54 GURL(), |
55 "", | 55 "", |
56 false, | 56 false, |
57 &manager_, | 57 &manager_, |
58 base::Bind(&MockMediaPlayerManager::OnMediaResourcesRequested, | 58 base::Bind(&MockMediaPlayerManager::OnMediaResourcesRequested, |
59 base::Unretained(&manager_)), | 59 base::Unretained(&manager_)), |
60 GURL(), | 60 GURL(), |
61 false) {} | 61 false, |
| 62 0) {} |
62 | 63 |
63 void SetCanSeekForward(bool can_seek_forward) { | 64 void SetCanSeekForward(bool can_seek_forward) { |
64 bridge_.can_seek_forward_ = can_seek_forward; | 65 bridge_.can_seek_forward_ = can_seek_forward; |
65 } | 66 } |
66 | 67 |
67 void SetCanSeekBackward(bool can_seek_backward) { | 68 void SetCanSeekBackward(bool can_seek_backward) { |
68 bridge_.can_seek_backward_ = can_seek_backward; | 69 bridge_.can_seek_backward_ = can_seek_backward; |
69 } | 70 } |
70 | 71 |
71 bool SeekInternal(const base::TimeDelta& current_time, base::TimeDelta time) { | 72 bool SeekInternal(const base::TimeDelta& current_time, base::TimeDelta time) { |
(...skipping 30 matching lines...) Loading... |
102 SetCanSeekBackward(false); | 103 SetCanSeekBackward(false); |
103 | 104 |
104 // If this assertion fails, seeks will be allowed which will result in a | 105 // If this assertion fails, seeks will be allowed which will result in a |
105 // crash because j_media_player_bridge_ cannot be properly instantiated | 106 // crash because j_media_player_bridge_ cannot be properly instantiated |
106 // during this test. | 107 // during this test. |
107 ASSERT_FALSE( | 108 ASSERT_FALSE( |
108 SeekInternal(base::TimeDelta::FromSeconds(10), base::TimeDelta())); | 109 SeekInternal(base::TimeDelta::FromSeconds(10), base::TimeDelta())); |
109 } | 110 } |
110 | 111 |
111 } // namespace media | 112 } // namespace media |
OLD | NEW |