| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/midi/midi_manager.h" | 5 #include "media/midi/midi_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 EndSession(many_existing_clients[i], sessions, sessions - 1); | 217 EndSession(many_existing_clients[i], sessions, sessions - 1); |
| 218 } | 218 } |
| 219 | 219 |
| 220 TEST_F(MidiManagerTest, CreateMidiManager) { | 220 TEST_F(MidiManagerTest, CreateMidiManager) { |
| 221 scoped_ptr<FakeMidiManagerClient> client; | 221 scoped_ptr<FakeMidiManagerClient> client; |
| 222 client.reset(new FakeMidiManagerClient(0)); | 222 client.reset(new FakeMidiManagerClient(0)); |
| 223 | 223 |
| 224 scoped_ptr<MidiManager> manager(MidiManager::Create()); | 224 scoped_ptr<MidiManager> manager(MidiManager::Create()); |
| 225 manager->StartSession(client.get(), client->client_id()); | 225 manager->StartSession(client.get(), client->client_id()); |
| 226 | 226 |
| 227 MidiResult result = client->WaitForResult(); |
| 227 // This #ifdef needs to be identical to the one in media/midi/midi_manager.cc. | 228 // This #ifdef needs to be identical to the one in media/midi/midi_manager.cc. |
| 228 // Do not change the condition for disabling this test. | 229 // Do not change the condition for disabling this test. |
| 229 #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(USE_ALSA) && \ | 230 #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(USE_ALSA) && \ |
| 230 !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 231 !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| 231 EXPECT_EQ(MIDI_NOT_SUPPORTED, client->WaitForResult()); | 232 EXPECT_EQ(MIDI_NOT_SUPPORTED, result); |
| 233 #elif defined(USE_ALSA) |
| 234 // Temporary until http://crbug.com/371230 is resolved. |
| 235 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); |
| 232 #else | 236 #else |
| 233 EXPECT_EQ(MIDI_OK, client->WaitForResult()); | 237 EXPECT_EQ(MIDI_OK, result); |
| 234 #endif | 238 #endif |
| 235 } | 239 } |
| 236 | 240 |
| 237 } // namespace | 241 } // namespace |
| 238 | 242 |
| 239 } // namespace media | 243 } // namespace media |
| OLD | NEW |