| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 } // namespace | 163 } // namespace |
| 164 | 164 |
| 165 class MediaStreamManagerTest : public ::testing::Test { | 165 class MediaStreamManagerTest : public ::testing::Test { |
| 166 public: | 166 public: |
| 167 MediaStreamManagerTest() | 167 MediaStreamManagerTest() |
| 168 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { | 168 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { |
| 169 audio_manager_.reset(new MockAudioManager()); | 169 audio_manager_.reset(new MockAudioManager()); |
| 170 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 170 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 171 media_stream_manager_ = | 171 media_stream_manager_ = |
| 172 base::MakeUnique<MediaStreamManager>(audio_system_.get()); | 172 MediaStreamManager::CreateWithDefaults(audio_system_.get()); |
| 173 base::RunLoop().RunUntilIdle(); | 173 base::RunLoop().RunUntilIdle(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 ~MediaStreamManagerTest() override {} | 176 ~MediaStreamManagerTest() override {} |
| 177 | 177 |
| 178 MOCK_METHOD1(Response, void(int index)); | 178 MOCK_METHOD1(Response, void(int index)); |
| 179 void ResponseCallback(int index, | 179 void ResponseCallback(int index, |
| 180 const MediaStreamDevices& devices, | 180 const MediaStreamDevices& devices, |
| 181 std::unique_ptr<MediaStreamUIProxy> ui_proxy) { | 181 std::unique_ptr<MediaStreamUIProxy> ui_proxy) { |
| 182 Response(index); | 182 Response(index); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 unique_other_id); | 290 unique_other_id); |
| 291 EXPECT_TRUE(MediaStreamManager::DoesMediaDeviceIDMatchHMAC( | 291 EXPECT_TRUE(MediaStreamManager::DoesMediaDeviceIDMatchHMAC( |
| 292 kMockSalt, security_origin, hashed_other_id, unique_other_id)); | 292 kMockSalt, security_origin, hashed_other_id, unique_other_id)); |
| 293 EXPECT_NE(unique_other_id, hashed_other_id); | 293 EXPECT_NE(unique_other_id, hashed_other_id); |
| 294 EXPECT_EQ(hashed_other_id.size(), 64U); | 294 EXPECT_EQ(hashed_other_id.size(), 64U); |
| 295 for (const char& c : hashed_other_id) | 295 for (const char& c : hashed_other_id) |
| 296 EXPECT_TRUE(base::IsAsciiDigit(c) || (c >= 'a' && c <= 'f')); | 296 EXPECT_TRUE(base::IsAsciiDigit(c) || (c >= 'a' && c <= 'f')); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace content | 299 } // namespace content |
| OLD | NEW |