OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/layout_test/blink_test_runner.h" | 5 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <clocale> | 10 #include <clocale> |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 .Utf8(); | 595 .Utf8(); |
596 } | 596 } |
597 | 597 |
598 void BlinkTestRunner::SetLocale(const std::string& locale) { | 598 void BlinkTestRunner::SetLocale(const std::string& locale) { |
599 setlocale(LC_ALL, locale.c_str()); | 599 setlocale(LC_ALL, locale.c_str()); |
600 } | 600 } |
601 | 601 |
602 void BlinkTestRunner::OnLayoutTestRuntimeFlagsChanged( | 602 void BlinkTestRunner::OnLayoutTestRuntimeFlagsChanged( |
603 const base::DictionaryValue& changed_values) { | 603 const base::DictionaryValue& changed_values) { |
604 // Ignore changes that happen before we got the initial, accumulated | 604 // Ignore changes that happen before we got the initial, accumulated |
605 // layout flag changes in ShellViewMsg_ReplicateTestConfiguration. | 605 // layout flag changes in either OnReplicateTestConfiguration or |
606 if (!is_main_window_) | 606 // OnSetTestConfiguration. |
| 607 test_runner::WebTestInterfaces* interfaces = |
| 608 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
| 609 if (!interfaces->TestIsRunning()) |
607 return; | 610 return; |
608 | 611 |
609 RenderThread::Get()->Send( | 612 RenderThread::Get()->Send( |
610 new LayoutTestHostMsg_LayoutTestRuntimeFlagsChanged(changed_values)); | 613 new LayoutTestHostMsg_LayoutTestRuntimeFlagsChanged(changed_values)); |
611 } | 614 } |
612 | 615 |
613 void BlinkTestRunner::TestFinished() { | 616 void BlinkTestRunner::TestFinished() { |
| 617 test_runner::WebTestInterfaces* interfaces = |
| 618 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
| 619 interfaces->SetTestIsRunning(false); |
| 620 |
614 if (!is_main_window_ || !render_view()->GetMainRenderFrame()) { | 621 if (!is_main_window_ || !render_view()->GetMainRenderFrame()) { |
615 RenderThread::Get()->Send( | 622 RenderThread::Get()->Send( |
616 new LayoutTestHostMsg_TestFinishedInSecondaryRenderer()); | 623 new LayoutTestHostMsg_TestFinishedInSecondaryRenderer()); |
617 return; | 624 return; |
618 } | 625 } |
619 test_runner::WebTestInterfaces* interfaces = | 626 |
620 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | |
621 interfaces->SetTestIsRunning(false); | |
622 if (interfaces->TestRunner()->ShouldDumpBackForwardList()) { | 627 if (interfaces->TestRunner()->ShouldDumpBackForwardList()) { |
623 SyncNavigationStateVisitor visitor; | 628 SyncNavigationStateVisitor visitor; |
624 RenderView::ForEach(&visitor); | 629 RenderView::ForEach(&visitor); |
625 Send(new ShellViewHostMsg_CaptureSessionHistory(routing_id())); | 630 Send(new ShellViewHostMsg_CaptureSessionHistory(routing_id())); |
626 } else { | 631 } else { |
627 // clean out the lifecycle if needed before capturing the layout tree | 632 // clean out the lifecycle if needed before capturing the layout tree |
628 // dump and pixels from the compositor. | 633 // dump and pixels from the compositor. |
629 render_view() | 634 render_view() |
630 ->GetWebView() | 635 ->GetWebView() |
631 ->MainFrame() | 636 ->MainFrame() |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 void BlinkTestRunner::ReportLeakDetectionResult( | 1058 void BlinkTestRunner::ReportLeakDetectionResult( |
1054 const LeakDetectionResult& report) { | 1059 const LeakDetectionResult& report) { |
1055 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1060 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
1056 } | 1061 } |
1057 | 1062 |
1058 void BlinkTestRunner::OnDestruct() { | 1063 void BlinkTestRunner::OnDestruct() { |
1059 delete this; | 1064 delete this; |
1060 } | 1065 } |
1061 | 1066 |
1062 } // namespace content | 1067 } // namespace content |
OLD | NEW |