| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 132 } |
| 133 | 133 |
| 134 void TearDown() | 134 void TearDown() |
| 135 { | 135 { |
| 136 // Be sure that the mock is destructed before the test, so that any | 136 // Be sure that the mock is destructed before the test, so that any |
| 137 // missing expectations are noticed. Otherwise, the test will pass | 137 // missing expectations are noticed. Otherwise, the test will pass |
| 138 // and then missing expectations will show up in the log, without | 138 // and then missing expectations will show up in the log, without |
| 139 // causing a test failure. | 139 // causing a test failure. |
| 140 m_helper.clear(); | 140 m_helper.clear(); |
| 141 m_client.clear(); | 141 m_client.clear(); |
| 142 ThreadState::current()-> collectAllGarbage(); | 142 ThreadHeap::collectAllGarbage(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 Persistent<MockAutoplayClient> m_client; | 145 Persistent<MockAutoplayClient> m_client; |
| 146 Persistent<AutoplayExperimentHelper> m_helper; | 146 Persistent<AutoplayExperimentHelper> m_helper; |
| 147 | 147 |
| 148 // Mirror updatePlayState to transition to play. | 148 // Mirror updatePlayState to transition to play. |
| 149 void startPlayback() | 149 void startPlayback() |
| 150 { | 150 { |
| 151 EXPECT_CALL(*m_client, recordAutoplayMetric(AnyPlaybackStarted)) | 151 EXPECT_CALL(*m_client, recordAutoplayMetric(AnyPlaybackStarted)) |
| 152 .Times(1); | 152 .Times(1); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 m_helper->mutedChanged(); | 497 m_helper->mutedChanged(); |
| 498 | 498 |
| 499 // Verify that unmuting pauses playback. | 499 // Verify that unmuting pauses playback. |
| 500 setIsMuted(false); | 500 setIsMuted(false); |
| 501 EXPECT_CALL(*m_client, pauseInternal()) | 501 EXPECT_CALL(*m_client, pauseInternal()) |
| 502 .Times(1); | 502 .Times(1); |
| 503 m_helper->mutedChanged(); | 503 m_helper->mutedChanged(); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } | 506 } |
| OLD | NEW |