| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/renderer/layout_test/blink_test_runner.h" | 5 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <clocale> | 10 #include <clocale> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 201 } |
| 202 void StopCapture() override {} | 202 void StopCapture() override {} |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 class MockAudioCapturerSource : public media::AudioCapturerSource { | 205 class MockAudioCapturerSource : public media::AudioCapturerSource { |
| 206 public: | 206 public: |
| 207 MockAudioCapturerSource() = default; | 207 MockAudioCapturerSource() = default; |
| 208 | 208 |
| 209 void Initialize(const media::AudioParameters& params, | 209 void Initialize(const media::AudioParameters& params, |
| 210 CaptureCallback* callback, | 210 CaptureCallback* callback, |
| 211 int session_id) override { | 211 int session_id) override {} |
| 212 callback_ = callback; | 212 void Start() override {} |
| 213 } | |
| 214 void Start() override { | |
| 215 if (callback_) | |
| 216 callback_->OnCaptureStarted(); | |
| 217 } | |
| 218 void Stop() override {} | 213 void Stop() override {} |
| 219 void SetVolume(double volume) override {} | 214 void SetVolume(double volume) override {} |
| 220 void SetAutomaticGainControl(bool enable) override {} | 215 void SetAutomaticGainControl(bool enable) override {} |
| 221 | 216 |
| 222 protected: | 217 protected: |
| 223 ~MockAudioCapturerSource() override {} | 218 ~MockAudioCapturerSource() override {} |
| 224 | |
| 225 private: | |
| 226 CaptureCallback* callback_ = nullptr; | |
| 227 | |
| 228 DISALLOW_COPY_AND_ASSIGN(MockAudioCapturerSource); | |
| 229 }; | 219 }; |
| 230 | 220 |
| 231 // Tests in web-platform-tests use absolute path links such as | 221 // Tests in web-platform-tests use absolute path links such as |
| 232 // <script src="/resources/testharness.js">. | 222 // <script src="/resources/testharness.js">. |
| 233 // Because we load the tests as local files, such links don't work. | 223 // Because we load the tests as local files, such links don't work. |
| 234 // This function fixes this issue by rewriting file: URLs which were produced | 224 // This function fixes this issue by rewriting file: URLs which were produced |
| 235 // from such links so that they point actual files in wpt/. | 225 // from such links so that they point actual files in wpt/. |
| 236 WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) { | 226 WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) { |
| 237 const char kFileScheme[] = "file:///"; | 227 const char kFileScheme[] = "file:///"; |
| 238 const int kFileSchemeLen = arraysize(kFileScheme) - 1; | 228 const int kFileSchemeLen = arraysize(kFileScheme) - 1; |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 void BlinkTestRunner::ReportLeakDetectionResult( | 1031 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1042 const LeakDetectionResult& report) { | 1032 const LeakDetectionResult& report) { |
| 1043 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1033 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1044 } | 1034 } |
| 1045 | 1035 |
| 1046 void BlinkTestRunner::OnDestruct() { | 1036 void BlinkTestRunner::OnDestruct() { |
| 1047 delete this; | 1037 delete this; |
| 1048 } | 1038 } |
| 1049 | 1039 |
| 1050 } // namespace content | 1040 } // namespace content |
| OLD | NEW |