| 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/test_runner.h" | 5 #include "content/shell/renderer/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/public/test/layouttest_support.h" | 10 #include "content/public/test/layouttest_support.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void DumpBackForwardList(); | 254 void DumpBackForwardList(); |
| 255 void DumpSelectionRect(); | 255 void DumpSelectionRect(); |
| 256 void SetPrinting(); | 256 void SetPrinting(); |
| 257 void ClearPrinting(); | 257 void ClearPrinting(); |
| 258 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value); | 258 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value); |
| 259 void SetWillSendRequestClearHeader(const std::string& header); | 259 void SetWillSendRequestClearHeader(const std::string& header); |
| 260 void DumpResourceRequestPriorities(); | 260 void DumpResourceRequestPriorities(); |
| 261 void SetUseMockTheme(bool use); | 261 void SetUseMockTheme(bool use); |
| 262 void WaitUntilExternalURLLoad(); | 262 void WaitUntilExternalURLLoad(); |
| 263 void DumpDragImage(); | 263 void DumpDragImage(); |
| 264 void DumpNavigationPolicy(); |
| 264 void ShowWebInspector(gin::Arguments* args); | 265 void ShowWebInspector(gin::Arguments* args); |
| 265 void CloseWebInspector(); | 266 void CloseWebInspector(); |
| 266 bool IsChooserShown(); | 267 bool IsChooserShown(); |
| 267 void EvaluateInWebInspector(int call_id, const std::string& script); | 268 void EvaluateInWebInspector(int call_id, const std::string& script); |
| 268 void ClearAllDatabases(); | 269 void ClearAllDatabases(); |
| 269 void SetDatabaseQuota(int quota); | 270 void SetDatabaseQuota(int quota); |
| 270 void SetAlwaysAcceptCookies(bool accept); | 271 void SetAlwaysAcceptCookies(bool accept); |
| 271 void SetWindowIsKey(bool value); | 272 void SetWindowIsKey(bool value); |
| 272 std::string PathToLocalResource(const std::string& path); | 273 std::string PathToLocalResource(const std::string& path); |
| 273 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); | 274 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 "setShouldStayOnPageAfterHandlingBeforeUnload", | 494 "setShouldStayOnPageAfterHandlingBeforeUnload", |
| 494 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) | 495 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) |
| 495 .SetMethod("setWillSendRequestClearHeader", | 496 .SetMethod("setWillSendRequestClearHeader", |
| 496 &TestRunnerBindings::SetWillSendRequestClearHeader) | 497 &TestRunnerBindings::SetWillSendRequestClearHeader) |
| 497 .SetMethod("dumpResourceRequestPriorities", | 498 .SetMethod("dumpResourceRequestPriorities", |
| 498 &TestRunnerBindings::DumpResourceRequestPriorities) | 499 &TestRunnerBindings::DumpResourceRequestPriorities) |
| 499 .SetMethod("setUseMockTheme", &TestRunnerBindings::SetUseMockTheme) | 500 .SetMethod("setUseMockTheme", &TestRunnerBindings::SetUseMockTheme) |
| 500 .SetMethod("waitUntilExternalURLLoad", | 501 .SetMethod("waitUntilExternalURLLoad", |
| 501 &TestRunnerBindings::WaitUntilExternalURLLoad) | 502 &TestRunnerBindings::WaitUntilExternalURLLoad) |
| 502 .SetMethod("dumpDragImage", &TestRunnerBindings::DumpDragImage) | 503 .SetMethod("dumpDragImage", &TestRunnerBindings::DumpDragImage) |
| 504 .SetMethod("dumpNavigationPolicy", |
| 505 &TestRunnerBindings::DumpNavigationPolicy) |
| 503 .SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector) | 506 .SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector) |
| 504 .SetMethod("closeWebInspector", &TestRunnerBindings::CloseWebInspector) | 507 .SetMethod("closeWebInspector", &TestRunnerBindings::CloseWebInspector) |
| 505 .SetMethod("isChooserShown", &TestRunnerBindings::IsChooserShown) | 508 .SetMethod("isChooserShown", &TestRunnerBindings::IsChooserShown) |
| 506 .SetMethod("evaluateInWebInspector", | 509 .SetMethod("evaluateInWebInspector", |
| 507 &TestRunnerBindings::EvaluateInWebInspector) | 510 &TestRunnerBindings::EvaluateInWebInspector) |
| 508 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases) | 511 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases) |
| 509 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota) | 512 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota) |
| 510 .SetMethod("setAlwaysAcceptCookies", | 513 .SetMethod("setAlwaysAcceptCookies", |
| 511 &TestRunnerBindings::SetAlwaysAcceptCookies) | 514 &TestRunnerBindings::SetAlwaysAcceptCookies) |
| 512 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) | 515 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 void TestRunnerBindings::WaitUntilExternalURLLoad() { | 1233 void TestRunnerBindings::WaitUntilExternalURLLoad() { |
| 1231 if (runner_) | 1234 if (runner_) |
| 1232 runner_->WaitUntilExternalURLLoad(); | 1235 runner_->WaitUntilExternalURLLoad(); |
| 1233 } | 1236 } |
| 1234 | 1237 |
| 1235 void TestRunnerBindings::DumpDragImage() { | 1238 void TestRunnerBindings::DumpDragImage() { |
| 1236 if (runner_) | 1239 if (runner_) |
| 1237 runner_->DumpDragImage(); | 1240 runner_->DumpDragImage(); |
| 1238 } | 1241 } |
| 1239 | 1242 |
| 1243 void TestRunnerBindings::DumpNavigationPolicy() { |
| 1244 if (runner_) |
| 1245 runner_->DumpNavigationPolicy(); |
| 1246 } |
| 1247 |
| 1240 void TestRunnerBindings::ShowWebInspector(gin::Arguments* args) { | 1248 void TestRunnerBindings::ShowWebInspector(gin::Arguments* args) { |
| 1241 if (runner_) { | 1249 if (runner_) { |
| 1242 std::string settings; | 1250 std::string settings; |
| 1243 args->GetNext(&settings); | 1251 args->GetNext(&settings); |
| 1244 std::string frontend_url; | 1252 std::string frontend_url; |
| 1245 args->GetNext(&frontend_url); | 1253 args->GetNext(&frontend_url); |
| 1246 runner_->ShowWebInspector(settings, frontend_url); | 1254 runner_->ShowWebInspector(settings, frontend_url); |
| 1247 } | 1255 } |
| 1248 } | 1256 } |
| 1249 | 1257 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 can_open_windows_ = false; | 1670 can_open_windows_ = false; |
| 1663 dump_resource_load_callbacks_ = false; | 1671 dump_resource_load_callbacks_ = false; |
| 1664 dump_resource_request_callbacks_ = false; | 1672 dump_resource_request_callbacks_ = false; |
| 1665 dump_resource_reqponse_mime_types_ = false; | 1673 dump_resource_reqponse_mime_types_ = false; |
| 1666 dump_window_status_changes_ = false; | 1674 dump_window_status_changes_ = false; |
| 1667 dump_progress_finished_callback_ = false; | 1675 dump_progress_finished_callback_ = false; |
| 1668 dump_spell_check_callbacks_ = false; | 1676 dump_spell_check_callbacks_ = false; |
| 1669 dump_back_forward_list_ = false; | 1677 dump_back_forward_list_ = false; |
| 1670 dump_selection_rect_ = false; | 1678 dump_selection_rect_ = false; |
| 1671 dump_drag_image_ = false; | 1679 dump_drag_image_ = false; |
| 1680 dump_navigation_policy_ = false; |
| 1672 test_repaint_ = false; | 1681 test_repaint_ = false; |
| 1673 sweep_horizontally_ = false; | 1682 sweep_horizontally_ = false; |
| 1674 is_printing_ = false; | 1683 is_printing_ = false; |
| 1675 midi_accessor_result_ = true; | 1684 midi_accessor_result_ = true; |
| 1676 should_stay_on_page_after_handling_before_unload_ = false; | 1685 should_stay_on_page_after_handling_before_unload_ = false; |
| 1677 should_dump_resource_priorities_ = false; | 1686 should_dump_resource_priorities_ = false; |
| 1678 has_custom_text_output_ = false; | 1687 has_custom_text_output_ = false; |
| 1679 custom_text_output_.clear(); | 1688 custom_text_output_.clear(); |
| 1680 | 1689 |
| 1681 http_headers_to_clear_.clear(); | 1690 http_headers_to_clear_.clear(); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 } | 1945 } |
| 1937 | 1946 |
| 1938 void TestRunner::setToolTipText(const WebString& text) { | 1947 void TestRunner::setToolTipText(const WebString& text) { |
| 1939 tooltip_text_ = text.utf8(); | 1948 tooltip_text_ = text.utf8(); |
| 1940 } | 1949 } |
| 1941 | 1950 |
| 1942 bool TestRunner::shouldDumpDragImage() { | 1951 bool TestRunner::shouldDumpDragImage() { |
| 1943 return dump_drag_image_; | 1952 return dump_drag_image_; |
| 1944 } | 1953 } |
| 1945 | 1954 |
| 1955 bool TestRunner::shouldDumpNavigationPolicy() const { |
| 1956 return dump_navigation_policy_; |
| 1957 } |
| 1958 |
| 1946 bool TestRunner::midiAccessorResult() { | 1959 bool TestRunner::midiAccessorResult() { |
| 1947 return midi_accessor_result_; | 1960 return midi_accessor_result_; |
| 1948 } | 1961 } |
| 1949 | 1962 |
| 1950 void TestRunner::ClearDevToolsLocalStorage() { | 1963 void TestRunner::ClearDevToolsLocalStorage() { |
| 1951 delegate_->ClearDevToolsLocalStorage(); | 1964 delegate_->ClearDevToolsLocalStorage(); |
| 1952 } | 1965 } |
| 1953 | 1966 |
| 1954 void TestRunner::ShowDevTools(const std::string& settings, | 1967 void TestRunner::ShowDevTools(const std::string& settings, |
| 1955 const std::string& frontend_url) { | 1968 const std::string& frontend_url) { |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2737 | 2750 |
| 2738 void TestRunner::WaitUntilExternalURLLoad() { | 2751 void TestRunner::WaitUntilExternalURLLoad() { |
| 2739 wait_until_external_url_load_ = true; | 2752 wait_until_external_url_load_ = true; |
| 2740 } | 2753 } |
| 2741 | 2754 |
| 2742 void TestRunner::DumpDragImage() { | 2755 void TestRunner::DumpDragImage() { |
| 2743 DumpAsTextWithPixelResults(); | 2756 DumpAsTextWithPixelResults(); |
| 2744 dump_drag_image_ = true; | 2757 dump_drag_image_ = true; |
| 2745 } | 2758 } |
| 2746 | 2759 |
| 2760 void TestRunner::DumpNavigationPolicy() { |
| 2761 dump_navigation_policy_ = true; |
| 2762 } |
| 2763 |
| 2747 void TestRunner::CloseWebInspector() { | 2764 void TestRunner::CloseWebInspector() { |
| 2748 delegate_->CloseDevTools(); | 2765 delegate_->CloseDevTools(); |
| 2749 } | 2766 } |
| 2750 | 2767 |
| 2751 bool TestRunner::IsChooserShown() { | 2768 bool TestRunner::IsChooserShown() { |
| 2752 return proxy_->IsChooserShown(); | 2769 return proxy_->IsChooserShown(); |
| 2753 } | 2770 } |
| 2754 | 2771 |
| 2755 void TestRunner::EvaluateInWebInspector(int call_id, | 2772 void TestRunner::EvaluateInWebInspector(int call_id, |
| 2756 const std::string& script) { | 2773 const std::string& script) { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3023 } | 3040 } |
| 3024 | 3041 |
| 3025 void TestRunner::DidLosePointerLockInternal() { | 3042 void TestRunner::DidLosePointerLockInternal() { |
| 3026 bool was_locked = pointer_locked_; | 3043 bool was_locked = pointer_locked_; |
| 3027 pointer_locked_ = false; | 3044 pointer_locked_ = false; |
| 3028 if (was_locked) | 3045 if (was_locked) |
| 3029 web_view_->didLosePointerLock(); | 3046 web_view_->didLosePointerLock(); |
| 3030 } | 3047 } |
| 3031 | 3048 |
| 3032 } // namespace content | 3049 } // namespace content |
| OLD | NEW |