| 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 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2064 bool Run(WebTestDelegate* delegate, WebView*) override { | 2064 bool Run(WebTestDelegate* delegate, WebView*) override { |
| 2065 delegate->LoadURLForFrame(url_, target_); | 2065 delegate->LoadURLForFrame(url_, target_); |
| 2066 return true; // FIXME: Did it really start a navigation? | 2066 return true; // FIXME: Did it really start a navigation? |
| 2067 } | 2067 } |
| 2068 | 2068 |
| 2069 private: | 2069 private: |
| 2070 WebURL url_; | 2070 WebURL url_; |
| 2071 std::string target_; | 2071 std::string target_; |
| 2072 }; | 2072 }; |
| 2073 | 2073 |
| 2074 void TestRunner::LoadURLForMainFrame(const blink::WebURL& url) { |
| 2075 delegate_->LoadURLForMainFrame(url); |
| 2076 } |
| 2077 |
| 2074 void TestRunner::QueueLoad(const std::string& url, const std::string& target) { | 2078 void TestRunner::QueueLoad(const std::string& url, const std::string& target) { |
| 2075 if (!main_view_) | 2079 if (!main_view_) |
| 2076 return; | 2080 return; |
| 2077 | 2081 |
| 2078 // FIXME: Implement WebURL::resolve() and avoid GURL. | 2082 // FIXME: Implement WebURL::resolve() and avoid GURL. |
| 2079 GURL current_url = main_view_->mainFrame()->document().url(); | 2083 GURL current_url = main_view_->mainFrame()->document().url(); |
| 2080 GURL full_url = current_url.Resolve(url); | 2084 GURL full_url = current_url.Resolve(url); |
| 2081 work_queue_.AddWork(new WorkItemLoad(full_url, target)); | 2085 work_queue_.AddWork(new WorkItemLoad(full_url, target)); |
| 2082 } | 2086 } |
| 2083 | 2087 |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2803 | 2807 |
| 2804 void TestRunner::NotifyDone() { | 2808 void TestRunner::NotifyDone() { |
| 2805 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2809 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2806 !will_navigate_ && work_queue_.is_empty()) | 2810 !will_navigate_ && work_queue_.is_empty()) |
| 2807 delegate_->TestFinished(); | 2811 delegate_->TestFinished(); |
| 2808 layout_test_runtime_flags_.set_wait_until_done(false); | 2812 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2809 OnLayoutTestRuntimeFlagsChanged(); | 2813 OnLayoutTestRuntimeFlagsChanged(); |
| 2810 } | 2814 } |
| 2811 | 2815 |
| 2812 } // namespace test_runner | 2816 } // namespace test_runner |
| OLD | NEW |