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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 bool wait_for_result_; | 90 bool wait_for_result_; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(FakeMidiManagerClient); | 92 DISALLOW_COPY_AND_ASSIGN(FakeMidiManagerClient); |
93 }; | 93 }; |
94 | 94 |
95 class MidiManagerTest : public ::testing::Test { | 95 class MidiManagerTest : public ::testing::Test { |
96 public: | 96 public: |
97 MidiManagerTest() | 97 MidiManagerTest() |
98 : manager_(new FakeMidiManager), | 98 : manager_(new FakeMidiManager), |
99 message_loop_(new base::MessageLoop) {} | 99 message_loop_(new base::MessageLoop) {} |
100 virtual ~MidiManagerTest() {} | 100 ~MidiManagerTest() override {} |
101 | 101 |
102 protected: | 102 protected: |
103 void StartTheFirstSession(FakeMidiManagerClient* client) { | 103 void StartTheFirstSession(FakeMidiManagerClient* client) { |
104 EXPECT_FALSE(manager_->start_initialization_is_called_); | 104 EXPECT_FALSE(manager_->start_initialization_is_called_); |
105 EXPECT_EQ(0U, manager_->GetClientCount()); | 105 EXPECT_EQ(0U, manager_->GetClientCount()); |
106 EXPECT_EQ(0U, manager_->GetPendingClientCount()); | 106 EXPECT_EQ(0U, manager_->GetPendingClientCount()); |
107 manager_->StartSession(client); | 107 manager_->StartSession(client); |
108 EXPECT_EQ(0U, manager_->GetClientCount()); | 108 EXPECT_EQ(0U, manager_->GetClientCount()); |
109 EXPECT_EQ(1U, manager_->GetPendingClientCount()); | 109 EXPECT_EQ(1U, manager_->GetPendingClientCount()); |
110 EXPECT_TRUE(manager_->start_initialization_is_called_); | 110 EXPECT_TRUE(manager_->start_initialization_is_called_); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Temporary until http://crbug.com/371230 is resolved. | 259 // Temporary until http://crbug.com/371230 is resolved. |
260 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); | 260 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); |
261 #else | 261 #else |
262 EXPECT_EQ(MIDI_OK, result); | 262 EXPECT_EQ(MIDI_OK, result); |
263 #endif | 263 #endif |
264 } | 264 } |
265 | 265 |
266 } // namespace | 266 } // namespace |
267 | 267 |
268 } // namespace media | 268 } // namespace media |
OLD | NEW |