commit | 8df5c724f1df87044980ff8b6618d367608bc4cf | [log] [tgz] |
---|---|---|
author | rockot <[email protected]> | Tue Jan 26 07:15:14 2016 |
committer | Commit bot <[email protected]> | Tue Jan 26 07:16:36 2016 |
tree | 14a25e955840d5d98ccd267719ea6e2dec5998a3 | |
parent | d7ecf41cea5cadad69535740e07bb6887283fc32 [diff] [blame] |
Enable builtin Mojo JS modules in layout tests This adds a new BindingsPolicy exclusively for enabling Mojo system API and ServiceRegistry modules to a render view. Previously these were only made available in conjunction with WebUI bindings. While still implied by WebUI bindings availability, Mojo modules are now also available to any view created during a layout test run. Part of a CL series to enable Mojo service mocks in layout tests: 1. https://codereview.chromium.org/1468903002 2. this CL 3. https://codereview.chromium.org/1470153002 [email protected] for WebUI Review URL: https://codereview.chromium.org/1470823002 Cr-Commit-Position: refs/heads/master@{#371470}
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 84e6d1a..cb1625f 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -2361,7 +2361,13 @@ new WebUIExtensionData(this); if (main_render_frame_) - main_render_frame_->EnableMojoBindings(); + main_render_frame_->EnableMojoBindings(false /* for_layout_tests */); + } + + if ((enabled_bindings_flags & BINDINGS_POLICY_MOJO) && + !(enabled_bindings_ & BINDINGS_POLICY_MOJO) && + main_render_frame_) { + main_render_frame_->EnableMojoBindings(true /* for_layout_tests */); } enabled_bindings_ |= enabled_bindings_flags;