| 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 "components/test_runner/test_runner.h" | 5 #include "components/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "components/test_runner/mock_web_speech_recognizer.h" | 24 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 25 #include "components/test_runner/mock_web_user_media_client.h" | 25 #include "components/test_runner/mock_web_user_media_client.h" |
| 26 #include "components/test_runner/pixel_dump.h" | 26 #include "components/test_runner/pixel_dump.h" |
| 27 #include "components/test_runner/spell_check_client.h" | 27 #include "components/test_runner/spell_check_client.h" |
| 28 #include "components/test_runner/test_common.h" | 28 #include "components/test_runner/test_common.h" |
| 29 #include "components/test_runner/test_interfaces.h" | 29 #include "components/test_runner/test_interfaces.h" |
| 30 #include "components/test_runner/test_preferences.h" | 30 #include "components/test_runner/test_preferences.h" |
| 31 #include "components/test_runner/test_runner_for_specific_view.h" | 31 #include "components/test_runner/test_runner_for_specific_view.h" |
| 32 #include "components/test_runner/web_task.h" | 32 #include "components/test_runner/web_task.h" |
| 33 #include "components/test_runner/web_test_delegate.h" | 33 #include "components/test_runner/web_test_delegate.h" |
| 34 #include "components/test_runner/web_test_proxy.h" | 34 #include "components/test_runner/web_view_test_proxy.h" |
| 35 #include "gin/arguments.h" | 35 #include "gin/arguments.h" |
| 36 #include "gin/array_buffer.h" | 36 #include "gin/array_buffer.h" |
| 37 #include "gin/handle.h" | 37 #include "gin/handle.h" |
| 38 #include "gin/object_template_builder.h" | 38 #include "gin/object_template_builder.h" |
| 39 #include "gin/wrappable.h" | 39 #include "gin/wrappable.h" |
| 40 #include "third_party/WebKit/public/platform/WebCanvas.h" | 40 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 41 #include "third_party/WebKit/public/platform/WebData.h" | 41 #include "third_party/WebKit/public/platform/WebData.h" |
| 42 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" | 42 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" |
| 43 #include "third_party/WebKit/public/platform/WebPoint.h" | 43 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 44 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 44 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 orientation = WebScreenOrientationPortraitPrimary; | 2221 orientation = WebScreenOrientationPortraitPrimary; |
| 2222 } else if (orientation_str == "portrait-secondary") { | 2222 } else if (orientation_str == "portrait-secondary") { |
| 2223 orientation = WebScreenOrientationPortraitSecondary; | 2223 orientation = WebScreenOrientationPortraitSecondary; |
| 2224 } else if (orientation_str == "landscape-primary") { | 2224 } else if (orientation_str == "landscape-primary") { |
| 2225 orientation = WebScreenOrientationLandscapePrimary; | 2225 orientation = WebScreenOrientationLandscapePrimary; |
| 2226 } else { | 2226 } else { |
| 2227 DCHECK_EQ("landscape-secondary", orientation_str); | 2227 DCHECK_EQ("landscape-secondary", orientation_str); |
| 2228 orientation = WebScreenOrientationLandscapeSecondary; | 2228 orientation = WebScreenOrientationLandscapeSecondary; |
| 2229 } | 2229 } |
| 2230 | 2230 |
| 2231 for (WebTestProxyBase* window : test_interfaces_->GetWindowList()) { | 2231 for (WebViewTestProxyBase* window : test_interfaces_->GetWindowList()) { |
| 2232 WebFrame* main_frame = window->web_view()->mainFrame(); | 2232 WebFrame* main_frame = window->web_view()->mainFrame(); |
| 2233 // TODO(lukasza): Need to make this work for remote frames. | 2233 // TODO(lukasza): Need to make this work for remote frames. |
| 2234 if (main_frame->isWebLocalFrame()) { | 2234 if (main_frame->isWebLocalFrame()) { |
| 2235 mock_screen_orientation_client_->UpdateDeviceOrientation( | 2235 mock_screen_orientation_client_->UpdateDeviceOrientation( |
| 2236 main_frame->toWebLocalFrame(), orientation); | 2236 main_frame->toWebLocalFrame(), orientation); |
| 2237 } | 2237 } |
| 2238 } | 2238 } |
| 2239 } | 2239 } |
| 2240 | 2240 |
| 2241 void TestRunner::DisableMockScreenOrientation() { | 2241 void TestRunner::DisableMockScreenOrientation() { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 return layout_test_runtime_flags_.accept_languages(); | 2334 return layout_test_runtime_flags_.accept_languages(); |
| 2335 } | 2335 } |
| 2336 | 2336 |
| 2337 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { | 2337 void TestRunner::SetAcceptLanguages(const std::string& accept_languages) { |
| 2338 if (accept_languages == GetAcceptLanguages()) | 2338 if (accept_languages == GetAcceptLanguages()) |
| 2339 return; | 2339 return; |
| 2340 | 2340 |
| 2341 layout_test_runtime_flags_.set_accept_languages(accept_languages); | 2341 layout_test_runtime_flags_.set_accept_languages(accept_languages); |
| 2342 OnLayoutTestRuntimeFlagsChanged(); | 2342 OnLayoutTestRuntimeFlagsChanged(); |
| 2343 | 2343 |
| 2344 for (WebTestProxyBase* window : test_interfaces_->GetWindowList()) | 2344 for (WebViewTestProxyBase* window : test_interfaces_->GetWindowList()) |
| 2345 window->web_view()->acceptLanguagesChanged(); | 2345 window->web_view()->acceptLanguagesChanged(); |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 void TestRunner::SetPluginsEnabled(bool enabled) { | 2348 void TestRunner::SetPluginsEnabled(bool enabled) { |
| 2349 delegate_->Preferences()->plugins_enabled = enabled; | 2349 delegate_->Preferences()->plugins_enabled = enabled; |
| 2350 delegate_->ApplyPreferences(); | 2350 delegate_->ApplyPreferences(); |
| 2351 } | 2351 } |
| 2352 | 2352 |
| 2353 bool TestRunner::GetAnimationScheduled() const { | 2353 bool TestRunner::GetAnimationScheduled() const { |
| 2354 bool is_animation_scheduled = !widgets_with_scheduled_animations_.empty(); | 2354 bool is_animation_scheduled = !widgets_with_scheduled_animations_.empty(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 | 2735 |
| 2736 void TestRunner::NotifyDone() { | 2736 void TestRunner::NotifyDone() { |
| 2737 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2737 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2738 work_queue_.is_empty()) | 2738 work_queue_.is_empty()) |
| 2739 delegate_->TestFinished(); | 2739 delegate_->TestFinished(); |
| 2740 layout_test_runtime_flags_.set_wait_until_done(false); | 2740 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2741 OnLayoutTestRuntimeFlagsChanged(); | 2741 OnLayoutTestRuntimeFlagsChanged(); |
| 2742 } | 2742 } |
| 2743 | 2743 |
| 2744 } // namespace test_runner | 2744 } // namespace test_runner |
| OLD | NEW |