OLD | NEW |
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/window_commands.h" | 5 #include "chrome/test/chromedriver/window_commands.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 "either 'network_conditions' or 'network_name' must be " | 923 "either 'network_conditions' or 'network_name' must be " |
924 "supplied"); | 924 "supplied"); |
925 } | 925 } |
926 | 926 |
927 session->overridden_network_conditions.reset( | 927 session->overridden_network_conditions.reset( |
928 network_conditions.release()); | 928 network_conditions.release()); |
929 return web_view->OverrideNetworkConditions( | 929 return web_view->OverrideNetworkConditions( |
930 *session->overridden_network_conditions); | 930 *session->overridden_network_conditions); |
931 } | 931 } |
932 | 932 |
| 933 Status ExecuteDeleteNetworkConditions( |
| 934 Session* session, |
| 935 WebView* web_view, |
| 936 const base::DictionaryValue& params, |
| 937 scoped_ptr<base::Value>* value) { |
| 938 scoped_ptr<NetworkConditions> network_conditions(new NetworkConditions()); |
| 939 // Get conditions from preset list. |
| 940 Status status = FindPresetNetwork("No throttling", network_conditions.get()); |
| 941 if (status.IsError()) |
| 942 return status; |
| 943 |
| 944 session->overridden_network_conditions.reset( |
| 945 network_conditions.release()); |
| 946 return web_view->OverrideNetworkConditions( |
| 947 *session->overridden_network_conditions); |
| 948 } |
| 949 |
933 Status ExecuteTakeHeapSnapshot( | 950 Status ExecuteTakeHeapSnapshot( |
934 Session* session, | 951 Session* session, |
935 WebView* web_view, | 952 WebView* web_view, |
936 const base::DictionaryValue& params, | 953 const base::DictionaryValue& params, |
937 scoped_ptr<base::Value>* value) { | 954 scoped_ptr<base::Value>* value) { |
938 return web_view->TakeHeapSnapshot(value); | 955 return web_view->TakeHeapSnapshot(value); |
939 } | 956 } |
OLD | NEW |