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

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

Issue 1470823002: Enable builtin Mojo JS modules in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-testing
Patch Set: add 'define' to global interface expectations for AMD in layout tests Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 'use strict';
2
3 // Runs a promise_test which depends on the Mojo system API modules available to
4 // all layout tests. The test implementation function is called with an Object
5 // that exposes common Mojo module interfaces.
6 function mojo_test(func, name, properties) {
7 promise_test(() => {
8 return new Promise((resolve, reject) => {
9 define('Mojo layout test module: ' + name, [
10 'mojo/public/js/core',
11 'mojo/public/js/router',
12 'content/public/renderer/service_provider',
13 ], (core, router, serviceProvider) => {
14 try {
15 resolve(func({
16 core: core,
17 router: router,
18
19 // |serviceProvider| is a bit of a misnomer. It should probably be
20 // called |serviceRegistry|, so let's call it that here.
21 serviceRegistry: serviceProvider,
22 }));
23 } catch (e) {
24 reject(e);
25 }
26 });
27 });
28 }, name, properties);
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698