| OLD | NEW |
| 1 library googleapis.safebrowsing.v4.test; | 1 library googleapis.safebrowsing.v4.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 checkClientInfo(api.ClientInfo o) { | 85 checkClientInfo(api.ClientInfo o) { |
| 86 buildCounterClientInfo++; | 86 buildCounterClientInfo++; |
| 87 if (buildCounterClientInfo < 3) { | 87 if (buildCounterClientInfo < 3) { |
| 88 unittest.expect(o.clientId, unittest.equals('foo')); | 88 unittest.expect(o.clientId, unittest.equals('foo')); |
| 89 unittest.expect(o.clientVersion, unittest.equals('foo')); | 89 unittest.expect(o.clientVersion, unittest.equals('foo')); |
| 90 } | 90 } |
| 91 buildCounterClientInfo--; | 91 buildCounterClientInfo--; |
| 92 } | 92 } |
| 93 | 93 |
| 94 buildUnnamed973() { | 94 buildUnnamed999() { |
| 95 var o = new core.List<core.String>(); | 95 var o = new core.List<core.String>(); |
| 96 o.add("foo"); | 96 o.add("foo"); |
| 97 o.add("foo"); | 97 o.add("foo"); |
| 98 return o; | 98 return o; |
| 99 } | 99 } |
| 100 | 100 |
| 101 checkUnnamed973(core.List<core.String> o) { | 101 checkUnnamed999(core.List<core.String> o) { |
| 102 unittest.expect(o, unittest.hasLength(2)); | 102 unittest.expect(o, unittest.hasLength(2)); |
| 103 unittest.expect(o[0], unittest.equals('foo')); | 103 unittest.expect(o[0], unittest.equals('foo')); |
| 104 unittest.expect(o[1], unittest.equals('foo')); | 104 unittest.expect(o[1], unittest.equals('foo')); |
| 105 } | 105 } |
| 106 | 106 |
| 107 core.int buildCounterConstraints = 0; | 107 core.int buildCounterConstraints = 0; |
| 108 buildConstraints() { | 108 buildConstraints() { |
| 109 var o = new api.Constraints(); | 109 var o = new api.Constraints(); |
| 110 buildCounterConstraints++; | 110 buildCounterConstraints++; |
| 111 if (buildCounterConstraints < 3) { | 111 if (buildCounterConstraints < 3) { |
| 112 o.maxDatabaseEntries = 42; | 112 o.maxDatabaseEntries = 42; |
| 113 o.maxUpdateEntries = 42; | 113 o.maxUpdateEntries = 42; |
| 114 o.region = "foo"; | 114 o.region = "foo"; |
| 115 o.supportedCompressions = buildUnnamed973(); | 115 o.supportedCompressions = buildUnnamed999(); |
| 116 } | 116 } |
| 117 buildCounterConstraints--; | 117 buildCounterConstraints--; |
| 118 return o; | 118 return o; |
| 119 } | 119 } |
| 120 | 120 |
| 121 checkConstraints(api.Constraints o) { | 121 checkConstraints(api.Constraints o) { |
| 122 buildCounterConstraints++; | 122 buildCounterConstraints++; |
| 123 if (buildCounterConstraints < 3) { | 123 if (buildCounterConstraints < 3) { |
| 124 unittest.expect(o.maxDatabaseEntries, unittest.equals(42)); | 124 unittest.expect(o.maxDatabaseEntries, unittest.equals(42)); |
| 125 unittest.expect(o.maxUpdateEntries, unittest.equals(42)); | 125 unittest.expect(o.maxUpdateEntries, unittest.equals(42)); |
| 126 unittest.expect(o.region, unittest.equals('foo')); | 126 unittest.expect(o.region, unittest.equals('foo')); |
| 127 checkUnnamed973(o.supportedCompressions); | 127 checkUnnamed999(o.supportedCompressions); |
| 128 } | 128 } |
| 129 buildCounterConstraints--; | 129 buildCounterConstraints--; |
| 130 } | 130 } |
| 131 | 131 |
| 132 buildUnnamed974() { | 132 buildUnnamed1000() { |
| 133 var o = new core.List<api.ListUpdateRequest>(); | 133 var o = new core.List<api.ListUpdateRequest>(); |
| 134 o.add(buildListUpdateRequest()); | 134 o.add(buildListUpdateRequest()); |
| 135 o.add(buildListUpdateRequest()); | 135 o.add(buildListUpdateRequest()); |
| 136 return o; | 136 return o; |
| 137 } | 137 } |
| 138 | 138 |
| 139 checkUnnamed974(core.List<api.ListUpdateRequest> o) { | 139 checkUnnamed1000(core.List<api.ListUpdateRequest> o) { |
| 140 unittest.expect(o, unittest.hasLength(2)); | 140 unittest.expect(o, unittest.hasLength(2)); |
| 141 checkListUpdateRequest(o[0]); | 141 checkListUpdateRequest(o[0]); |
| 142 checkListUpdateRequest(o[1]); | 142 checkListUpdateRequest(o[1]); |
| 143 } | 143 } |
| 144 | 144 |
| 145 core.int buildCounterFetchThreatListUpdatesRequest = 0; | 145 core.int buildCounterFetchThreatListUpdatesRequest = 0; |
| 146 buildFetchThreatListUpdatesRequest() { | 146 buildFetchThreatListUpdatesRequest() { |
| 147 var o = new api.FetchThreatListUpdatesRequest(); | 147 var o = new api.FetchThreatListUpdatesRequest(); |
| 148 buildCounterFetchThreatListUpdatesRequest++; | 148 buildCounterFetchThreatListUpdatesRequest++; |
| 149 if (buildCounterFetchThreatListUpdatesRequest < 3) { | 149 if (buildCounterFetchThreatListUpdatesRequest < 3) { |
| 150 o.client = buildClientInfo(); | 150 o.client = buildClientInfo(); |
| 151 o.listUpdateRequests = buildUnnamed974(); | 151 o.listUpdateRequests = buildUnnamed1000(); |
| 152 } | 152 } |
| 153 buildCounterFetchThreatListUpdatesRequest--; | 153 buildCounterFetchThreatListUpdatesRequest--; |
| 154 return o; | 154 return o; |
| 155 } | 155 } |
| 156 | 156 |
| 157 checkFetchThreatListUpdatesRequest(api.FetchThreatListUpdatesRequest o) { | 157 checkFetchThreatListUpdatesRequest(api.FetchThreatListUpdatesRequest o) { |
| 158 buildCounterFetchThreatListUpdatesRequest++; | 158 buildCounterFetchThreatListUpdatesRequest++; |
| 159 if (buildCounterFetchThreatListUpdatesRequest < 3) { | 159 if (buildCounterFetchThreatListUpdatesRequest < 3) { |
| 160 checkClientInfo(o.client); | 160 checkClientInfo(o.client); |
| 161 checkUnnamed974(o.listUpdateRequests); | 161 checkUnnamed1000(o.listUpdateRequests); |
| 162 } | 162 } |
| 163 buildCounterFetchThreatListUpdatesRequest--; | 163 buildCounterFetchThreatListUpdatesRequest--; |
| 164 } | 164 } |
| 165 | 165 |
| 166 buildUnnamed975() { | 166 buildUnnamed1001() { |
| 167 var o = new core.List<api.ListUpdateResponse>(); | 167 var o = new core.List<api.ListUpdateResponse>(); |
| 168 o.add(buildListUpdateResponse()); | 168 o.add(buildListUpdateResponse()); |
| 169 o.add(buildListUpdateResponse()); | 169 o.add(buildListUpdateResponse()); |
| 170 return o; | 170 return o; |
| 171 } | 171 } |
| 172 | 172 |
| 173 checkUnnamed975(core.List<api.ListUpdateResponse> o) { | 173 checkUnnamed1001(core.List<api.ListUpdateResponse> o) { |
| 174 unittest.expect(o, unittest.hasLength(2)); | 174 unittest.expect(o, unittest.hasLength(2)); |
| 175 checkListUpdateResponse(o[0]); | 175 checkListUpdateResponse(o[0]); |
| 176 checkListUpdateResponse(o[1]); | 176 checkListUpdateResponse(o[1]); |
| 177 } | 177 } |
| 178 | 178 |
| 179 core.int buildCounterFetchThreatListUpdatesResponse = 0; | 179 core.int buildCounterFetchThreatListUpdatesResponse = 0; |
| 180 buildFetchThreatListUpdatesResponse() { | 180 buildFetchThreatListUpdatesResponse() { |
| 181 var o = new api.FetchThreatListUpdatesResponse(); | 181 var o = new api.FetchThreatListUpdatesResponse(); |
| 182 buildCounterFetchThreatListUpdatesResponse++; | 182 buildCounterFetchThreatListUpdatesResponse++; |
| 183 if (buildCounterFetchThreatListUpdatesResponse < 3) { | 183 if (buildCounterFetchThreatListUpdatesResponse < 3) { |
| 184 o.listUpdateResponses = buildUnnamed975(); | 184 o.listUpdateResponses = buildUnnamed1001(); |
| 185 o.minimumWaitDuration = "foo"; | 185 o.minimumWaitDuration = "foo"; |
| 186 } | 186 } |
| 187 buildCounterFetchThreatListUpdatesResponse--; | 187 buildCounterFetchThreatListUpdatesResponse--; |
| 188 return o; | 188 return o; |
| 189 } | 189 } |
| 190 | 190 |
| 191 checkFetchThreatListUpdatesResponse(api.FetchThreatListUpdatesResponse o) { | 191 checkFetchThreatListUpdatesResponse(api.FetchThreatListUpdatesResponse o) { |
| 192 buildCounterFetchThreatListUpdatesResponse++; | 192 buildCounterFetchThreatListUpdatesResponse++; |
| 193 if (buildCounterFetchThreatListUpdatesResponse < 3) { | 193 if (buildCounterFetchThreatListUpdatesResponse < 3) { |
| 194 checkUnnamed975(o.listUpdateResponses); | 194 checkUnnamed1001(o.listUpdateResponses); |
| 195 unittest.expect(o.minimumWaitDuration, unittest.equals('foo')); | 195 unittest.expect(o.minimumWaitDuration, unittest.equals('foo')); |
| 196 } | 196 } |
| 197 buildCounterFetchThreatListUpdatesResponse--; | 197 buildCounterFetchThreatListUpdatesResponse--; |
| 198 } | 198 } |
| 199 | 199 |
| 200 buildUnnamed976() { | 200 buildUnnamed1002() { |
| 201 var o = new core.List<core.String>(); | 201 var o = new core.List<core.String>(); |
| 202 o.add("foo"); | 202 o.add("foo"); |
| 203 o.add("foo"); | 203 o.add("foo"); |
| 204 return o; | 204 return o; |
| 205 } | 205 } |
| 206 | 206 |
| 207 checkUnnamed976(core.List<core.String> o) { | 207 checkUnnamed1002(core.List<core.String> o) { |
| 208 unittest.expect(o, unittest.hasLength(2)); | 208 unittest.expect(o, unittest.hasLength(2)); |
| 209 unittest.expect(o[0], unittest.equals('foo')); | 209 unittest.expect(o[0], unittest.equals('foo')); |
| 210 unittest.expect(o[1], unittest.equals('foo')); | 210 unittest.expect(o[1], unittest.equals('foo')); |
| 211 } | 211 } |
| 212 | 212 |
| 213 core.int buildCounterFindFullHashesRequest = 0; | 213 core.int buildCounterFindFullHashesRequest = 0; |
| 214 buildFindFullHashesRequest() { | 214 buildFindFullHashesRequest() { |
| 215 var o = new api.FindFullHashesRequest(); | 215 var o = new api.FindFullHashesRequest(); |
| 216 buildCounterFindFullHashesRequest++; | 216 buildCounterFindFullHashesRequest++; |
| 217 if (buildCounterFindFullHashesRequest < 3) { | 217 if (buildCounterFindFullHashesRequest < 3) { |
| 218 o.apiClient = buildClientInfo(); |
| 218 o.client = buildClientInfo(); | 219 o.client = buildClientInfo(); |
| 219 o.clientStates = buildUnnamed976(); | 220 o.clientStates = buildUnnamed1002(); |
| 220 o.threatInfo = buildThreatInfo(); | 221 o.threatInfo = buildThreatInfo(); |
| 221 } | 222 } |
| 222 buildCounterFindFullHashesRequest--; | 223 buildCounterFindFullHashesRequest--; |
| 223 return o; | 224 return o; |
| 224 } | 225 } |
| 225 | 226 |
| 226 checkFindFullHashesRequest(api.FindFullHashesRequest o) { | 227 checkFindFullHashesRequest(api.FindFullHashesRequest o) { |
| 227 buildCounterFindFullHashesRequest++; | 228 buildCounterFindFullHashesRequest++; |
| 228 if (buildCounterFindFullHashesRequest < 3) { | 229 if (buildCounterFindFullHashesRequest < 3) { |
| 230 checkClientInfo(o.apiClient); |
| 229 checkClientInfo(o.client); | 231 checkClientInfo(o.client); |
| 230 checkUnnamed976(o.clientStates); | 232 checkUnnamed1002(o.clientStates); |
| 231 checkThreatInfo(o.threatInfo); | 233 checkThreatInfo(o.threatInfo); |
| 232 } | 234 } |
| 233 buildCounterFindFullHashesRequest--; | 235 buildCounterFindFullHashesRequest--; |
| 234 } | 236 } |
| 235 | 237 |
| 236 buildUnnamed977() { | 238 buildUnnamed1003() { |
| 237 var o = new core.List<api.ThreatMatch>(); | 239 var o = new core.List<api.ThreatMatch>(); |
| 238 o.add(buildThreatMatch()); | 240 o.add(buildThreatMatch()); |
| 239 o.add(buildThreatMatch()); | 241 o.add(buildThreatMatch()); |
| 240 return o; | 242 return o; |
| 241 } | 243 } |
| 242 | 244 |
| 243 checkUnnamed977(core.List<api.ThreatMatch> o) { | 245 checkUnnamed1003(core.List<api.ThreatMatch> o) { |
| 244 unittest.expect(o, unittest.hasLength(2)); | 246 unittest.expect(o, unittest.hasLength(2)); |
| 245 checkThreatMatch(o[0]); | 247 checkThreatMatch(o[0]); |
| 246 checkThreatMatch(o[1]); | 248 checkThreatMatch(o[1]); |
| 247 } | 249 } |
| 248 | 250 |
| 249 core.int buildCounterFindFullHashesResponse = 0; | 251 core.int buildCounterFindFullHashesResponse = 0; |
| 250 buildFindFullHashesResponse() { | 252 buildFindFullHashesResponse() { |
| 251 var o = new api.FindFullHashesResponse(); | 253 var o = new api.FindFullHashesResponse(); |
| 252 buildCounterFindFullHashesResponse++; | 254 buildCounterFindFullHashesResponse++; |
| 253 if (buildCounterFindFullHashesResponse < 3) { | 255 if (buildCounterFindFullHashesResponse < 3) { |
| 254 o.matches = buildUnnamed977(); | 256 o.matches = buildUnnamed1003(); |
| 255 o.minimumWaitDuration = "foo"; | 257 o.minimumWaitDuration = "foo"; |
| 256 o.negativeCacheDuration = "foo"; | 258 o.negativeCacheDuration = "foo"; |
| 257 } | 259 } |
| 258 buildCounterFindFullHashesResponse--; | 260 buildCounterFindFullHashesResponse--; |
| 259 return o; | 261 return o; |
| 260 } | 262 } |
| 261 | 263 |
| 262 checkFindFullHashesResponse(api.FindFullHashesResponse o) { | 264 checkFindFullHashesResponse(api.FindFullHashesResponse o) { |
| 263 buildCounterFindFullHashesResponse++; | 265 buildCounterFindFullHashesResponse++; |
| 264 if (buildCounterFindFullHashesResponse < 3) { | 266 if (buildCounterFindFullHashesResponse < 3) { |
| 265 checkUnnamed977(o.matches); | 267 checkUnnamed1003(o.matches); |
| 266 unittest.expect(o.minimumWaitDuration, unittest.equals('foo')); | 268 unittest.expect(o.minimumWaitDuration, unittest.equals('foo')); |
| 267 unittest.expect(o.negativeCacheDuration, unittest.equals('foo')); | 269 unittest.expect(o.negativeCacheDuration, unittest.equals('foo')); |
| 268 } | 270 } |
| 269 buildCounterFindFullHashesResponse--; | 271 buildCounterFindFullHashesResponse--; |
| 270 } | 272 } |
| 271 | 273 |
| 272 core.int buildCounterFindThreatMatchesRequest = 0; | 274 core.int buildCounterFindThreatMatchesRequest = 0; |
| 273 buildFindThreatMatchesRequest() { | 275 buildFindThreatMatchesRequest() { |
| 274 var o = new api.FindThreatMatchesRequest(); | 276 var o = new api.FindThreatMatchesRequest(); |
| 275 buildCounterFindThreatMatchesRequest++; | 277 buildCounterFindThreatMatchesRequest++; |
| 276 if (buildCounterFindThreatMatchesRequest < 3) { | 278 if (buildCounterFindThreatMatchesRequest < 3) { |
| 277 o.client = buildClientInfo(); | 279 o.client = buildClientInfo(); |
| 278 o.threatInfo = buildThreatInfo(); | 280 o.threatInfo = buildThreatInfo(); |
| 279 } | 281 } |
| 280 buildCounterFindThreatMatchesRequest--; | 282 buildCounterFindThreatMatchesRequest--; |
| 281 return o; | 283 return o; |
| 282 } | 284 } |
| 283 | 285 |
| 284 checkFindThreatMatchesRequest(api.FindThreatMatchesRequest o) { | 286 checkFindThreatMatchesRequest(api.FindThreatMatchesRequest o) { |
| 285 buildCounterFindThreatMatchesRequest++; | 287 buildCounterFindThreatMatchesRequest++; |
| 286 if (buildCounterFindThreatMatchesRequest < 3) { | 288 if (buildCounterFindThreatMatchesRequest < 3) { |
| 287 checkClientInfo(o.client); | 289 checkClientInfo(o.client); |
| 288 checkThreatInfo(o.threatInfo); | 290 checkThreatInfo(o.threatInfo); |
| 289 } | 291 } |
| 290 buildCounterFindThreatMatchesRequest--; | 292 buildCounterFindThreatMatchesRequest--; |
| 291 } | 293 } |
| 292 | 294 |
| 293 buildUnnamed978() { | 295 buildUnnamed1004() { |
| 294 var o = new core.List<api.ThreatMatch>(); | 296 var o = new core.List<api.ThreatMatch>(); |
| 295 o.add(buildThreatMatch()); | 297 o.add(buildThreatMatch()); |
| 296 o.add(buildThreatMatch()); | 298 o.add(buildThreatMatch()); |
| 297 return o; | 299 return o; |
| 298 } | 300 } |
| 299 | 301 |
| 300 checkUnnamed978(core.List<api.ThreatMatch> o) { | 302 checkUnnamed1004(core.List<api.ThreatMatch> o) { |
| 301 unittest.expect(o, unittest.hasLength(2)); | 303 unittest.expect(o, unittest.hasLength(2)); |
| 302 checkThreatMatch(o[0]); | 304 checkThreatMatch(o[0]); |
| 303 checkThreatMatch(o[1]); | 305 checkThreatMatch(o[1]); |
| 304 } | 306 } |
| 305 | 307 |
| 306 core.int buildCounterFindThreatMatchesResponse = 0; | 308 core.int buildCounterFindThreatMatchesResponse = 0; |
| 307 buildFindThreatMatchesResponse() { | 309 buildFindThreatMatchesResponse() { |
| 308 var o = new api.FindThreatMatchesResponse(); | 310 var o = new api.FindThreatMatchesResponse(); |
| 309 buildCounterFindThreatMatchesResponse++; | 311 buildCounterFindThreatMatchesResponse++; |
| 310 if (buildCounterFindThreatMatchesResponse < 3) { | 312 if (buildCounterFindThreatMatchesResponse < 3) { |
| 311 o.matches = buildUnnamed978(); | 313 o.matches = buildUnnamed1004(); |
| 312 } | 314 } |
| 313 buildCounterFindThreatMatchesResponse--; | 315 buildCounterFindThreatMatchesResponse--; |
| 314 return o; | 316 return o; |
| 315 } | 317 } |
| 316 | 318 |
| 317 checkFindThreatMatchesResponse(api.FindThreatMatchesResponse o) { | 319 checkFindThreatMatchesResponse(api.FindThreatMatchesResponse o) { |
| 318 buildCounterFindThreatMatchesResponse++; | 320 buildCounterFindThreatMatchesResponse++; |
| 319 if (buildCounterFindThreatMatchesResponse < 3) { | 321 if (buildCounterFindThreatMatchesResponse < 3) { |
| 320 checkUnnamed978(o.matches); | 322 checkUnnamed1004(o.matches); |
| 321 } | 323 } |
| 322 buildCounterFindThreatMatchesResponse--; | 324 buildCounterFindThreatMatchesResponse--; |
| 323 } | 325 } |
| 324 | 326 |
| 325 buildUnnamed979() { | 327 buildUnnamed1005() { |
| 326 var o = new core.List<api.ThreatListDescriptor>(); | 328 var o = new core.List<api.ThreatListDescriptor>(); |
| 327 o.add(buildThreatListDescriptor()); | 329 o.add(buildThreatListDescriptor()); |
| 328 o.add(buildThreatListDescriptor()); | 330 o.add(buildThreatListDescriptor()); |
| 329 return o; | 331 return o; |
| 330 } | 332 } |
| 331 | 333 |
| 332 checkUnnamed979(core.List<api.ThreatListDescriptor> o) { | 334 checkUnnamed1005(core.List<api.ThreatListDescriptor> o) { |
| 333 unittest.expect(o, unittest.hasLength(2)); | 335 unittest.expect(o, unittest.hasLength(2)); |
| 334 checkThreatListDescriptor(o[0]); | 336 checkThreatListDescriptor(o[0]); |
| 335 checkThreatListDescriptor(o[1]); | 337 checkThreatListDescriptor(o[1]); |
| 336 } | 338 } |
| 337 | 339 |
| 338 core.int buildCounterListThreatListsResponse = 0; | 340 core.int buildCounterListThreatListsResponse = 0; |
| 339 buildListThreatListsResponse() { | 341 buildListThreatListsResponse() { |
| 340 var o = new api.ListThreatListsResponse(); | 342 var o = new api.ListThreatListsResponse(); |
| 341 buildCounterListThreatListsResponse++; | 343 buildCounterListThreatListsResponse++; |
| 342 if (buildCounterListThreatListsResponse < 3) { | 344 if (buildCounterListThreatListsResponse < 3) { |
| 343 o.threatLists = buildUnnamed979(); | 345 o.threatLists = buildUnnamed1005(); |
| 344 } | 346 } |
| 345 buildCounterListThreatListsResponse--; | 347 buildCounterListThreatListsResponse--; |
| 346 return o; | 348 return o; |
| 347 } | 349 } |
| 348 | 350 |
| 349 checkListThreatListsResponse(api.ListThreatListsResponse o) { | 351 checkListThreatListsResponse(api.ListThreatListsResponse o) { |
| 350 buildCounterListThreatListsResponse++; | 352 buildCounterListThreatListsResponse++; |
| 351 if (buildCounterListThreatListsResponse < 3) { | 353 if (buildCounterListThreatListsResponse < 3) { |
| 352 checkUnnamed979(o.threatLists); | 354 checkUnnamed1005(o.threatLists); |
| 353 } | 355 } |
| 354 buildCounterListThreatListsResponse--; | 356 buildCounterListThreatListsResponse--; |
| 355 } | 357 } |
| 356 | 358 |
| 357 core.int buildCounterListUpdateRequest = 0; | 359 core.int buildCounterListUpdateRequest = 0; |
| 358 buildListUpdateRequest() { | 360 buildListUpdateRequest() { |
| 359 var o = new api.ListUpdateRequest(); | 361 var o = new api.ListUpdateRequest(); |
| 360 buildCounterListUpdateRequest++; | 362 buildCounterListUpdateRequest++; |
| 361 if (buildCounterListUpdateRequest < 3) { | 363 if (buildCounterListUpdateRequest < 3) { |
| 362 o.constraints = buildConstraints(); | 364 o.constraints = buildConstraints(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 374 if (buildCounterListUpdateRequest < 3) { | 376 if (buildCounterListUpdateRequest < 3) { |
| 375 checkConstraints(o.constraints); | 377 checkConstraints(o.constraints); |
| 376 unittest.expect(o.platformType, unittest.equals('foo')); | 378 unittest.expect(o.platformType, unittest.equals('foo')); |
| 377 unittest.expect(o.state, unittest.equals('foo')); | 379 unittest.expect(o.state, unittest.equals('foo')); |
| 378 unittest.expect(o.threatEntryType, unittest.equals('foo')); | 380 unittest.expect(o.threatEntryType, unittest.equals('foo')); |
| 379 unittest.expect(o.threatType, unittest.equals('foo')); | 381 unittest.expect(o.threatType, unittest.equals('foo')); |
| 380 } | 382 } |
| 381 buildCounterListUpdateRequest--; | 383 buildCounterListUpdateRequest--; |
| 382 } | 384 } |
| 383 | 385 |
| 384 buildUnnamed980() { | 386 buildUnnamed1006() { |
| 385 var o = new core.List<api.ThreatEntrySet>(); | 387 var o = new core.List<api.ThreatEntrySet>(); |
| 386 o.add(buildThreatEntrySet()); | 388 o.add(buildThreatEntrySet()); |
| 387 o.add(buildThreatEntrySet()); | 389 o.add(buildThreatEntrySet()); |
| 388 return o; | 390 return o; |
| 389 } | 391 } |
| 390 | 392 |
| 391 checkUnnamed980(core.List<api.ThreatEntrySet> o) { | 393 checkUnnamed1006(core.List<api.ThreatEntrySet> o) { |
| 392 unittest.expect(o, unittest.hasLength(2)); | 394 unittest.expect(o, unittest.hasLength(2)); |
| 393 checkThreatEntrySet(o[0]); | 395 checkThreatEntrySet(o[0]); |
| 394 checkThreatEntrySet(o[1]); | 396 checkThreatEntrySet(o[1]); |
| 395 } | 397 } |
| 396 | 398 |
| 397 buildUnnamed981() { | 399 buildUnnamed1007() { |
| 398 var o = new core.List<api.ThreatEntrySet>(); | 400 var o = new core.List<api.ThreatEntrySet>(); |
| 399 o.add(buildThreatEntrySet()); | 401 o.add(buildThreatEntrySet()); |
| 400 o.add(buildThreatEntrySet()); | 402 o.add(buildThreatEntrySet()); |
| 401 return o; | 403 return o; |
| 402 } | 404 } |
| 403 | 405 |
| 404 checkUnnamed981(core.List<api.ThreatEntrySet> o) { | 406 checkUnnamed1007(core.List<api.ThreatEntrySet> o) { |
| 405 unittest.expect(o, unittest.hasLength(2)); | 407 unittest.expect(o, unittest.hasLength(2)); |
| 406 checkThreatEntrySet(o[0]); | 408 checkThreatEntrySet(o[0]); |
| 407 checkThreatEntrySet(o[1]); | 409 checkThreatEntrySet(o[1]); |
| 408 } | 410 } |
| 409 | 411 |
| 410 core.int buildCounterListUpdateResponse = 0; | 412 core.int buildCounterListUpdateResponse = 0; |
| 411 buildListUpdateResponse() { | 413 buildListUpdateResponse() { |
| 412 var o = new api.ListUpdateResponse(); | 414 var o = new api.ListUpdateResponse(); |
| 413 buildCounterListUpdateResponse++; | 415 buildCounterListUpdateResponse++; |
| 414 if (buildCounterListUpdateResponse < 3) { | 416 if (buildCounterListUpdateResponse < 3) { |
| 415 o.additions = buildUnnamed980(); | 417 o.additions = buildUnnamed1006(); |
| 416 o.checksum = buildChecksum(); | 418 o.checksum = buildChecksum(); |
| 417 o.newClientState = "foo"; | 419 o.newClientState = "foo"; |
| 418 o.platformType = "foo"; | 420 o.platformType = "foo"; |
| 419 o.removals = buildUnnamed981(); | 421 o.removals = buildUnnamed1007(); |
| 420 o.responseType = "foo"; | 422 o.responseType = "foo"; |
| 421 o.threatEntryType = "foo"; | 423 o.threatEntryType = "foo"; |
| 422 o.threatType = "foo"; | 424 o.threatType = "foo"; |
| 423 } | 425 } |
| 424 buildCounterListUpdateResponse--; | 426 buildCounterListUpdateResponse--; |
| 425 return o; | 427 return o; |
| 426 } | 428 } |
| 427 | 429 |
| 428 checkListUpdateResponse(api.ListUpdateResponse o) { | 430 checkListUpdateResponse(api.ListUpdateResponse o) { |
| 429 buildCounterListUpdateResponse++; | 431 buildCounterListUpdateResponse++; |
| 430 if (buildCounterListUpdateResponse < 3) { | 432 if (buildCounterListUpdateResponse < 3) { |
| 431 checkUnnamed980(o.additions); | 433 checkUnnamed1006(o.additions); |
| 432 checkChecksum(o.checksum); | 434 checkChecksum(o.checksum); |
| 433 unittest.expect(o.newClientState, unittest.equals('foo')); | 435 unittest.expect(o.newClientState, unittest.equals('foo')); |
| 434 unittest.expect(o.platformType, unittest.equals('foo')); | 436 unittest.expect(o.platformType, unittest.equals('foo')); |
| 435 checkUnnamed981(o.removals); | 437 checkUnnamed1007(o.removals); |
| 436 unittest.expect(o.responseType, unittest.equals('foo')); | 438 unittest.expect(o.responseType, unittest.equals('foo')); |
| 437 unittest.expect(o.threatEntryType, unittest.equals('foo')); | 439 unittest.expect(o.threatEntryType, unittest.equals('foo')); |
| 438 unittest.expect(o.threatType, unittest.equals('foo')); | 440 unittest.expect(o.threatType, unittest.equals('foo')); |
| 439 } | 441 } |
| 440 buildCounterListUpdateResponse--; | 442 buildCounterListUpdateResponse--; |
| 441 } | 443 } |
| 442 | 444 |
| 443 core.int buildCounterMetadataEntry = 0; | 445 core.int buildCounterMetadataEntry = 0; |
| 444 buildMetadataEntry() { | 446 buildMetadataEntry() { |
| 445 var o = new api.MetadataEntry(); | 447 var o = new api.MetadataEntry(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 475 | 477 |
| 476 checkRawHashes(api.RawHashes o) { | 478 checkRawHashes(api.RawHashes o) { |
| 477 buildCounterRawHashes++; | 479 buildCounterRawHashes++; |
| 478 if (buildCounterRawHashes < 3) { | 480 if (buildCounterRawHashes < 3) { |
| 479 unittest.expect(o.prefixSize, unittest.equals(42)); | 481 unittest.expect(o.prefixSize, unittest.equals(42)); |
| 480 unittest.expect(o.rawHashes, unittest.equals('foo')); | 482 unittest.expect(o.rawHashes, unittest.equals('foo')); |
| 481 } | 483 } |
| 482 buildCounterRawHashes--; | 484 buildCounterRawHashes--; |
| 483 } | 485 } |
| 484 | 486 |
| 485 buildUnnamed982() { | 487 buildUnnamed1008() { |
| 486 var o = new core.List<core.int>(); | 488 var o = new core.List<core.int>(); |
| 487 o.add(42); | 489 o.add(42); |
| 488 o.add(42); | 490 o.add(42); |
| 489 return o; | 491 return o; |
| 490 } | 492 } |
| 491 | 493 |
| 492 checkUnnamed982(core.List<core.int> o) { | 494 checkUnnamed1008(core.List<core.int> o) { |
| 493 unittest.expect(o, unittest.hasLength(2)); | 495 unittest.expect(o, unittest.hasLength(2)); |
| 494 unittest.expect(o[0], unittest.equals(42)); | 496 unittest.expect(o[0], unittest.equals(42)); |
| 495 unittest.expect(o[1], unittest.equals(42)); | 497 unittest.expect(o[1], unittest.equals(42)); |
| 496 } | 498 } |
| 497 | 499 |
| 498 core.int buildCounterRawIndices = 0; | 500 core.int buildCounterRawIndices = 0; |
| 499 buildRawIndices() { | 501 buildRawIndices() { |
| 500 var o = new api.RawIndices(); | 502 var o = new api.RawIndices(); |
| 501 buildCounterRawIndices++; | 503 buildCounterRawIndices++; |
| 502 if (buildCounterRawIndices < 3) { | 504 if (buildCounterRawIndices < 3) { |
| 503 o.indices = buildUnnamed982(); | 505 o.indices = buildUnnamed1008(); |
| 504 } | 506 } |
| 505 buildCounterRawIndices--; | 507 buildCounterRawIndices--; |
| 506 return o; | 508 return o; |
| 507 } | 509 } |
| 508 | 510 |
| 509 checkRawIndices(api.RawIndices o) { | 511 checkRawIndices(api.RawIndices o) { |
| 510 buildCounterRawIndices++; | 512 buildCounterRawIndices++; |
| 511 if (buildCounterRawIndices < 3) { | 513 if (buildCounterRawIndices < 3) { |
| 512 checkUnnamed982(o.indices); | 514 checkUnnamed1008(o.indices); |
| 513 } | 515 } |
| 514 buildCounterRawIndices--; | 516 buildCounterRawIndices--; |
| 515 } | 517 } |
| 516 | 518 |
| 517 core.int buildCounterRiceDeltaEncoding = 0; | 519 core.int buildCounterRiceDeltaEncoding = 0; |
| 518 buildRiceDeltaEncoding() { | 520 buildRiceDeltaEncoding() { |
| 519 var o = new api.RiceDeltaEncoding(); | 521 var o = new api.RiceDeltaEncoding(); |
| 520 buildCounterRiceDeltaEncoding++; | 522 buildCounterRiceDeltaEncoding++; |
| 521 if (buildCounterRiceDeltaEncoding < 3) { | 523 if (buildCounterRiceDeltaEncoding < 3) { |
| 522 o.encodedData = "foo"; | 524 o.encodedData = "foo"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 checkThreatEntry(api.ThreatEntry o) { | 557 checkThreatEntry(api.ThreatEntry o) { |
| 556 buildCounterThreatEntry++; | 558 buildCounterThreatEntry++; |
| 557 if (buildCounterThreatEntry < 3) { | 559 if (buildCounterThreatEntry < 3) { |
| 558 unittest.expect(o.digest, unittest.equals('foo')); | 560 unittest.expect(o.digest, unittest.equals('foo')); |
| 559 unittest.expect(o.hash, unittest.equals('foo')); | 561 unittest.expect(o.hash, unittest.equals('foo')); |
| 560 unittest.expect(o.url, unittest.equals('foo')); | 562 unittest.expect(o.url, unittest.equals('foo')); |
| 561 } | 563 } |
| 562 buildCounterThreatEntry--; | 564 buildCounterThreatEntry--; |
| 563 } | 565 } |
| 564 | 566 |
| 565 buildUnnamed983() { | 567 buildUnnamed1009() { |
| 566 var o = new core.List<api.MetadataEntry>(); | 568 var o = new core.List<api.MetadataEntry>(); |
| 567 o.add(buildMetadataEntry()); | 569 o.add(buildMetadataEntry()); |
| 568 o.add(buildMetadataEntry()); | 570 o.add(buildMetadataEntry()); |
| 569 return o; | 571 return o; |
| 570 } | 572 } |
| 571 | 573 |
| 572 checkUnnamed983(core.List<api.MetadataEntry> o) { | 574 checkUnnamed1009(core.List<api.MetadataEntry> o) { |
| 573 unittest.expect(o, unittest.hasLength(2)); | 575 unittest.expect(o, unittest.hasLength(2)); |
| 574 checkMetadataEntry(o[0]); | 576 checkMetadataEntry(o[0]); |
| 575 checkMetadataEntry(o[1]); | 577 checkMetadataEntry(o[1]); |
| 576 } | 578 } |
| 577 | 579 |
| 578 core.int buildCounterThreatEntryMetadata = 0; | 580 core.int buildCounterThreatEntryMetadata = 0; |
| 579 buildThreatEntryMetadata() { | 581 buildThreatEntryMetadata() { |
| 580 var o = new api.ThreatEntryMetadata(); | 582 var o = new api.ThreatEntryMetadata(); |
| 581 buildCounterThreatEntryMetadata++; | 583 buildCounterThreatEntryMetadata++; |
| 582 if (buildCounterThreatEntryMetadata < 3) { | 584 if (buildCounterThreatEntryMetadata < 3) { |
| 583 o.entries = buildUnnamed983(); | 585 o.entries = buildUnnamed1009(); |
| 584 } | 586 } |
| 585 buildCounterThreatEntryMetadata--; | 587 buildCounterThreatEntryMetadata--; |
| 586 return o; | 588 return o; |
| 587 } | 589 } |
| 588 | 590 |
| 589 checkThreatEntryMetadata(api.ThreatEntryMetadata o) { | 591 checkThreatEntryMetadata(api.ThreatEntryMetadata o) { |
| 590 buildCounterThreatEntryMetadata++; | 592 buildCounterThreatEntryMetadata++; |
| 591 if (buildCounterThreatEntryMetadata < 3) { | 593 if (buildCounterThreatEntryMetadata < 3) { |
| 592 checkUnnamed983(o.entries); | 594 checkUnnamed1009(o.entries); |
| 593 } | 595 } |
| 594 buildCounterThreatEntryMetadata--; | 596 buildCounterThreatEntryMetadata--; |
| 595 } | 597 } |
| 596 | 598 |
| 597 core.int buildCounterThreatEntrySet = 0; | 599 core.int buildCounterThreatEntrySet = 0; |
| 598 buildThreatEntrySet() { | 600 buildThreatEntrySet() { |
| 599 var o = new api.ThreatEntrySet(); | 601 var o = new api.ThreatEntrySet(); |
| 600 buildCounterThreatEntrySet++; | 602 buildCounterThreatEntrySet++; |
| 601 if (buildCounterThreatEntrySet < 3) { | 603 if (buildCounterThreatEntrySet < 3) { |
| 602 o.compressionType = "foo"; | 604 o.compressionType = "foo"; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 614 if (buildCounterThreatEntrySet < 3) { | 616 if (buildCounterThreatEntrySet < 3) { |
| 615 unittest.expect(o.compressionType, unittest.equals('foo')); | 617 unittest.expect(o.compressionType, unittest.equals('foo')); |
| 616 checkRawHashes(o.rawHashes); | 618 checkRawHashes(o.rawHashes); |
| 617 checkRawIndices(o.rawIndices); | 619 checkRawIndices(o.rawIndices); |
| 618 checkRiceDeltaEncoding(o.riceHashes); | 620 checkRiceDeltaEncoding(o.riceHashes); |
| 619 checkRiceDeltaEncoding(o.riceIndices); | 621 checkRiceDeltaEncoding(o.riceIndices); |
| 620 } | 622 } |
| 621 buildCounterThreatEntrySet--; | 623 buildCounterThreatEntrySet--; |
| 622 } | 624 } |
| 623 | 625 |
| 624 buildUnnamed984() { | 626 buildUnnamed1010() { |
| 625 var o = new core.List<core.String>(); | 627 var o = new core.List<core.String>(); |
| 626 o.add("foo"); | 628 o.add("foo"); |
| 627 o.add("foo"); | 629 o.add("foo"); |
| 628 return o; | 630 return o; |
| 629 } | 631 } |
| 630 | 632 |
| 631 checkUnnamed984(core.List<core.String> o) { | 633 checkUnnamed1010(core.List<core.String> o) { |
| 632 unittest.expect(o, unittest.hasLength(2)); | 634 unittest.expect(o, unittest.hasLength(2)); |
| 633 unittest.expect(o[0], unittest.equals('foo')); | 635 unittest.expect(o[0], unittest.equals('foo')); |
| 634 unittest.expect(o[1], unittest.equals('foo')); | 636 unittest.expect(o[1], unittest.equals('foo')); |
| 635 } | 637 } |
| 636 | 638 |
| 637 buildUnnamed985() { | 639 buildUnnamed1011() { |
| 638 var o = new core.List<api.ThreatEntry>(); | 640 var o = new core.List<api.ThreatEntry>(); |
| 639 o.add(buildThreatEntry()); | 641 o.add(buildThreatEntry()); |
| 640 o.add(buildThreatEntry()); | 642 o.add(buildThreatEntry()); |
| 641 return o; | 643 return o; |
| 642 } | 644 } |
| 643 | 645 |
| 644 checkUnnamed985(core.List<api.ThreatEntry> o) { | 646 checkUnnamed1011(core.List<api.ThreatEntry> o) { |
| 645 unittest.expect(o, unittest.hasLength(2)); | 647 unittest.expect(o, unittest.hasLength(2)); |
| 646 checkThreatEntry(o[0]); | 648 checkThreatEntry(o[0]); |
| 647 checkThreatEntry(o[1]); | 649 checkThreatEntry(o[1]); |
| 648 } | 650 } |
| 649 | 651 |
| 650 buildUnnamed986() { | 652 buildUnnamed1012() { |
| 651 var o = new core.List<core.String>(); | 653 var o = new core.List<core.String>(); |
| 652 o.add("foo"); | 654 o.add("foo"); |
| 653 o.add("foo"); | 655 o.add("foo"); |
| 654 return o; | 656 return o; |
| 655 } | 657 } |
| 656 | 658 |
| 657 checkUnnamed986(core.List<core.String> o) { | 659 checkUnnamed1012(core.List<core.String> o) { |
| 658 unittest.expect(o, unittest.hasLength(2)); | 660 unittest.expect(o, unittest.hasLength(2)); |
| 659 unittest.expect(o[0], unittest.equals('foo')); | 661 unittest.expect(o[0], unittest.equals('foo')); |
| 660 unittest.expect(o[1], unittest.equals('foo')); | 662 unittest.expect(o[1], unittest.equals('foo')); |
| 661 } | 663 } |
| 662 | 664 |
| 663 buildUnnamed987() { | 665 buildUnnamed1013() { |
| 664 var o = new core.List<core.String>(); | 666 var o = new core.List<core.String>(); |
| 665 o.add("foo"); | 667 o.add("foo"); |
| 666 o.add("foo"); | 668 o.add("foo"); |
| 667 return o; | 669 return o; |
| 668 } | 670 } |
| 669 | 671 |
| 670 checkUnnamed987(core.List<core.String> o) { | 672 checkUnnamed1013(core.List<core.String> o) { |
| 671 unittest.expect(o, unittest.hasLength(2)); | 673 unittest.expect(o, unittest.hasLength(2)); |
| 672 unittest.expect(o[0], unittest.equals('foo')); | 674 unittest.expect(o[0], unittest.equals('foo')); |
| 673 unittest.expect(o[1], unittest.equals('foo')); | 675 unittest.expect(o[1], unittest.equals('foo')); |
| 674 } | 676 } |
| 675 | 677 |
| 676 core.int buildCounterThreatInfo = 0; | 678 core.int buildCounterThreatInfo = 0; |
| 677 buildThreatInfo() { | 679 buildThreatInfo() { |
| 678 var o = new api.ThreatInfo(); | 680 var o = new api.ThreatInfo(); |
| 679 buildCounterThreatInfo++; | 681 buildCounterThreatInfo++; |
| 680 if (buildCounterThreatInfo < 3) { | 682 if (buildCounterThreatInfo < 3) { |
| 681 o.platformTypes = buildUnnamed984(); | 683 o.platformTypes = buildUnnamed1010(); |
| 682 o.threatEntries = buildUnnamed985(); | 684 o.threatEntries = buildUnnamed1011(); |
| 683 o.threatEntryTypes = buildUnnamed986(); | 685 o.threatEntryTypes = buildUnnamed1012(); |
| 684 o.threatTypes = buildUnnamed987(); | 686 o.threatTypes = buildUnnamed1013(); |
| 685 } | 687 } |
| 686 buildCounterThreatInfo--; | 688 buildCounterThreatInfo--; |
| 687 return o; | 689 return o; |
| 688 } | 690 } |
| 689 | 691 |
| 690 checkThreatInfo(api.ThreatInfo o) { | 692 checkThreatInfo(api.ThreatInfo o) { |
| 691 buildCounterThreatInfo++; | 693 buildCounterThreatInfo++; |
| 692 if (buildCounterThreatInfo < 3) { | 694 if (buildCounterThreatInfo < 3) { |
| 693 checkUnnamed984(o.platformTypes); | 695 checkUnnamed1010(o.platformTypes); |
| 694 checkUnnamed985(o.threatEntries); | 696 checkUnnamed1011(o.threatEntries); |
| 695 checkUnnamed986(o.threatEntryTypes); | 697 checkUnnamed1012(o.threatEntryTypes); |
| 696 checkUnnamed987(o.threatTypes); | 698 checkUnnamed1013(o.threatTypes); |
| 697 } | 699 } |
| 698 buildCounterThreatInfo--; | 700 buildCounterThreatInfo--; |
| 699 } | 701 } |
| 700 | 702 |
| 701 core.int buildCounterThreatListDescriptor = 0; | 703 core.int buildCounterThreatListDescriptor = 0; |
| 702 buildThreatListDescriptor() { | 704 buildThreatListDescriptor() { |
| 703 var o = new api.ThreatListDescriptor(); | 705 var o = new api.ThreatListDescriptor(); |
| 704 buildCounterThreatListDescriptor++; | 706 buildCounterThreatListDescriptor++; |
| 705 if (buildCounterThreatListDescriptor < 3) { | 707 if (buildCounterThreatListDescriptor < 3) { |
| 706 o.platformType = "foo"; | 708 o.platformType = "foo"; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 | 945 |
| 944 unittest.group("obj-schema-ThreatMatch", () { | 946 unittest.group("obj-schema-ThreatMatch", () { |
| 945 unittest.test("to-json--from-json", () { | 947 unittest.test("to-json--from-json", () { |
| 946 var o = buildThreatMatch(); | 948 var o = buildThreatMatch(); |
| 947 var od = new api.ThreatMatch.fromJson(o.toJson()); | 949 var od = new api.ThreatMatch.fromJson(o.toJson()); |
| 948 checkThreatMatch(od); | 950 checkThreatMatch(od); |
| 949 }); | 951 }); |
| 950 }); | 952 }); |
| 951 | 953 |
| 952 | 954 |
| 955 unittest.group("resource-EncodedFullHashesResourceApi", () { |
| 956 unittest.test("method--get", () { |
| 957 |
| 958 var mock = new HttpServerMock(); |
| 959 api.EncodedFullHashesResourceApi res = new api.SafebrowsingApi(mock).encod
edFullHashes; |
| 960 var arg_encodedRequest = "foo"; |
| 961 var arg_clientId = "foo"; |
| 962 var arg_clientVersion = "foo"; |
| 963 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 964 var path = (req.url).path; |
| 965 var pathOffset = 0; |
| 966 var index; |
| 967 var subPart; |
| 968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 969 pathOffset += 1; |
| 970 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("v4/encodedFullHashes/")); |
| 971 pathOffset += 21; |
| 972 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 973 pathOffset = path.length; |
| 974 unittest.expect(subPart, unittest.equals("$arg_encodedRequest")); |
| 975 |
| 976 var query = (req.url).query; |
| 977 var queryOffset = 0; |
| 978 var queryMap = {}; |
| 979 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 980 parseBool(n) { |
| 981 if (n == "true") return true; |
| 982 if (n == "false") return false; |
| 983 if (n == null) return null; |
| 984 throw new core.ArgumentError("Invalid boolean: $n"); |
| 985 } |
| 986 if (query.length > 0) { |
| 987 for (var part in query.split("&")) { |
| 988 var keyvalue = part.split("="); |
| 989 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 990 } |
| 991 } |
| 992 unittest.expect(queryMap["clientId"].first, unittest.equals(arg_clientId
)); |
| 993 unittest.expect(queryMap["clientVersion"].first, unittest.equals(arg_cli
entVersion)); |
| 994 |
| 995 |
| 996 var h = { |
| 997 "content-type" : "application/json; charset=utf-8", |
| 998 }; |
| 999 var resp = convert.JSON.encode(buildFindFullHashesResponse()); |
| 1000 return new async.Future.value(stringResponse(200, h, resp)); |
| 1001 }), true); |
| 1002 res.get(arg_encodedRequest, clientId: arg_clientId, clientVersion: arg_cli
entVersion).then(unittest.expectAsync(((api.FindFullHashesResponse response) { |
| 1003 checkFindFullHashesResponse(response); |
| 1004 }))); |
| 1005 }); |
| 1006 |
| 1007 }); |
| 1008 |
| 1009 |
| 1010 unittest.group("resource-EncodedUpdatesResourceApi", () { |
| 1011 unittest.test("method--get", () { |
| 1012 |
| 1013 var mock = new HttpServerMock(); |
| 1014 api.EncodedUpdatesResourceApi res = new api.SafebrowsingApi(mock).encodedU
pdates; |
| 1015 var arg_encodedRequest = "foo"; |
| 1016 var arg_clientVersion = "foo"; |
| 1017 var arg_clientId = "foo"; |
| 1018 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1019 var path = (req.url).path; |
| 1020 var pathOffset = 0; |
| 1021 var index; |
| 1022 var subPart; |
| 1023 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1024 pathOffset += 1; |
| 1025 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("v4/encodedUpdates/")); |
| 1026 pathOffset += 18; |
| 1027 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1028 pathOffset = path.length; |
| 1029 unittest.expect(subPart, unittest.equals("$arg_encodedRequest")); |
| 1030 |
| 1031 var query = (req.url).query; |
| 1032 var queryOffset = 0; |
| 1033 var queryMap = {}; |
| 1034 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1035 parseBool(n) { |
| 1036 if (n == "true") return true; |
| 1037 if (n == "false") return false; |
| 1038 if (n == null) return null; |
| 1039 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1040 } |
| 1041 if (query.length > 0) { |
| 1042 for (var part in query.split("&")) { |
| 1043 var keyvalue = part.split("="); |
| 1044 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1045 } |
| 1046 } |
| 1047 unittest.expect(queryMap["clientVersion"].first, unittest.equals(arg_cli
entVersion)); |
| 1048 unittest.expect(queryMap["clientId"].first, unittest.equals(arg_clientId
)); |
| 1049 |
| 1050 |
| 1051 var h = { |
| 1052 "content-type" : "application/json; charset=utf-8", |
| 1053 }; |
| 1054 var resp = convert.JSON.encode(buildFetchThreatListUpdatesResponse()); |
| 1055 return new async.Future.value(stringResponse(200, h, resp)); |
| 1056 }), true); |
| 1057 res.get(arg_encodedRequest, clientVersion: arg_clientVersion, clientId: ar
g_clientId).then(unittest.expectAsync(((api.FetchThreatListUpdatesResponse respo
nse) { |
| 1058 checkFetchThreatListUpdatesResponse(response); |
| 1059 }))); |
| 1060 }); |
| 1061 |
| 1062 }); |
| 1063 |
| 1064 |
| 953 unittest.group("resource-FullHashesResourceApi", () { | 1065 unittest.group("resource-FullHashesResourceApi", () { |
| 954 unittest.test("method--find", () { | 1066 unittest.test("method--find", () { |
| 955 | 1067 |
| 956 var mock = new HttpServerMock(); | 1068 var mock = new HttpServerMock(); |
| 957 api.FullHashesResourceApi res = new api.SafebrowsingApi(mock).fullHashes; | 1069 api.FullHashesResourceApi res = new api.SafebrowsingApi(mock).fullHashes; |
| 958 var arg_request = buildFindFullHashesRequest(); | 1070 var arg_request = buildFindFullHashesRequest(); |
| 959 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1071 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 960 var obj = new api.FindFullHashesRequest.fromJson(json); | 1072 var obj = new api.FindFullHashesRequest.fromJson(json); |
| 961 checkFindFullHashesRequest(obj); | 1073 checkFindFullHashesRequest(obj); |
| 962 | 1074 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 res.find(arg_request).then(unittest.expectAsync(((api.FindThreatMatchesRes
ponse response) { | 1257 res.find(arg_request).then(unittest.expectAsync(((api.FindThreatMatchesRes
ponse response) { |
| 1146 checkFindThreatMatchesResponse(response); | 1258 checkFindThreatMatchesResponse(response); |
| 1147 }))); | 1259 }))); |
| 1148 }); | 1260 }); |
| 1149 | 1261 |
| 1150 }); | 1262 }); |
| 1151 | 1263 |
| 1152 | 1264 |
| 1153 } | 1265 } |
| 1154 | 1266 |
| OLD | NEW |