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
3 // found in the LICENSE file.
5 #ifndef REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_
6 #define REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_
8 #import <Foundation/Foundation.h>
12 class HostRefreshTestHelper
{
14 constexpr static NSString
* CloseTag
= @
"\",";
16 constexpr static NSString
* CreatedTimeTag
= @
"\"createdTime\":\"";
17 constexpr static NSString
* HostIdTag
= @
"\"hostId\":\"";
18 constexpr static NSString
* HostNameTag
= @
"\"hostName\":\"";
19 constexpr static NSString
* HostVersionTag
= @
"\"hostVersion\":\"";
20 constexpr static NSString
* KindTag
= @
"\"kind\":\"";
21 constexpr static NSString
* JabberIdTag
= @
"\"jabberId\":\"";
22 constexpr static NSString
* PublicKeyTag
= @
"\"publicKey\":\"";
23 constexpr static NSString
* StatusTag
= @
"\"status\":\"";
24 constexpr static NSString
* UpdatedTimeTag
= @
"\"updatedTime\":\"";
26 constexpr static NSString
* CreatedTimeTest
= @
"2000-01-01T00:00:01.000Z";
27 constexpr static NSString
* HostIdTest
= @
"Host1";
28 constexpr static NSString
* HostNameTest
= @
"HostName1";
29 constexpr static NSString
* HostVersionTest
= @
"2.22.5.4";
30 constexpr static NSString
* KindTest
= @
"chromoting#host";
31 constexpr static NSString
* JabberIdTest
= @
"JabberingOn";
32 constexpr static NSString
* PublicKeyTest
= @
"AAAAABBBBBZZZZZ";
33 constexpr static NSString
* StatusTest
= @
"TESTING";
34 constexpr static NSString
* UpdatedTimeTest
= @
"2004-01-01T00:00:01.000Z";
36 static NSMutableData
* GetHostList(int numHosts
) {
38 dataWithData
:[GetMultipleHosts(numHosts
)
39 dataUsingEncoding
:NSUTF8StringEncoding
]];
42 static NSMutableData
* GetHostList(NSString
* hostList
) {
44 dataWithData
:[hostList dataUsingEncoding
:NSUTF8StringEncoding
]];
47 static NSString
* GetMultipleHosts(int numHosts
) {
48 NSString
* client
= [NSString
50 @
"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@",
83 NSMutableString
* hostList
= [NSMutableString
85 @
"{\"data\":{\"kind\":\"chromoting#hostList\",\"items\":["];
87 for (int i
= 0; i
< numHosts
; i
++) {
88 [hostList appendString
:client
];
89 if (i
< numHosts
- 1) {
90 [hostList appendString
:@
","]; // common separated
94 [hostList appendString
:@
"]}}"];
96 return [hostList copy
];
100 } // namespace remoting
102 #endif // REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_