OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/tests/test_transport.h" | 5 #include "ppapi/tests/test_transport.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 | 12 |
13 #include "ppapi/c/dev/ppb_testing_dev.h" | 13 #include "ppapi/c/dev/ppb_testing_dev.h" |
14 #include "ppapi/c/pp_errors.h" | 14 #include "ppapi/c/pp_errors.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/cpp/completion_callback.h" | |
17 #include "ppapi/cpp/dev/transport_dev.h" | 16 #include "ppapi/cpp/dev/transport_dev.h" |
18 #include "ppapi/cpp/instance.h" | 17 #include "ppapi/cpp/instance.h" |
19 #include "ppapi/cpp/module.h" | 18 #include "ppapi/cpp/module.h" |
20 #include "ppapi/cpp/var.h" | 19 #include "ppapi/cpp/var.h" |
21 #include "ppapi/tests/test_utils.h" | 20 #include "ppapi/tests/test_utils.h" |
22 #include "ppapi/tests/testing_instance.h" | 21 #include "ppapi/tests/testing_instance.h" |
| 22 #include "ppapi/utility/completion_callback_factory.h" |
23 | 23 |
24 REGISTER_TEST_CASE(Transport); | 24 REGISTER_TEST_CASE(Transport); |
25 | 25 |
26 #define RUN_SUBTEST(function) { \ | 26 #define RUN_SUBTEST(function) { \ |
27 std::string result = function; \ | 27 std::string result = function; \ |
28 if (!result.empty()) \ | 28 if (!result.empty()) \ |
29 return result; \ | 29 return result; \ |
30 } | 30 } |
31 | 31 |
32 namespace { | 32 namespace { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // Close the transport and verify that callback is aborted. | 370 // Close the transport and verify that callback is aborted. |
371 ASSERT_EQ(transport1_->Close(), PP_OK); | 371 ASSERT_EQ(transport1_->Close(), PP_OK); |
372 | 372 |
373 ASSERT_EQ(recv_cb.run_count(), 1); | 373 ASSERT_EQ(recv_cb.run_count(), 1); |
374 ASSERT_EQ(recv_cb.result(), PP_ERROR_ABORTED); | 374 ASSERT_EQ(recv_cb.result(), PP_ERROR_ABORTED); |
375 | 375 |
376 Clean(); | 376 Clean(); |
377 | 377 |
378 PASS(); | 378 PASS(); |
379 } | 379 } |
OLD | NEW |