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

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

Issue 2788403002: Revert of Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: 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();
116 var newCalc = null; 100 var newCalc = null;
117 var calcBinding = new bindings.Binding(math.Calculator, 101 var calcBinding = new bindings.Binding(math.Calculator,
118 new CalculatorImpl(), 102 new CalculatorImpl(),
119 bindings.makeRequest(calc)); 103 bindings.makeRequest(calc));
120 104
121 assert_equals((await calc.add(2)).value, 2); 105 assert_equals((await calc.add(2)).value, 2);
122 newCalc = new math.CalculatorPtr(); 106 newCalc = new math.CalculatorPtr();
123 newCalc.ptr.bind(calc.ptr.passInterface()); 107 newCalc.ptr.bind(calc.ptr.passInterface());
124 assert_false(calc.ptr.isBound()); 108 assert_false(calc.ptr.isBound());
125 assert_equals((await newCalc.add(2)).value, 4); 109 assert_equals((await newCalc.add(2)).value, 4);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 }); 167 });
184 }); 168 });
185 assert_equals(integerAccessorImpl.integer, 456); 169 assert_equals(integerAccessorImpl.integer, 456);
186 170
187 }, 'require version'); 171 }, 'require version');
188 172
189 done(); 173 done();
190 }); 174 });
191 175
192 </script> 176 </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