| 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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 test_interfaces_(interfaces), | 1544 test_interfaces_(interfaces), |
| 1545 delegate_(nullptr), | 1545 delegate_(nullptr), |
| 1546 main_view_(nullptr), | 1546 main_view_(nullptr), |
| 1547 mock_content_settings_client_( | 1547 mock_content_settings_client_( |
| 1548 new MockContentSettingsClient(&layout_test_runtime_flags_)), | 1548 new MockContentSettingsClient(&layout_test_runtime_flags_)), |
| 1549 credential_manager_client_(new MockCredentialManagerClient), | 1549 credential_manager_client_(new MockCredentialManagerClient), |
| 1550 mock_screen_orientation_client_(new MockScreenOrientationClient), | 1550 mock_screen_orientation_client_(new MockScreenOrientationClient), |
| 1551 spellcheck_(new SpellCheckClient(this)), | 1551 spellcheck_(new SpellCheckClient(this)), |
| 1552 chooser_count_(0), | 1552 chooser_count_(0), |
| 1553 previously_focused_view_(nullptr), | 1553 previously_focused_view_(nullptr), |
| 1554 did_request_after_reset_(false), | 1554 is_web_platform_tests_mode_(false), |
| 1555 weak_factory_(this) {} | 1555 weak_factory_(this) {} |
| 1556 | 1556 |
| 1557 TestRunner::~TestRunner() {} | 1557 TestRunner::~TestRunner() {} |
| 1558 | 1558 |
| 1559 void TestRunner::Install( | 1559 void TestRunner::Install( |
| 1560 WebLocalFrame* frame, | 1560 WebLocalFrame* frame, |
| 1561 base::WeakPtr<TestRunnerForSpecificView> view_test_runner) { | 1561 base::WeakPtr<TestRunnerForSpecificView> view_test_runner) { |
| 1562 TestRunnerBindings::Install(weak_factory_.GetWeakPtr(), view_test_runner, | 1562 TestRunnerBindings::Install(weak_factory_.GetWeakPtr(), view_test_runner, |
| 1563 frame); | 1563 frame); |
| 1564 } | 1564 } |
| 1565 | 1565 |
| 1566 void TestRunner::SetDelegate(WebTestDelegate* delegate) { | 1566 void TestRunner::SetDelegate(WebTestDelegate* delegate) { |
| 1567 delegate_ = delegate; | 1567 delegate_ = delegate; |
| 1568 mock_content_settings_client_->SetDelegate(delegate); | 1568 mock_content_settings_client_->SetDelegate(delegate); |
| 1569 spellcheck_->SetDelegate(delegate); | 1569 spellcheck_->SetDelegate(delegate); |
| 1570 if (speech_recognizer_) | 1570 if (speech_recognizer_) |
| 1571 speech_recognizer_->SetDelegate(delegate); | 1571 speech_recognizer_->SetDelegate(delegate); |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 void TestRunner::SetMainView(WebView* web_view) { | 1574 void TestRunner::SetMainView(WebView* web_view) { |
| 1575 main_view_ = web_view; | 1575 main_view_ = web_view; |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 void TestRunner::Reset() { | 1578 void TestRunner::Reset() { |
| 1579 did_request_after_reset_ = false; | 1579 is_web_platform_tests_mode_ = false; |
| 1580 top_loading_frame_ = nullptr; | 1580 top_loading_frame_ = nullptr; |
| 1581 layout_test_runtime_flags_.Reset(); | 1581 layout_test_runtime_flags_.Reset(); |
| 1582 mock_screen_orientation_client_->ResetData(); | 1582 mock_screen_orientation_client_->ResetData(); |
| 1583 drag_image_.reset(); | 1583 drag_image_.reset(); |
| 1584 widgets_with_scheduled_animations_.clear(); | 1584 widgets_with_scheduled_animations_.clear(); |
| 1585 | 1585 |
| 1586 WebSecurityPolicy::resetOriginAccessWhitelists(); | 1586 WebSecurityPolicy::resetOriginAccessWhitelists(); |
| 1587 #if defined(__linux__) || defined(ANDROID) | 1587 #if defined(__linux__) || defined(ANDROID) |
| 1588 WebFontRendering::setSubpixelPositioning(false); | 1588 WebFontRendering::setSubpixelPositioning(false); |
| 1589 #endif | 1589 #endif |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2725 | 2725 |
| 2726 void TestRunner::CompleteNotifyDone() { | 2726 void TestRunner::CompleteNotifyDone() { |
| 2727 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2727 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2728 work_queue_.is_empty()) | 2728 work_queue_.is_empty()) |
| 2729 delegate_->TestFinished(); | 2729 delegate_->TestFinished(); |
| 2730 layout_test_runtime_flags_.set_wait_until_done(false); | 2730 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2731 OnLayoutTestRuntimeFlagsChanged(); | 2731 OnLayoutTestRuntimeFlagsChanged(); |
| 2732 } | 2732 } |
| 2733 | 2733 |
| 2734 } // namespace test_runner | 2734 } // namespace test_runner |
| OLD | NEW |