| 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 11 matching lines...) Expand all Loading... |
| 22 #include "components/test_runner/mock_screen_orientation_client.h" | 22 #include "components/test_runner/mock_screen_orientation_client.h" |
| 23 #include "components/test_runner/mock_web_document_subresource_filter.h" | 23 #include "components/test_runner/mock_web_document_subresource_filter.h" |
| 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" | |
| 33 #include "components/test_runner/web_test_delegate.h" | 32 #include "components/test_runner/web_test_delegate.h" |
| 34 #include "components/test_runner/web_view_test_proxy.h" | 33 #include "components/test_runner/web_view_test_proxy.h" |
| 35 #include "gin/arguments.h" | 34 #include "gin/arguments.h" |
| 36 #include "gin/array_buffer.h" | 35 #include "gin/array_buffer.h" |
| 37 #include "gin/handle.h" | 36 #include "gin/handle.h" |
| 38 #include "gin/object_template_builder.h" | 37 #include "gin/object_template_builder.h" |
| 39 #include "gin/wrappable.h" | 38 #include "gin/wrappable.h" |
| 40 #include "third_party/WebKit/public/platform/WebCanvas.h" | 39 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 41 #include "third_party/WebKit/public/platform/WebData.h" | 40 #include "third_party/WebKit/public/platform/WebData.h" |
| 42 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" | 41 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 TestRunner::WorkQueue::~WorkQueue() { | 1488 TestRunner::WorkQueue::~WorkQueue() { |
| 1490 Reset(); | 1489 Reset(); |
| 1491 } | 1490 } |
| 1492 | 1491 |
| 1493 void TestRunner::WorkQueue::ProcessWorkSoon() { | 1492 void TestRunner::WorkQueue::ProcessWorkSoon() { |
| 1494 if (controller_->topLoadingFrame()) | 1493 if (controller_->topLoadingFrame()) |
| 1495 return; | 1494 return; |
| 1496 | 1495 |
| 1497 if (!queue_.empty()) { | 1496 if (!queue_.empty()) { |
| 1498 // We delay processing queued work to avoid recursion problems. | 1497 // We delay processing queued work to avoid recursion problems. |
| 1499 controller_->delegate_->PostTask(new WebCallbackTask(base::Bind( | 1498 controller_->delegate_->PostTask(base::Bind( |
| 1500 &TestRunner::WorkQueue::ProcessWork, weak_factory_.GetWeakPtr()))); | 1499 &TestRunner::WorkQueue::ProcessWork, weak_factory_.GetWeakPtr())); |
| 1501 } else if (!controller_->layout_test_runtime_flags_.wait_until_done()) { | 1500 } else if (!controller_->layout_test_runtime_flags_.wait_until_done()) { |
| 1502 controller_->delegate_->TestFinished(); | 1501 controller_->delegate_->TestFinished(); |
| 1503 } | 1502 } |
| 1504 } | 1503 } |
| 1505 | 1504 |
| 1506 void TestRunner::WorkQueue::Reset() { | 1505 void TestRunner::WorkQueue::Reset() { |
| 1507 frozen_ = false; | 1506 frozen_ = false; |
| 1508 while (!queue_.empty()) { | 1507 while (!queue_.empty()) { |
| 1509 delete queue_.front(); | 1508 delete queue_.front(); |
| 1510 queue_.pop_front(); | 1509 queue_.pop_front(); |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2726 | 2725 |
| 2727 void TestRunner::NotifyDone() { | 2726 void TestRunner::NotifyDone() { |
| 2728 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2727 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2729 !will_navigate_ && work_queue_.is_empty()) | 2728 !will_navigate_ && work_queue_.is_empty()) |
| 2730 delegate_->TestFinished(); | 2729 delegate_->TestFinished(); |
| 2731 layout_test_runtime_flags_.set_wait_until_done(false); | 2730 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2732 OnLayoutTestRuntimeFlagsChanged(); | 2731 OnLayoutTestRuntimeFlagsChanged(); |
| 2733 } | 2732 } |
| 2734 | 2733 |
| 2735 } // namespace test_runner | 2734 } // namespace test_runner |
| OLD | NEW |