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

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

Issue 1639233004: Revert of [mojo] Enable ServiceRegistryImpl to override remote services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-testing-3
Patch Set: 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 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 79cbcec02d37a55fdd74b426eb1258f945a70e06..c16f63c0bdc2c57eb1e150b3ab628235ac195208 100644
--- a/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html
+++ b/third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html
@@ -13,59 +13,4 @@
assert_true(mojo.router instanceof Object);
assert_true(mojo.serviceRegistry instanceof Object);
}, 'Mojo system APIs should be available to layout tests.');
-
-mojo_test(mojo => {
- return new Promise(resolve => {
- // Complete the test as soon as a request comes in for a Frobinator service.
- mojo.serviceRegistry.addServiceOverrideForTesting('Frobinator', resolve);
-
- // Try to connect to the browser's Frobinator service. This should be
- // intercepted by the above override.
- mojo.serviceRegistry.connectToService('Frobinator');
- });
-}, 'Service registry overrides should be properly intercepted.');
-
-mojo_test(mojo => {
- return new Promise(resolve => {
- let TEST_REQUEST = new Uint8Array([42, 0, 2, 3, 5, 7, 11, 13, 17, 19, 23]);
-
- mojo.serviceRegistry.addServiceOverrideForTesting('Frobinator', pipe => {
- resolve(mojo_wait_for_incoming_message(mojo, pipe)
- .then(message => {
- assert_array_equals(new Uint8Array(message.buffer), TEST_REQUEST);
- assert_array_equals(message.handles, []);
- }));
- });
-
- let pipe = mojo.serviceRegistry.connectToService('Frobinator');
- assert_equals(mojo.core.writeMessage(pipe, TEST_REQUEST, [], 0),
- mojo.core.RESULT_OK);
- });
-}, 'Mock services can receive messages from test code.');
-
-mojo_test(mojo => {
- let TEST_REQUEST = new Uint8Array([1, 2, 3, 4, 5]);
- let EXPECTED_RESPONSE = new Uint8Array([5, 4, 3, 2, 1]);
-
- // Mock service should respond to any message with its reverse.
- mojo.serviceRegistry.addServiceOverrideForTesting('Reversinator', pipe => {
- mojo_wait_for_incoming_message(mojo, pipe)
- .then(message => {
- let response = new Uint8Array(message.buffer);
- response.reverse();
- assert_equals(mojo.core.writeMessage(pipe, response, [], 0),
- mojo.core.RESULT_OK);
- });
- });
-
- let pipe = mojo.serviceRegistry.connectToService('Reversinator');
- assert_equals(mojo.core.writeMessage(pipe, TEST_REQUEST, [], 0),
- mojo.core.RESULT_OK);
-
- return mojo_wait_for_incoming_message(mojo, pipe)
- .then(response => {
- assert_array_equals(new Uint8Array(response.buffer), EXPECTED_RESPONSE);
- assert_array_equals(response.handles, []);
- });
-}, 'Test code can receive response messages from mock services.');
</script>
« no previous file with comments | « content/renderer/mojo/service_registry_js_wrapper.cc ('k') | third_party/WebKit/LayoutTests/resources/mojo-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698