Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: third_party/WebKit/LayoutTests/resources/mojo-helpers.js

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: fixes webui tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/resources/mojo-helpers.js
diff --git a/third_party/WebKit/LayoutTests/resources/mojo-helpers.js b/third_party/WebKit/LayoutTests/resources/mojo-helpers.js
index 92ddd8d5ae3e7c07dbd8dcf2bdcbf9ab341a1a46..dd9800c19ec3681d6fa1775df84e81eb7fc51069 100644
--- a/third_party/WebKit/LayoutTests/resources/mojo-helpers.js
+++ b/third_party/WebKit/LayoutTests/resources/mojo-helpers.js
@@ -28,14 +28,12 @@ let define = (function(){
})();
define('Mojo Helpers', [
- 'mojo/public/js/core',
'mojo/public/js/router',
- 'mojo/public/js/support',
'content/public/renderer/frame_interfaces',
'content/public/renderer/interfaces',
'content/shell/renderer/layout_test/frame_interface_registry',
'content/shell/renderer/layout_test/interface_registry',
-], (core, router, support, frameInterfaces, interfaces, frameInterfaceRegistry,
+], (router, frameInterfaces, interfaces, frameInterfaceRegistry,
interfaceRegistry) => {
let tearDown = () => {
frameInterfaces.clearInterfaceOverridesForTesting();
@@ -46,9 +44,7 @@ define('Mojo Helpers', [
add_completion_callback(tearDown);
return {
- core,
router,
- support,
frameInterfaces,
frameInterfaceRegistry,
interfaces,
@@ -80,14 +76,14 @@ function mojo_test(func, name, properties) {
// Waits for a message to become available on a pipe.
function mojo_wait_for_incoming_message(mojo, pipe) {
return new Promise((resolve, reject) => {
- mojo.support.asyncWait(pipe, mojo.core.HANDLE_SIGNAL_READABLE, result => {
- if (result != mojo.core.RESULT_OK) {
- reject(result);
+ let watcher = pipe.watch({ readable: true }, watchResult => {
+ watcher.cancel();
+ if (watchResult != Mojo.RESULT_OK) {
+ reject(watchResult);
return;
}
- let buffer, handles;
- ({ result, buffer, handles } = mojo.core.readMessage(pipe, 0));
- if (result !== mojo.core.RESULT_OK) {
+ let { result, buffer, handles } = pipe.readMessage();
+ if (result !== Mojo.RESULT_OK) {
reject(result);
return;
}

Powered by Google App Engine
This is Rietveld 408576698