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

Side by Side Diff: chrome/test/chromedriver/server/http_handler.cc

Issue 2065733002: Add a method to override the network conditions of the ChromeDriver session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test XHR with setting network emulation and refactored netowrk setter method Created 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/server/http_handler.h" 5 #include "chrome/test/chromedriver/server/http_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 base::Bind(&UnimplementedCommand)), 375 base::Bind(&UnimplementedCommand)),
376 CommandMapping( 376 CommandMapping(
377 kGet, 377 kGet,
378 "session/:sessionId/location", 378 "session/:sessionId/location",
379 WrapToCommand("GetGeolocation", base::Bind(&ExecuteGetLocation))), 379 WrapToCommand("GetGeolocation", base::Bind(&ExecuteGetLocation))),
380 CommandMapping( 380 CommandMapping(
381 kPost, 381 kPost,
382 "session/:sessionId/location", 382 "session/:sessionId/location",
383 WrapToCommand("SetGeolocation", base::Bind(&ExecuteSetLocation))), 383 WrapToCommand("SetGeolocation", base::Bind(&ExecuteSetLocation))),
384 CommandMapping( 384 CommandMapping(
385 kPost,
386 "session/:sessionId/network_connection",
387 WrapToCommand("SetNetworkConnection",
388 base::Bind(&ExecuteSetNetworkConnection) )),
prasadv 2016/06/17 18:43:35 Nit: Please correct indentation, also use only spa
samuong 2016/06/17 22:01:30 You can run "git cl presubmit" which will automati
roisinmcl 2016/06/20 18:14:16 Done.
389 CommandMapping(
385 kGet, 390 kGet,
386 "session/:sessionId/chromium/network_conditions", 391 "session/:sessionId/chromium/network_conditions",
387 WrapToCommand("GetNetworkConditions", 392 WrapToCommand("GetNetworkConditions",
388 base::Bind(&ExecuteGetNetworkConditions))), 393 base::Bind(&ExecuteGetNetworkConditions))),
389 CommandMapping( 394 CommandMapping(
390 kPost, 395 kPost,
391 "session/:sessionId/chromium/network_conditions", 396 "session/:sessionId/chromium/network_conditions",
392 WrapToCommand("SetNetworkConditions", 397 WrapToCommand("SetNetworkConditions",
393 base::Bind(&ExecuteSetNetworkConditions))), 398 base::Bind(&ExecuteSetNetworkConditions))),
394 CommandMapping( 399 CommandMapping(
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 params.SetString(name, decoded); 788 params.SetString(name, decoded);
784 } else if (command_path_parts[i] != path_parts[i]) { 789 } else if (command_path_parts[i] != path_parts[i]) {
785 return false; 790 return false;
786 } 791 }
787 } 792 }
788 out_params->MergeDictionary(&params); 793 out_params->MergeDictionary(&params);
789 return true; 794 return true;
790 } 795 }
791 796
792 } // namespace internal 797 } // namespace internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698