| 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 "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/html/AutoplayExperimentHelper.h" | 6 #include "core/html/AutoplayExperimentHelper.h" |
| 7 #include "platform/UserGestureIndicator.h" | 7 #include "platform/UserGestureIndicator.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 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 void TearDown() | 119 void TearDown() |
| 120 { | 120 { |
| 121 // Be sure that the mock is destructed before the test, so that any | 121 // Be sure that the mock is destructed before the test, so that any |
| 122 // missing expectations are noticed. Otherwise, the test will pass | 122 // missing expectations are noticed. Otherwise, the test will pass |
| 123 // and then missing expectations will show up in the log, without | 123 // and then missing expectations will show up in the log, without |
| 124 // causing a test failure. | 124 // causing a test failure. |
| 125 m_helper.clear(); | 125 m_helper.clear(); |
| 126 m_client.clear(); | 126 m_client.clear(); |
| 127 Heap::collectAllGarbage(); | 127 ThreadHeap::collectAllGarbage(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 Persistent<MockAutoplayClient> m_client; | 130 Persistent<MockAutoplayClient> m_client; |
| 131 Persistent<AutoplayExperimentHelper> m_helper; | 131 Persistent<AutoplayExperimentHelper> m_helper; |
| 132 | 132 |
| 133 // Mirror updatePlayState to transition to play. | 133 // Mirror updatePlayState to transition to play. |
| 134 void startPlayback() | 134 void startPlayback() |
| 135 { | 135 { |
| 136 EXPECT_CALL(*m_client, recordAutoplayMetric(AnyPlaybackStarted)) | 136 EXPECT_CALL(*m_client, recordAutoplayMetric(AnyPlaybackStarted)) |
| 137 .Times(1); | 137 .Times(1); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 EXPECT_CALL(*m_client, removeUserGestureRequirement()) | 426 EXPECT_CALL(*m_client, removeUserGestureRequirement()) |
| 427 .Times(1); | 427 .Times(1); |
| 428 EXPECT_CALL(*m_client, playInternal()) | 428 EXPECT_CALL(*m_client, playInternal()) |
| 429 .Times(1); | 429 .Times(1); |
| 430 EXPECT_CALL(*m_client, setRequestPositionUpdates(false)) | 430 EXPECT_CALL(*m_client, setRequestPositionUpdates(false)) |
| 431 .Times(1); | 431 .Times(1); |
| 432 moveIntoViewport(); | 432 moveIntoViewport(); |
| 433 } | 433 } |
| 434 } | 434 } |
| OLD | NEW |