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

Side by Side Diff: third_party/WebKit/LayoutTests/mojo/interface_ptr.html

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Throw the error with the string being the stack trace needed to debug layouts which don't output an… Created 3 years, 8 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 7
8 setup({ explicit_done: true }); 8 setup({ explicit_done: true });
9 9
10 define([ 10 define([
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bindings.makeRequest(calc)); 90 bindings.makeRequest(calc));
91 91
92 await new Promise((resolve, reject) => { 92 await new Promise((resolve, reject) => {
93 calc.ptr.setConnectionErrorHandler(() => { resolve(); }); 93 calc.ptr.setConnectionErrorHandler(() => { resolve(); });
94 calcBinding.close(); 94 calcBinding.close();
95 }); 95 });
96 }, 'connection error'); 96 }, 'connection error');
97 97
98 promise_test(async () => { 98 promise_test(async () => {
99 var calc = new math.CalculatorPtr(); 99 var calc = new math.CalculatorPtr();
100 var calcBinding = new bindings.Binding(math.Calculator,
101 new CalculatorImpl(),
102 bindings.makeRequest(calc));
103
104 await new Promise((resolve, reject) => {
105 calc.ptr.setConnectionErrorHandler(({custom_reason, description}) => {
106 assert_equals(custom_reason, 42);
107 assert_equals(description, 'hey');
108 resolve();
109 });
110 calcBinding.closeWithReason({custom_reason: 42, description: 'hey'});
111 });
112 }, 'connection error with reason');
113
114 promise_test(async () => {
115 var calc = new math.CalculatorPtr();
100 var newCalc = null; 116 var newCalc = null;
101 var calcBinding = new bindings.Binding(math.Calculator, 117 var calcBinding = new bindings.Binding(math.Calculator,
102 new CalculatorImpl(), 118 new CalculatorImpl(),
103 bindings.makeRequest(calc)); 119 bindings.makeRequest(calc));
104 120
105 assert_equals((await calc.add(2)).value, 2); 121 assert_equals((await calc.add(2)).value, 2);
106 newCalc = new math.CalculatorPtr(); 122 newCalc = new math.CalculatorPtr();
107 newCalc.ptr.bind(calc.ptr.passInterface()); 123 newCalc.ptr.bind(calc.ptr.passInterface());
108 assert_false(calc.ptr.isBound()); 124 assert_false(calc.ptr.isBound());
109 assert_equals((await newCalc.add(2)).value, 4); 125 assert_equals((await newCalc.add(2)).value, 4);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 }); 183 });
168 }); 184 });
169 assert_equals(integerAccessorImpl.integer, 456); 185 assert_equals(integerAccessorImpl.integer, 456);
170 186
171 }, 'require version'); 187 }, 'require version');
172 188
173 done(); 189 done();
174 }); 190 });
175 191
176 </script> 192 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/mojo/connection.html ('k') | third_party/WebKit/LayoutTests/vibration/vibration-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698