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

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

Issue 883083002: [chromedriver] Add Network Conditions Override Manager and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working implementation of emulating network conditions with chromedriver Created 5 years, 10 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 "session/:sessionId/execute_sql", 363 "session/:sessionId/execute_sql",
364 base::Bind(&UnimplementedCommand)), 364 base::Bind(&UnimplementedCommand)),
365 CommandMapping( 365 CommandMapping(
366 kGet, 366 kGet,
367 "session/:sessionId/location", 367 "session/:sessionId/location",
368 WrapToCommand("GetGeolocation", base::Bind(&ExecuteGetLocation))), 368 WrapToCommand("GetGeolocation", base::Bind(&ExecuteGetLocation))),
369 CommandMapping( 369 CommandMapping(
370 kPost, 370 kPost,
371 "session/:sessionId/location", 371 "session/:sessionId/location",
372 WrapToCommand("SetGeolocation", base::Bind(&ExecuteSetLocation))), 372 WrapToCommand("SetGeolocation", base::Bind(&ExecuteSetLocation))),
373 CommandMapping(
374 kGet,
375 "session/:sessionId/network_conditions",
samuong 2015/02/11 23:22:14 Let's put this behind a vendor-specific URL (see h
srawlins 2015/02/25 22:40:57 Done.
376 WrapToCommand("GetNetworkConditions",
377 base::Bind(&ExecuteGetNetworkConditions))),
378 CommandMapping(
379 kPost,
380 "session/:sessionId/network_conditions",
381 WrapToCommand("SetNetworkConditions",
382 base::Bind(&ExecuteSetNetworkConditions))),
373 CommandMapping(kGet, 383 CommandMapping(kGet,
374 "session/:sessionId/application_cache/status", 384 "session/:sessionId/application_cache/status",
375 base::Bind(&ExecuteGetStatus)), 385 base::Bind(&ExecuteGetStatus)),
376 CommandMapping(kGet, 386 CommandMapping(kGet,
377 "session/:sessionId/browser_connection", 387 "session/:sessionId/browser_connection",
378 base::Bind(&UnimplementedCommand)), 388 base::Bind(&UnimplementedCommand)),
379 CommandMapping(kPost, 389 CommandMapping(kPost,
380 "session/:sessionId/browser_connection", 390 "session/:sessionId/browser_connection",
381 base::Bind(&UnimplementedCommand)), 391 base::Bind(&UnimplementedCommand)),
382 CommandMapping( 392 CommandMapping(
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 params.SetString(name, path_parts[i]); 750 params.SetString(name, path_parts[i]);
741 } else if (command_path_parts[i] != path_parts[i]) { 751 } else if (command_path_parts[i] != path_parts[i]) {
742 return false; 752 return false;
743 } 753 }
744 } 754 }
745 out_params->MergeDictionary(&params); 755 out_params->MergeDictionary(&params);
746 return true; 756 return true;
747 } 757 }
748 758
749 } // namespace internal 759 } // namespace internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698