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 <string> | 5 #include <string> |
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/logging.h" | 10 #include "base/logging.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 base::RunLoop loop; | 294 base::RunLoop loop; |
295 blink_proxy->PassPickledEnum( | 295 blink_proxy->PassPickledEnum( |
296 PickledEnumBlink::VALUE_1, | 296 PickledEnumBlink::VALUE_1, |
297 ExpectEnumResult(PickledEnumBlink::VALUE_1, loop.QuitClosure())); | 297 ExpectEnumResult(PickledEnumBlink::VALUE_1, loop.QuitClosure())); |
298 loop.Run(); | 298 loop.Run(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 TEST_F(PickleTest, PickleArray) { | 302 TEST_F(PickleTest, PickleArray) { |
303 auto proxy = ConnectToChromiumService(); | 303 auto proxy = ConnectToChromiumService(); |
304 auto pickles = Array<PickledStructChromium>::New(2); | 304 auto pickles = std::vector<PickledStructChromium>(2); |
305 pickles[0].set_foo(1); | 305 pickles[0].set_foo(1); |
306 pickles[0].set_bar(2); | 306 pickles[0].set_bar(2); |
307 pickles[0].set_baz(100); | 307 pickles[0].set_baz(100); |
308 pickles[1].set_foo(3); | 308 pickles[1].set_foo(3); |
309 pickles[1].set_bar(4); | 309 pickles[1].set_bar(4); |
310 pickles[1].set_baz(100); | 310 pickles[1].set_baz(100); |
311 { | 311 { |
312 base::RunLoop run_loop; | 312 base::RunLoop run_loop; |
313 // Verify that the array of pickled structs can be serialized and | 313 // Verify that the array of pickled structs can be serialized and |
314 // deserialized intact. This ensures that the ParamTraits are actually used | 314 // deserialized intact. This ensures that the ParamTraits are actually used |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 EXPECT_EQ(PickledEnumChromium::VALUE_1, | 399 EXPECT_EQ(PickledEnumChromium::VALUE_1, |
400 passed->f_enum); | 400 passed->f_enum); |
401 run_loop.Quit(); | 401 run_loop.Quit(); |
402 })); | 402 })); |
403 run_loop.Run(); | 403 run_loop.Run(); |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 } // namespace test | 407 } // namespace test |
408 } // namespace mojo | 408 } // namespace mojo |
OLD | NEW |