OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const char kSlowTestPage[] = | 109 const char kSlowTestPage[] = |
110 "chunked?waitBeforeHeaders=100&waitBetweenChunks=100&chunksNumber=2"; | 110 "chunked?waitBeforeHeaders=100&waitBetweenChunks=100&chunksNumber=2"; |
111 const char kSharedWorkerTestPage[] = | 111 const char kSharedWorkerTestPage[] = |
112 "files/workers/workers_ui_shared_worker.html"; | 112 "files/workers/workers_ui_shared_worker.html"; |
113 const char kSharedWorkerTestWorker[] = | 113 const char kSharedWorkerTestWorker[] = |
114 "files/workers/workers_ui_shared_worker.js"; | 114 "files/workers/workers_ui_shared_worker.js"; |
115 const char kReloadSharedWorkerTestPage[] = | 115 const char kReloadSharedWorkerTestPage[] = |
116 "files/workers/debug_shared_worker_initialization.html"; | 116 "files/workers/debug_shared_worker_initialization.html"; |
117 const char kReloadSharedWorkerTestWorker[] = | 117 const char kReloadSharedWorkerTestWorker[] = |
118 "files/workers/debug_shared_worker_initialization.js"; | 118 "files/workers/debug_shared_worker_initialization.js"; |
| 119 const char kEmulateNetworkConditionsPage[] = |
| 120 "files/devtools/emulate_network_conditions.html"; |
119 | 121 |
120 template <typename... T> | 122 template <typename... T> |
121 void DispatchOnTestSuiteSkipCheck(DevToolsWindow* window, | 123 void DispatchOnTestSuiteSkipCheck(DevToolsWindow* window, |
122 const char* method, | 124 const char* method, |
123 T... args) { | 125 T... args) { |
124 RenderViewHost* rvh = DevToolsWindowTesting::Get(window) | 126 RenderViewHost* rvh = DevToolsWindowTesting::Get(window) |
125 ->main_web_contents() | 127 ->main_web_contents() |
126 ->GetRenderViewHost(); | 128 ->GetRenderViewHost(); |
127 std::string result; | 129 std::string result; |
128 const char* args_array[] = {method, args...}; | 130 const char* args_array[] = {method, args...}; |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 | 1335 |
1334 SimulateTapAt(web_contents, gfx::Point(30, 60)); | 1336 SimulateTapAt(web_contents, gfx::Point(30, 60)); |
1335 DispatchInPageAndWait("waitForEvent", "gesturetap"); | 1337 DispatchInPageAndWait("waitForEvent", "gesturetap"); |
1336 | 1338 |
1337 DispatchAndWait("stopTimeline"); | 1339 DispatchAndWait("stopTimeline"); |
1338 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", | 1340 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", |
1339 "MouseWheel", "GestureTap"); | 1341 "MouseWheel", "GestureTap"); |
1340 | 1342 |
1341 CloseDevToolsWindow(); | 1343 CloseDevToolsWindow(); |
1342 } | 1344 } |
| 1345 |
| 1346 class DevToolsNetInfoTest : public DevToolsSanityTest { |
| 1347 protected: |
| 1348 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1349 command_line->AppendSwitch(switches::kEnableNetworkInformation); |
| 1350 command_line->AppendSwitch( |
| 1351 switches::kEnableExperimentalWebPlatformFeatures); |
| 1352 } |
| 1353 }; |
| 1354 |
| 1355 IN_PROC_BROWSER_TEST_F(DevToolsNetInfoTest, EmulateNetworkConditions) { |
| 1356 RunTest("testEmulateNetworkConditions", kEmulateNetworkConditionsPage); |
| 1357 } |
OLD | NEW |