OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "mojo/public/bindings/sample/generated/sample_service.h" | 11 #include "mojom/sample_service.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace sample { | 14 namespace sample { |
15 | 15 |
16 // Make a sample |Foo| in the given |ScratchBuffer|. | 16 // Make a sample |Foo| in the given |ScratchBuffer|. |
17 Foo* MakeFoo(mojo::ScratchBuffer* buf) { | 17 Foo* MakeFoo(mojo::ScratchBuffer* buf) { |
18 const std::string kName("foopy"); | 18 const std::string kName("foopy"); |
19 mojo::String* name = mojo::String::NewCopyOf(buf, kName); | 19 mojo::String* name = mojo::String::NewCopyOf(buf, kName); |
20 | 20 |
21 Bar* bar = Bar::New(buf); | 21 Bar* bar = Bar::New(buf); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 mojo::ScratchBuffer buf; | 224 mojo::ScratchBuffer buf; |
225 Foo* foo = MakeFoo(&buf); | 225 Foo* foo = MakeFoo(&buf); |
226 CheckFoo(foo); | 226 CheckFoo(foo); |
227 | 227 |
228 mojo::Handle port = { 10 }; | 228 mojo::Handle port = { 10 }; |
229 | 229 |
230 service->Frobinate(foo, true, port); | 230 service->Frobinate(foo, true, port); |
231 } | 231 } |
232 | 232 |
233 } // namespace sample | 233 } // namespace sample |
OLD | NEW |