OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <set> | 10 #include <set> |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 575 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
576 test_phase_ = CLEAN_UP; | 576 test_phase_ = CLEAN_UP; |
577 } else if (main_window_) { | 577 } else if (main_window_) { |
578 main_window_->Close(); | 578 main_window_->Close(); |
579 } | 579 } |
580 main_window_ = NULL; | 580 main_window_ = NULL; |
581 current_pid_ = base::kNullProcessId; | 581 current_pid_ = base::kNullProcessId; |
582 } | 582 } |
583 | 583 |
584 void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) { | 584 void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) { |
585 // All RenderViewHosts in layout tests should get Mojo bindings. | 585 // All RenderFrameHosts in layout tests should get Mojo bindings. |
586 RenderViewHost* rvh = frame->GetRenderViewHost(); | 586 if (!(frame->GetEnabledBindings() & BINDINGS_POLICY_MOJO)) |
587 if (!(rvh->GetEnabledBindings() & BINDINGS_POLICY_MOJO)) | 587 frame->AllowBindings(BINDINGS_POLICY_MOJO); |
588 rvh->AllowBindings(BINDINGS_POLICY_MOJO); | |
589 | 588 |
590 RenderProcessHost* process = frame->GetProcess(); | 589 RenderProcessHost* process = frame->GetProcess(); |
591 bool main_window = | 590 bool main_window = |
592 WebContents::FromRenderFrameHost(frame) == main_window_->web_contents(); | 591 WebContents::FromRenderFrameHost(frame) == main_window_->web_contents(); |
593 | 592 |
594 // Track pid of the renderer handling the main frame. | 593 // Track pid of the renderer handling the main frame. |
595 if (main_window && frame->GetParent() == nullptr) { | 594 if (main_window && frame->GetParent() == nullptr) { |
596 base::ProcessHandle process_handle = process->GetHandle(); | 595 base::ProcessHandle process_handle = process->GetHandle(); |
597 if (process_handle != base::kNullProcessHandle) | 596 if (process_handle != base::kNullProcessHandle) |
598 current_pid_ = base::GetProcId(process_handle); | 597 current_pid_ = base::GetProcId(process_handle); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 } else { | 946 } else { |
948 printer_->AddErrorMessage(base::StringPrintf( | 947 printer_->AddErrorMessage(base::StringPrintf( |
949 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 948 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
950 event_name.c_str())); | 949 event_name.c_str())); |
951 return; | 950 return; |
952 } | 951 } |
953 bluetooth_chooser_factory_->SendEvent(event, argument); | 952 bluetooth_chooser_factory_->SendEvent(event, argument); |
954 } | 953 } |
955 | 954 |
956 } // namespace content | 955 } // namespace content |
OLD | NEW |