Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: content/shell/test_runner/mock_web_midi_accessor.cc

Issue 2707183003: Move //components/test_runner back into //content/shell (Closed)
Patch Set: Trim DEPS Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/test_runner/mock_web_midi_accessor.h" 5 #include "content/shell/test_runner/mock_web_midi_accessor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "components/test_runner/test_interfaces.h" 11 #include "content/shell/test_runner/test_interfaces.h"
12 #include "components/test_runner/test_runner.h" 12 #include "content/shell/test_runner/test_runner.h"
13 #include "components/test_runner/web_test_delegate.h" 13 #include "content/shell/test_runner/web_test_delegate.h"
14 #include "components/test_runner/web_test_runner.h" 14 #include "content/shell/test_runner/web_test_runner.h"
15 #include "third_party/WebKit/public/platform/WebString.h" 15 #include "third_party/WebKit/public/platform/WebString.h"
16 #include "third_party/WebKit/public/platform/modules/webmidi/WebMIDIAccessorClie nt.h" 16 #include "third_party/WebKit/public/platform/modules/webmidi/WebMIDIAccessorClie nt.h"
17 17
18 using midi::mojom::PortState; 18 using midi::mojom::PortState;
19 using midi::mojom::Result; 19 using midi::mojom::Result;
20 20
21 namespace test_runner { 21 namespace test_runner {
22 22
23 namespace { 23 namespace {
24 24
(...skipping 15 matching lines...) Expand all
40 } // namespace 40 } // namespace
41 41
42 MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, 42 MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client,
43 TestInterfaces* interfaces) 43 TestInterfaces* interfaces)
44 : client_(client), 44 : client_(client),
45 interfaces_(interfaces), 45 interfaces_(interfaces),
46 next_input_port_index_(0), 46 next_input_port_index_(0),
47 next_output_port_index_(0), 47 next_output_port_index_(0),
48 weak_factory_(this) {} 48 weak_factory_(this) {}
49 49
50 MockWebMIDIAccessor::~MockWebMIDIAccessor() { 50 MockWebMIDIAccessor::~MockWebMIDIAccessor() {}
51 }
52 51
53 void MockWebMIDIAccessor::startSession() { 52 void MockWebMIDIAccessor::startSession() {
54 // Add a mock input and output port. 53 // Add a mock input and output port.
55 addInputPort(PortState::CONNECTED); 54 addInputPort(PortState::CONNECTED);
56 addOutputPort(PortState::CONNECTED); 55 addOutputPort(PortState::CONNECTED);
57 interfaces_->GetDelegate()->PostTask(base::Bind( 56 interfaces_->GetDelegate()->PostTask(base::Bind(
58 &MockWebMIDIAccessor::reportStartedSession, weak_factory_.GetWeakPtr(), 57 &MockWebMIDIAccessor::reportStartedSession, weak_factory_.GetWeakPtr(),
59 interfaces_->GetTestRunner()->midiAccessorResult())); 58 interfaces_->GetTestRunner()->midiAccessorResult()));
60 } 59 }
61 60
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 client_->didAddOutputPort(blink::WebString::fromUTF8(id), 111 client_->didAddOutputPort(blink::WebString::fromUTF8(id),
113 "MockOutputManufacturer", "MockOutputName", 112 "MockOutputManufacturer", "MockOutputName",
114 "MockOutputVersion", state); 113 "MockOutputVersion", state);
115 } 114 }
116 115
117 void MockWebMIDIAccessor::reportStartedSession(Result result) { 116 void MockWebMIDIAccessor::reportStartedSession(Result result) {
118 client_->didStartSession(result); 117 client_->didStartSession(result);
119 } 118 }
120 119
121 } // namespace test_runner 120 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698