| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 TEST_F(MediaAppTest, InitializeCdm_Success) { | 136 TEST_F(MediaAppTest, InitializeCdm_Success) { |
| 137 InitializeCdm(kClearKey, true, 1); | 137 InitializeCdm(kClearKey, true, 1); |
| 138 run_loop_->Run(); | 138 run_loop_->Run(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 TEST_F(MediaAppTest, InitializeCdm_InvalidKeySystem) { | 141 TEST_F(MediaAppTest, InitializeCdm_InvalidKeySystem) { |
| 142 InitializeCdm(kInvalidKeySystem, false, 0); | 142 InitializeCdm(kInvalidKeySystem, false, 0); |
| 143 run_loop_->Run(); | 143 run_loop_->Run(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 TEST_F(MediaAppTest, InitializeRenderer_Success) { | 146 // Sometimes fails on Linux. http://crbug.com/594977 |
| 147 #if defined(OS_LINUX) |
| 148 #define MAYBE_InitializeRenderer_Success DISABLED_InitializeRenderer_Success |
| 149 #else |
| 150 #define MAYBE_InitializeRenderer_Success InitializeRenderer_Success |
| 151 #endif |
| 152 |
| 153 TEST_F(MediaAppTest, MAYBE_InitializeRenderer_Success) { |
| 147 InitializeRenderer(TestVideoConfig::Normal(), true); | 154 InitializeRenderer(TestVideoConfig::Normal(), true); |
| 148 run_loop_->Run(); | 155 run_loop_->Run(); |
| 149 } | 156 } |
| 150 | 157 |
| 151 TEST_F(MediaAppTest, InitializeRenderer_InvalidConfig) { | 158 TEST_F(MediaAppTest, InitializeRenderer_InvalidConfig) { |
| 152 InitializeRenderer(TestVideoConfig::Invalid(), false); | 159 InitializeRenderer(TestVideoConfig::Invalid(), false); |
| 153 run_loop_->Run(); | 160 run_loop_->Run(); |
| 154 } | 161 } |
| 155 | 162 |
| 156 TEST_F(MediaAppTest, Lifetime) { | 163 TEST_F(MediaAppTest, Lifetime) { |
| 157 // Disconnecting CDM and Renderer services doesn't terminate the app. | 164 // Disconnecting CDM and Renderer services doesn't terminate the app. |
| 158 cdm_.reset(); | 165 cdm_.reset(); |
| 159 renderer_.reset(); | 166 renderer_.reset(); |
| 160 | 167 |
| 161 // Disconnecting ServiceFactory service should terminate the app, which will | 168 // Disconnecting ServiceFactory service should terminate the app, which will |
| 162 // close the connection. | 169 // close the connection. |
| 163 EXPECT_CALL(*this, ConnectionClosed()) | 170 EXPECT_CALL(*this, ConnectionClosed()) |
| 164 .Times(Exactly(1)) | 171 .Times(Exactly(1)) |
| 165 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 172 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
| 166 service_factory_.reset(); | 173 service_factory_.reset(); |
| 167 | 174 |
| 168 run_loop_->Run(); | 175 run_loop_->Run(); |
| 169 } | 176 } |
| 170 | 177 |
| 171 } // namespace media | 178 } // namespace media |
| OLD | NEW |