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