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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 setlocale(LC_ALL, locale.c_str()); | 522 setlocale(LC_ALL, locale.c_str()); |
523 } | 523 } |
524 | 524 |
525 void BlinkTestRunner::OnLayoutTestRuntimeFlagsChanged( | 525 void BlinkTestRunner::OnLayoutTestRuntimeFlagsChanged( |
526 const base::DictionaryValue& changed_values) { | 526 const base::DictionaryValue& changed_values) { |
527 // Ignore changes that happen before we got the initial, accumulated | 527 // Ignore changes that happen before we got the initial, accumulated |
528 // layout flag changes in ShellViewMsg_ReplicateTestConfiguration. | 528 // layout flag changes in ShellViewMsg_ReplicateTestConfiguration. |
529 if (!is_main_window_) | 529 if (!is_main_window_) |
530 return; | 530 return; |
531 | 531 |
532 // Message needs to be send via a local frame to eventually reach | 532 RenderThread::Get()->Send( |
533 // WebContentsObserver via OnMessage(..., RenderFrameHost*) overload - this | 533 new LayoutTestHostMsg_LayoutTestRuntimeFlagsChanged(changed_values)); |
Łukasz Anforowicz
2016/04/15 20:17:51
dcheng@ was (rightfully) unhappy about the shape o
| |
534 // lets BlinkTestController figure out the originator of the message. | |
535 RenderFrame* local_frame = nullptr; | |
536 for (WebFrame* frame = render_view()->GetWebView()->mainFrame(); frame; | |
537 frame = frame->traverseNext(false)) { | |
538 if (frame->isWebLocalFrame()) { | |
539 local_frame = RenderFrame::FromWebFrame(frame); | |
540 break; | |
541 } | |
542 } | |
543 DCHECK(local_frame); | |
544 Send(new ShellViewHostMsg_LayoutTestRuntimeFlagsChanged( | |
545 local_frame->GetRoutingID(), changed_values)); | |
546 } | 534 } |
547 | 535 |
548 void BlinkTestRunner::TestFinished() { | 536 void BlinkTestRunner::TestFinished() { |
549 if (!is_main_window_ || !render_view()->GetMainRenderFrame()) { | 537 if (!is_main_window_ || !render_view()->GetMainRenderFrame()) { |
550 Send(new ShellViewHostMsg_TestFinishedInSecondaryRenderer(routing_id())); | 538 Send(new ShellViewHostMsg_TestFinishedInSecondaryRenderer(routing_id())); |
551 return; | 539 return; |
552 } | 540 } |
553 test_runner::WebTestInterfaces* interfaces = | 541 test_runner::WebTestInterfaces* interfaces = |
554 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); | 542 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); |
555 interfaces->SetTestIsRunning(false); | 543 interfaces->SetTestIsRunning(false); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
972 get_bluetooth_events_callbacks_.pop_front(); | 960 get_bluetooth_events_callbacks_.pop_front(); |
973 callback.Run(events); | 961 callback.Run(events); |
974 } | 962 } |
975 | 963 |
976 void BlinkTestRunner::ReportLeakDetectionResult( | 964 void BlinkTestRunner::ReportLeakDetectionResult( |
977 const LeakDetectionResult& report) { | 965 const LeakDetectionResult& report) { |
978 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 966 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
979 } | 967 } |
980 | 968 |
981 } // namespace content | 969 } // namespace content |
OLD | NEW |