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

Unified Diff: third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html

Issue 1827473002: Make the process-wide ServiceRegistry available to JS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/harness-tests/mojo-helpers.html
diff --git a/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html b/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html
index 5a869ba479eef205659fa40576a5852405fbdf2f..41f062278ae081b4e43822698414c2c90f6b5559 100644
--- a/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html
+++ b/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html
@@ -11,6 +11,7 @@ mojo_test(mojo => {
assert_true(mojo instanceof Object);
assert_true(mojo.core instanceof Object);
assert_true(mojo.router instanceof Object);
+ assert_true(mojo.frameServiceRegistry instanceof Object);
assert_true(mojo.serviceRegistry instanceof Object);
}, 'Mojo system APIs should be available to layout tests.');
@@ -18,6 +19,22 @@ mojo_test(mojo => {
return new Promise(resolve => {
let calls = 0;
// Complete the test as soon as two requests come in for a Frobinator service.
+ mojo.frameServiceRegistry.addServiceOverrideForTesting('Frobinator', () => {
+ if (++calls == 2)
+ resolve();
+ });
+
+ // Try to connect to the browser's Frobinator service. This should be
+ // intercepted by the above override.
+ mojo.frameServiceRegistry.connectToService('Frobinator');
+ mojo.frameServiceRegistry.connectToService('Frobinator');
+ });
+}, 'Frame service registry overrides should be properly intercepted.');
+
+mojo_test(mojo => {
+ return new Promise(resolve => {
+ let calls = 0;
+ // Complete the test as soon as two requests come in for a Frobinator service.
mojo.serviceRegistry.addServiceOverrideForTesting('Frobinator', () => {
if (++calls == 2)
resolve();
« no previous file with comments | « extensions/test/data/data_sender_unittest.js ('k') | third_party/WebKit/LayoutTests/resources/mojo-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698