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

Side by Side Diff: ppapi/tests/test_utils.h

Issue 17419008: Move PPB_NetAddress out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_udp_socket.cc ('k') | ppapi/tests/test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PPAPI_TESTS_TEST_UTILS_H_ 5 #ifndef PPAPI_TESTS_TEST_UTILS_H_
6 #define PPAPI_TESTS_TEST_UTILS_H_ 6 #define PPAPI_TESTS_TEST_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ppapi/c/dev/ppb_testing_dev.h" 10 #include "ppapi/c/dev/ppb_testing_dev.h"
11 #include "ppapi/c/pp_instance.h" 11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/c/pp_stdint.h" 12 #include "ppapi/c/pp_stdint.h"
13 #include "ppapi/cpp/completion_callback.h" 13 #include "ppapi/cpp/completion_callback.h"
14 #include "ppapi/cpp/message_loop.h" 14 #include "ppapi/cpp/message_loop.h"
15 #include "ppapi/utility/completion_callback_factory.h" 15 #include "ppapi/utility/completion_callback_factory.h"
16 16
17 namespace pp { 17 namespace pp {
18 class NetAddress_Dev; 18 class NetAddress;
19 } 19 }
20 20
21 // Timeout to wait for some action to complete. 21 // Timeout to wait for some action to complete.
22 extern const int kActionTimeoutMs; 22 extern const int kActionTimeoutMs;
23 23
24 const PPB_Testing_Dev* GetTestingInterface(); 24 const PPB_Testing_Dev* GetTestingInterface();
25 std::string ReportError(const char* method, int32_t error); 25 std::string ReportError(const char* method, int32_t error);
26 void PlatformSleep(int duration_ms); 26 void PlatformSleep(int duration_ms);
27 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port); 27 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port);
28 28
29 uint16_t ConvertFromNetEndian16(uint16_t x); 29 uint16_t ConvertFromNetEndian16(uint16_t x);
30 uint16_t ConvertToNetEndian16(uint16_t x); 30 uint16_t ConvertToNetEndian16(uint16_t x);
31 bool EqualNetAddress(const pp::NetAddress_Dev& addr1, 31 bool EqualNetAddress(const pp::NetAddress& addr1, const pp::NetAddress& addr2);
32 const pp::NetAddress_Dev& addr2);
33 // Only returns the first address if there are more than one available. 32 // Only returns the first address if there are more than one available.
34 bool ResolveHost(PP_Instance instance, 33 bool ResolveHost(PP_Instance instance,
35 const std::string& host, 34 const std::string& host,
36 uint16_t port, 35 uint16_t port,
37 pp::NetAddress_Dev* addr); 36 pp::NetAddress* addr);
38 37
39 // NestedEvent allows you to run a nested MessageLoop and wait for a particular 38 // NestedEvent allows you to run a nested MessageLoop and wait for a particular
40 // event to complete. For example, you can use it to wait for a callback on a 39 // event to complete. For example, you can use it to wait for a callback on a
41 // PPP interface, which will "Signal" the event and make the loop quit. 40 // PPP interface, which will "Signal" the event and make the loop quit.
42 // "Wait()" will return immediately if it has already been signalled. Otherwise, 41 // "Wait()" will return immediately if it has already been signalled. Otherwise,
43 // it will run a nested message loop (using PPB_Testing.RunMessageLoop) and will 42 // it will run a nested message loop (using PPB_Testing.RunMessageLoop) and will
44 // return only after it has been signalled. 43 // return only after it has been signalled.
45 // Example: 44 // Example:
46 // std::string TestFullscreen::TestNormalToFullscreen() { 45 // std::string TestFullscreen::TestNormalToFullscreen() {
47 // pp::Fullscreen screen_mode(instance); 46 // pp::Fullscreen screen_mode(instance);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 #error Please add support for your platform in ppapi/tests/test_utils.h 322 #error Please add support for your platform in ppapi/tests/test_utils.h
324 #endif 323 #endif
325 324
326 /* These are used to determine POSIX-like implementations vs Windows. */ 325 /* These are used to determine POSIX-like implementations vs Windows. */
327 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ 326 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
328 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) 327 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__)
329 #define PPAPI_POSIX 1 328 #define PPAPI_POSIX 1
330 #endif 329 #endif
331 330
332 #endif // PPAPI_TESTS_TEST_UTILS_H_ 331 #endif // PPAPI_TESTS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « ppapi/tests/test_udp_socket.cc ('k') | ppapi/tests/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698