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

Side by Side Diff: remoting/ios/host_refresh_test_helper.h

Issue 475333004: Remove old Chromoting iOS client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « remoting/ios/host_refresh.mm ('k') | remoting/ios/host_refresh_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_
6 #define REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_
7
8 #import <Foundation/Foundation.h>
9
10 namespace remoting {
11
12 class HostRefreshTestHelper {
13 public:
14 constexpr static NSString* CloseTag = @"\",";
15
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\":\"";
25
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";
35
36 static NSMutableData* GetHostList(int numHosts) {
37 return [NSMutableData
38 dataWithData:[GetMultipleHosts(numHosts)
39 dataUsingEncoding:NSUTF8StringEncoding]];
40 }
41
42 static NSMutableData* GetHostList(NSString* hostList) {
43 return [NSMutableData
44 dataWithData:[hostList dataUsingEncoding:NSUTF8StringEncoding]];
45 }
46
47 static NSString* GetMultipleHosts(int numHosts) {
48 NSString* client = [NSString
49 stringWithFormat:
50 @"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@",
51 @"{",
52 CreatedTimeTag,
53 CreatedTimeTest,
54 CloseTag,
55 HostIdTag,
56 HostIdTest,
57 CloseTag,
58 HostNameTag,
59 HostNameTest,
60 CloseTag,
61 HostNameTag,
62 HostNameTest,
63 CloseTag,
64 HostVersionTag,
65 HostVersionTest,
66 CloseTag,
67 KindTag,
68 KindTest,
69 CloseTag,
70 JabberIdTag,
71 JabberIdTest,
72 CloseTag,
73 PublicKeyTag,
74 PublicKeyTest,
75 CloseTag,
76 StatusTag,
77 StatusTest,
78 CloseTag,
79 UpdatedTimeTag,
80 UpdatedTimeTest,
81 @"\"}"];
82
83 NSMutableString* hostList = [NSMutableString
84 stringWithString:
85 @"{\"data\":{\"kind\":\"chromoting#hostList\",\"items\":["];
86
87 for (int i = 0; i < numHosts; i++) {
88 [hostList appendString:client];
89 if (i < numHosts - 1) {
90 [hostList appendString:@","]; // common separated
91 }
92 }
93
94 [hostList appendString:@"]}}"];
95
96 return [hostList copy];
97 }
98 };
99
100 } // namespace remoting
101
102 #endif // REMOTING_IOS_HOST_REFRESH_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « remoting/ios/host_refresh.mm ('k') | remoting/ios/host_refresh_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698