| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/renderer/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "content/public/common/content_switches.h" |
| 13 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 15 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 14 #include "content/shell/renderer/test_runner/TestPlugin.h" | 16 #include "content/shell/renderer/test_runner/TestPlugin.h" |
| 15 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 17 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 16 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 18 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 17 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 19 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 18 #include "content/shell/renderer/test_runner/event_sender.h" | 20 #include "content/shell/renderer/test_runner/event_sender.h" |
| 19 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 21 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
| 20 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
| 21 #include "content/shell/renderer/test_runner/mock_web_push_client.h" | 23 #include "content/shell/renderer/test_runner/mock_web_push_client.h" |
| 22 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 return result; | 307 return result; |
| 306 } | 308 } |
| 307 } | 309 } |
| 308 | 310 |
| 309 WebTestProxyBase::WebTestProxyBase() | 311 WebTestProxyBase::WebTestProxyBase() |
| 310 : test_interfaces_(NULL), | 312 : test_interfaces_(NULL), |
| 311 delegate_(NULL), | 313 delegate_(NULL), |
| 312 web_widget_(NULL), | 314 web_widget_(NULL), |
| 313 spellcheck_(new SpellCheckClient(this)), | 315 spellcheck_(new SpellCheckClient(this)), |
| 314 chooser_count_(0) { | 316 chooser_count_(0) { |
| 317 // TODO(enne): using the scheduler introduces additional composite steps |
| 318 // that create flakiness. This should go away eventually. |
| 319 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 320 switches::kDisableSingleThreadProxyScheduler); |
| 315 Reset(); | 321 Reset(); |
| 316 } | 322 } |
| 317 | 323 |
| 318 WebTestProxyBase::~WebTestProxyBase() { | 324 WebTestProxyBase::~WebTestProxyBase() { |
| 319 test_interfaces_->windowClosed(this); | 325 test_interfaces_->windowClosed(this); |
| 320 // Tests must wait for readback requests to finish before notifying that | 326 // Tests must wait for readback requests to finish before notifying that |
| 321 // they are done. | 327 // they are done. |
| 322 CHECK_EQ(0u, composite_and_readback_callbacks_.size()); | 328 CHECK_EQ(0u, composite_and_readback_callbacks_.size()); |
| 323 } | 329 } |
| 324 | 330 |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 if (!push_client_.get()) | 1257 if (!push_client_.get()) |
| 1252 push_client_.reset(new MockWebPushClient); | 1258 push_client_.reset(new MockWebPushClient); |
| 1253 return push_client_.get(); | 1259 return push_client_.get(); |
| 1254 } | 1260 } |
| 1255 | 1261 |
| 1256 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1262 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
| 1257 return GetPushClientMock(); | 1263 return GetPushClientMock(); |
| 1258 } | 1264 } |
| 1259 | 1265 |
| 1260 } // namespace content | 1266 } // namespace content |
| OLD | NEW |