| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 render_process_id, render_frame_id, page_request_id, controls, | 198 render_process_id, render_frame_id, page_request_id, controls, |
| 199 security_origin, callback); | 199 security_origin, callback); |
| 200 } | 200 } |
| 201 | 201 |
| 202 // media_stream_manager_ needs to outlive thread_bundle_ because it is a | 202 // media_stream_manager_ needs to outlive thread_bundle_ because it is a |
| 203 // MessageLoop::DestructionObserver. audio_manager_ needs to outlive | 203 // MessageLoop::DestructionObserver. audio_manager_ needs to outlive |
| 204 // thread_bundle_ because it uses the underlying message loop. | 204 // thread_bundle_ because it uses the underlying message loop. |
| 205 std::unique_ptr<MediaStreamManager> media_stream_manager_; | 205 std::unique_ptr<MediaStreamManager> media_stream_manager_; |
| 206 content::TestBrowserThreadBundle thread_bundle_; | 206 content::TestBrowserThreadBundle thread_bundle_; |
| 207 std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; | 207 std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; |
| 208 std::unique_ptr<media::AudioSystem> audio_system_; | 208 media::AudioSystem::UniquePtr audio_system_; |
| 209 base::RunLoop run_loop_; | 209 base::RunLoop run_loop_; |
| 210 | 210 |
| 211 private: | 211 private: |
| 212 DISALLOW_COPY_AND_ASSIGN(MediaStreamManagerTest); | 212 DISALLOW_COPY_AND_ASSIGN(MediaStreamManagerTest); |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 TEST_F(MediaStreamManagerTest, MakeMediaAccessRequest) { | 215 TEST_F(MediaStreamManagerTest, MakeMediaAccessRequest) { |
| 216 MakeMediaAccessRequest(0); | 216 MakeMediaAccessRequest(0); |
| 217 | 217 |
| 218 // Expecting the callback will be triggered and quit the test. | 218 // Expecting the callback will be triggered and quit the test. |
| (...skipping 71 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 |