Chromium Code Reviews| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 void SetTabKeyCyclesThroughElements(bool tab_key_cycles_through_elements); | 245 void SetTabKeyCyclesThroughElements(bool tab_key_cycles_through_elements); |
| 246 void SetTextDirection(const std::string& direction_name); | 246 void SetTextDirection(const std::string& direction_name); |
| 247 void SetTextSubpixelPositioning(bool value); | 247 void SetTextSubpixelPositioning(bool value); |
| 248 void SetUseMockTheme(bool use); | 248 void SetUseMockTheme(bool use); |
| 249 void SetViewSourceForFrame(const std::string& name, bool enabled); | 249 void SetViewSourceForFrame(const std::string& name, bool enabled); |
| 250 void SetWillSendRequestClearHeader(const std::string& header); | 250 void SetWillSendRequestClearHeader(const std::string& header); |
| 251 void SetWindowIsKey(bool value); | 251 void SetWindowIsKey(bool value); |
| 252 void SetXSSAuditorEnabled(bool enabled); | 252 void SetXSSAuditorEnabled(bool enabled); |
| 253 void ShowWebInspector(gin::Arguments* args); | 253 void ShowWebInspector(gin::Arguments* args); |
| 254 void SimulateWebNotificationClick(const std::string& title, int action_index); | 254 void SimulateWebNotificationClick(const std::string& title, int action_index); |
| 255 void SimulateWebNotificationClickWithReply(const std::string& title, | |
| 256 int action_index, | |
| 257 const std::string& reply); | |
| 255 void SimulateWebNotificationClose(const std::string& title, bool by_user); | 258 void SimulateWebNotificationClose(const std::string& title, bool by_user); |
| 256 void UseUnfortunateSynchronousResizeMode(); | 259 void UseUnfortunateSynchronousResizeMode(); |
| 257 void WaitForPolicyDelegate(); | 260 void WaitForPolicyDelegate(); |
| 258 void WaitUntilDone(); | 261 void WaitUntilDone(); |
| 259 void WaitUntilExternalURLLoad(); | 262 void WaitUntilExternalURLLoad(); |
| 260 void SetMockCredentialManagerError(const std::string& error); | 263 void SetMockCredentialManagerError(const std::string& error); |
| 261 void SetMockCredentialManagerResponse(const std::string& id, | 264 void SetMockCredentialManagerResponse(const std::string& id, |
| 262 const std::string& name, | 265 const std::string& name, |
| 263 const std::string& avatar, | 266 const std::string& avatar, |
| 264 const std::string& password); | 267 const std::string& password); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 .SetMethod("setViewSourceForFrame", | 572 .SetMethod("setViewSourceForFrame", |
| 570 &TestRunnerBindings::SetViewSourceForFrame) | 573 &TestRunnerBindings::SetViewSourceForFrame) |
| 571 .SetMethod("setWillSendRequestClearHeader", | 574 .SetMethod("setWillSendRequestClearHeader", |
| 572 &TestRunnerBindings::SetWillSendRequestClearHeader) | 575 &TestRunnerBindings::SetWillSendRequestClearHeader) |
| 573 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) | 576 .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) |
| 574 .SetMethod("setXSSAuditorEnabled", | 577 .SetMethod("setXSSAuditorEnabled", |
| 575 &TestRunnerBindings::SetXSSAuditorEnabled) | 578 &TestRunnerBindings::SetXSSAuditorEnabled) |
| 576 .SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector) | 579 .SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector) |
| 577 .SetMethod("simulateWebNotificationClick", | 580 .SetMethod("simulateWebNotificationClick", |
| 578 &TestRunnerBindings::SimulateWebNotificationClick) | 581 &TestRunnerBindings::SimulateWebNotificationClick) |
| 582 .SetMethod("simulateWebNotificationClickWithReply", | |
| 583 &TestRunnerBindings::SimulateWebNotificationClickWithReply) | |
| 579 .SetMethod("simulateWebNotificationClose", | 584 .SetMethod("simulateWebNotificationClose", |
| 580 &TestRunnerBindings::SimulateWebNotificationClose) | 585 &TestRunnerBindings::SimulateWebNotificationClose) |
| 581 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText) | 586 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText) |
| 582 .SetMethod("useUnfortunateSynchronousResizeMode", | 587 .SetMethod("useUnfortunateSynchronousResizeMode", |
| 583 &TestRunnerBindings::UseUnfortunateSynchronousResizeMode) | 588 &TestRunnerBindings::UseUnfortunateSynchronousResizeMode) |
| 584 .SetMethod("waitForPolicyDelegate", | 589 .SetMethod("waitForPolicyDelegate", |
| 585 &TestRunnerBindings::WaitForPolicyDelegate) | 590 &TestRunnerBindings::WaitForPolicyDelegate) |
| 586 .SetMethod("waitUntilDone", &TestRunnerBindings::WaitUntilDone) | 591 .SetMethod("waitUntilDone", &TestRunnerBindings::WaitUntilDone) |
| 587 .SetMethod("waitUntilExternalURLLoad", | 592 .SetMethod("waitUntilExternalURLLoad", |
| 588 &TestRunnerBindings::WaitUntilExternalURLLoad) | 593 &TestRunnerBindings::WaitUntilExternalURLLoad) |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1350 | 1355 |
| 1351 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { | 1356 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
| 1352 if (runner_) | 1357 if (runner_) |
| 1353 runner_->SetMIDIAccessorResult(result); | 1358 runner_->SetMIDIAccessorResult(result); |
| 1354 } | 1359 } |
| 1355 | 1360 |
| 1356 void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title, | 1361 void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title, |
| 1357 int action_index) { | 1362 int action_index) { |
| 1358 if (!runner_) | 1363 if (!runner_) |
| 1359 return; | 1364 return; |
| 1360 runner_->SimulateWebNotificationClick(title, action_index); | 1365 runner_->SimulateWebNotificationClick(title, action_index, ""); |
| 1366 } | |
| 1367 | |
| 1368 void TestRunnerBindings::SimulateWebNotificationClickWithReply( | |
|
Peter Beverloo
2016/10/11 14:28:39
Ah, yeah, this is a fine middle ground :-).
Depen
awdf
2016/10/12 14:59:45
Done.
| |
| 1369 const std::string& title, | |
| 1370 int action_index, | |
| 1371 const std::string& reply) { | |
| 1372 if (!runner_) | |
| 1373 return; | |
| 1374 runner_->SimulateWebNotificationClick(title, action_index, reply); | |
| 1361 } | 1375 } |
| 1362 | 1376 |
| 1363 void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title, | 1377 void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title, |
| 1364 bool by_user) { | 1378 bool by_user) { |
| 1365 if (!runner_) | 1379 if (!runner_) |
| 1366 return; | 1380 return; |
| 1367 runner_->SimulateWebNotificationClose(title, by_user); | 1381 runner_->SimulateWebNotificationClose(title, by_user); |
| 1368 } | 1382 } |
| 1369 | 1383 |
| 1370 void TestRunnerBindings::AddMockSpeechRecognitionResult( | 1384 void TestRunnerBindings::AddMockSpeechRecognitionResult( |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2679 | 2693 |
| 2680 void TestRunner::SetPOSIXLocale(const std::string& locale) { | 2694 void TestRunner::SetPOSIXLocale(const std::string& locale) { |
| 2681 delegate_->SetLocale(locale); | 2695 delegate_->SetLocale(locale); |
| 2682 } | 2696 } |
| 2683 | 2697 |
| 2684 void TestRunner::SetMIDIAccessorResult(bool result) { | 2698 void TestRunner::SetMIDIAccessorResult(bool result) { |
| 2685 midi_accessor_result_ = result; | 2699 midi_accessor_result_ = result; |
| 2686 } | 2700 } |
| 2687 | 2701 |
| 2688 void TestRunner::SimulateWebNotificationClick(const std::string& title, | 2702 void TestRunner::SimulateWebNotificationClick(const std::string& title, |
| 2689 int action_index) { | 2703 int action_index, |
| 2690 delegate_->SimulateWebNotificationClick(title, action_index); | 2704 const std::string& reply) { |
| 2705 delegate_->SimulateWebNotificationClick(title, action_index, reply); | |
| 2691 } | 2706 } |
| 2692 | 2707 |
| 2693 void TestRunner::SimulateWebNotificationClose(const std::string& title, | 2708 void TestRunner::SimulateWebNotificationClose(const std::string& title, |
| 2694 bool by_user) { | 2709 bool by_user) { |
| 2695 delegate_->SimulateWebNotificationClose(title, by_user); | 2710 delegate_->SimulateWebNotificationClose(title, by_user); |
| 2696 } | 2711 } |
| 2697 | 2712 |
| 2698 void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript, | 2713 void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript, |
| 2699 double confidence) { | 2714 double confidence) { |
| 2700 getMockWebSpeechRecognizer()->AddMockResult(WebString::fromUTF8(transcript), | 2715 getMockWebSpeechRecognizer()->AddMockResult(WebString::fromUTF8(transcript), |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2770 | 2785 |
| 2771 void TestRunner::NotifyDone() { | 2786 void TestRunner::NotifyDone() { |
| 2772 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2787 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2773 !will_navigate_ && work_queue_.is_empty()) | 2788 !will_navigate_ && work_queue_.is_empty()) |
| 2774 delegate_->TestFinished(); | 2789 delegate_->TestFinished(); |
| 2775 layout_test_runtime_flags_.set_wait_until_done(false); | 2790 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2776 OnLayoutTestRuntimeFlagsChanged(); | 2791 OnLayoutTestRuntimeFlagsChanged(); |
| 2777 } | 2792 } |
| 2778 | 2793 |
| 2779 } // namespace test_runner | 2794 } // namespace test_runner |
| OLD | NEW |