| 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/shell/common/test_runner/test_preferences.h" | 10 #include "content/shell/common/test_runner/test_preferences.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 explicit TestRunnerBindings( | 114 explicit TestRunnerBindings( |
| 115 base::WeakPtr<TestRunner> controller); | 115 base::WeakPtr<TestRunner> controller); |
| 116 virtual ~TestRunnerBindings(); | 116 virtual ~TestRunnerBindings(); |
| 117 | 117 |
| 118 // gin::Wrappable: | 118 // gin::Wrappable: |
| 119 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | 119 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
| 120 v8::Isolate* isolate) OVERRIDE; | 120 v8::Isolate* isolate) OVERRIDE; |
| 121 | 121 |
| 122 void LogToStderr(const std::string& output); |
| 122 void NotifyDone(); | 123 void NotifyDone(); |
| 123 void WaitUntilDone(); | 124 void WaitUntilDone(); |
| 124 void QueueBackNavigation(int how_far_back); | 125 void QueueBackNavigation(int how_far_back); |
| 125 void QueueForwardNavigation(int how_far_forward); | 126 void QueueForwardNavigation(int how_far_forward); |
| 126 void QueueReload(); | 127 void QueueReload(); |
| 127 void QueueLoadingScript(const std::string& script); | 128 void QueueLoadingScript(const std::string& script); |
| 128 void QueueNonLoadingScript(const std::string& script); | 129 void QueueNonLoadingScript(const std::string& script); |
| 129 void QueueLoad(gin::Arguments* args); | 130 void QueueLoad(gin::Arguments* args); |
| 130 void QueueLoadHTMLString(gin::Arguments* args); | 131 void QueueLoadHTMLString(gin::Arguments* args); |
| 131 void SetCustomPolicyDelegate(gin::Arguments* args); | 132 void SetCustomPolicyDelegate(gin::Arguments* args); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 289 |
| 289 TestRunnerBindings::TestRunnerBindings(base::WeakPtr<TestRunner> runner) | 290 TestRunnerBindings::TestRunnerBindings(base::WeakPtr<TestRunner> runner) |
| 290 : runner_(runner) {} | 291 : runner_(runner) {} |
| 291 | 292 |
| 292 TestRunnerBindings::~TestRunnerBindings() {} | 293 TestRunnerBindings::~TestRunnerBindings() {} |
| 293 | 294 |
| 294 gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( | 295 gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
| 295 v8::Isolate* isolate) { | 296 v8::Isolate* isolate) { |
| 296 return gin::Wrappable<TestRunnerBindings>::GetObjectTemplateBuilder(isolate) | 297 return gin::Wrappable<TestRunnerBindings>::GetObjectTemplateBuilder(isolate) |
| 297 // Methods controlling test execution. | 298 // Methods controlling test execution. |
| 299 .SetMethod("logToStderr", &TestRunnerBindings::LogToStderr) |
| 298 .SetMethod("notifyDone", &TestRunnerBindings::NotifyDone) | 300 .SetMethod("notifyDone", &TestRunnerBindings::NotifyDone) |
| 299 .SetMethod("waitUntilDone", &TestRunnerBindings::WaitUntilDone) | 301 .SetMethod("waitUntilDone", &TestRunnerBindings::WaitUntilDone) |
| 300 .SetMethod("queueBackNavigation", | 302 .SetMethod("queueBackNavigation", |
| 301 &TestRunnerBindings::QueueBackNavigation) | 303 &TestRunnerBindings::QueueBackNavigation) |
| 302 .SetMethod("queueForwardNavigation", | 304 .SetMethod("queueForwardNavigation", |
| 303 &TestRunnerBindings::QueueForwardNavigation) | 305 &TestRunnerBindings::QueueForwardNavigation) |
| 304 .SetMethod("queueReload", &TestRunnerBindings::QueueReload) | 306 .SetMethod("queueReload", &TestRunnerBindings::QueueReload) |
| 305 .SetMethod("queueLoadingScript", &TestRunnerBindings::QueueLoadingScript) | 307 .SetMethod("queueLoadingScript", &TestRunnerBindings::QueueLoadingScript) |
| 306 .SetMethod("queueNonLoadingScript", | 308 .SetMethod("queueNonLoadingScript", |
| 307 &TestRunnerBindings::QueueNonLoadingScript) | 309 &TestRunnerBindings::QueueNonLoadingScript) |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 .SetMethod("applicationCacheDiskUsageForOrigin", | 523 .SetMethod("applicationCacheDiskUsageForOrigin", |
| 522 &TestRunnerBindings::NotImplemented) | 524 &TestRunnerBindings::NotImplemented) |
| 523 .SetMethod("abortModal", &TestRunnerBindings::NotImplemented) | 525 .SetMethod("abortModal", &TestRunnerBindings::NotImplemented) |
| 524 | 526 |
| 525 // Aliases. | 527 // Aliases. |
| 526 // Used at fast/dom/assign-to-window-status.html | 528 // Used at fast/dom/assign-to-window-status.html |
| 527 .SetMethod("dumpStatusCallbacks", | 529 .SetMethod("dumpStatusCallbacks", |
| 528 &TestRunnerBindings::DumpWindowStatusChanges); | 530 &TestRunnerBindings::DumpWindowStatusChanges); |
| 529 } | 531 } |
| 530 | 532 |
| 533 void TestRunnerBindings::LogToStderr(const std::string& output) { |
| 534 LOG(ERROR) << output; |
| 535 } |
| 536 |
| 531 void TestRunnerBindings::NotifyDone() { | 537 void TestRunnerBindings::NotifyDone() { |
| 532 if (runner_) | 538 if (runner_) |
| 533 runner_->NotifyDone(); | 539 runner_->NotifyDone(); |
| 534 } | 540 } |
| 535 | 541 |
| 536 void TestRunnerBindings::WaitUntilDone() { | 542 void TestRunnerBindings::WaitUntilDone() { |
| 537 if (runner_) | 543 if (runner_) |
| 538 runner_->WaitUntilDone(); | 544 runner_->WaitUntilDone(); |
| 539 } | 545 } |
| 540 | 546 |
| (...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 } | 2634 } |
| 2629 | 2635 |
| 2630 void TestRunner::DidLosePointerLockInternal() { | 2636 void TestRunner::DidLosePointerLockInternal() { |
| 2631 bool was_locked = pointer_locked_; | 2637 bool was_locked = pointer_locked_; |
| 2632 pointer_locked_ = false; | 2638 pointer_locked_ = false; |
| 2633 if (was_locked) | 2639 if (was_locked) |
| 2634 web_view_->didLosePointerLock(); | 2640 web_view_->didLosePointerLock(); |
| 2635 } | 2641 } |
| 2636 | 2642 |
| 2637 } // namespace content | 2643 } // namespace content |
| OLD | NEW |